Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Session ID doesn't populate when creating logs from LWC #678

Closed
jongpie opened this issue Apr 22, 2024 Discussed in #677 · 1 comment · Fixed by #679
Closed

Session ID doesn't populate when creating logs from LWC #678

jongpie opened this issue Apr 22, 2024 Discussed in #677 · 1 comment · Fixed by #679
Assignees
Labels
Layer: Logger Engine Items related to the core logging engine Logging Source: Lightning Components Items related to using Nebula Logger using JavaScript within lightning components (lwc & aura) Type: Bug Something isn't working

Comments

@jongpie
Copy link
Owner

jongpie commented Apr 22, 2024

Discussed in #677

Originally posted by Suryansh-2301 April 22, 2024
I have created a simple LWC component with a button and on clicking it button I want to create a log with a message and wants to capture session details as well. I m passing methodName as 'SYNCHROMOUS_DML'/'REST' in the saveLog method but doesn't seems to workout.

Note : I'm using the latest Nebula release i.e. 4.13.6 and it's unlocked.

HTML:

<template>
<c-logger></c-logger>
<h1>Nebula Logger Test</h1>
<lightning-button variant="base" label="labelName" title="titleName" onclick={handleClick}></lightning-button>
</template>

JS:

import { LightningElement } from 'lwc';
export default class TestNebula extends LightningElement {
    handleClick(){
        const logger = this.template.querySelector('c-logger');

        logger.info('Button Clicked');
        logger.saveLog('SYNCHRONOUS_DML');
    }
}

js-meta.XML

<?xml version="1.0"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
	<apiVersion>57.0</apiVersion>
	<isExposed>true</isExposed>
	<targets>
		<target>lightning__RecordPage</target>
		<target>lightning__AppPage</target>
		<target>lightning__HomePage</target>
	</targets>
</LightningComponentBundle>
```</div>
@jongpie jongpie added Type: Bug Something isn't working Logging Source: Lightning Components Items related to using Nebula Logger using JavaScript within lightning components (lwc & aura) Layer: Logger Engine Items related to the core logging engine labels Apr 22, 2024
@jongpie jongpie changed the title Session ID doesn't populates when creating logs from LWC Session ID doesn't populate when creating logs from LWC Apr 22, 2024
jongpie added a commit that referenced this issue Apr 23, 2024
@jongpie jongpie self-assigned this Apr 23, 2024
jongpie added a commit that referenced this issue Apr 24, 2024
* Fixed #678 by updating LoggerEngineDataSelector to not filter 'ParentId = null' when querying AuthSession - sessions for LWCs have a ParentId value set, so the filter previously prevented any data from being returned from AuthSession

* Added a small enhancement to store the ParentId of the AuthSession record in new fields LogEntryEvent__e.ParentSessionId__c and Log__c.ParentSessionId__c

* Improved & expanded upon some test methods in LogEntryEventBuilder_Tests and LogEntryEventHandler_Tests
@jongpie
Copy link
Owner Author

jongpie commented Apr 24, 2024

Fixed in release v4.13.10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Layer: Logger Engine Items related to the core logging engine Logging Source: Lightning Components Items related to using Nebula Logger using JavaScript within lightning components (lwc & aura) Type: Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant