Skip to content

Commit

Permalink
Add @session.id in Logs along to @session_id
Browse files Browse the repository at this point in the history
  • Loading branch information
nulrich committed Nov 12, 2024
1 parent 08b2ab4 commit 88a978d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
3 changes: 3 additions & 0 deletions packages/logs/src/boot/startLogs.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ describe('logs', () => {
message: 'message',
service: 'service',
session_id: jasmine.any(String),
session: {
id: jasmine.any(String),
},
status: StatusType.warn,
view: {
referrer: 'common_referrer',
Expand Down
1 change: 1 addition & 0 deletions packages/logs/src/domain/assembly.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export function startLogsAssembly(
{
service: configuration.service,
session_id: session ? session.id : undefined,
session: session ? { id: session.id } : undefined,
// Insert user first to allow overrides from global context
usr: !isEmptyObject(commonContext.user) ? commonContext.user : undefined,
view: commonContext.view,
Expand Down
13 changes: 12 additions & 1 deletion packages/logs/src/logsEvent.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,20 @@ export interface LogsEvent {
*/
service?: string
/**
* UUID of the session
* UUID of the session (deprecated in favor of session.id)
*/
session_id?: string
/**
* Session properties
*/
session?: {
/**
* UUID of the session
*/
id?: string

[k: string]: unknown
}
/**
* View properties
*/
Expand Down

0 comments on commit 88a978d

Please sign in to comment.