Skip to content

Commit 56635a5

Browse files
committed
feat: Add release and environment to logs
1 parent a41aed6 commit 56635a5

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

packages/core/src/log.ts

+20
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,26 @@ export function captureLog(level: LogSeverityLevel, messages: string[] | string,
127127
});
128128
}
129129

130+
const { release, environment } = client.getOptions();
131+
132+
if (release) {
133+
attributes.push({
134+
key: 'sentry.release',
135+
value: {
136+
stringValue: release,
137+
},
138+
});
139+
}
140+
141+
if (environment) {
142+
attributes.push({
143+
key: 'sentry.environment',
144+
value: {
145+
stringValue: environment,
146+
},
147+
});
148+
}
149+
130150
const scope = getCurrentScope();
131151

132152
const log: Log = {

0 commit comments

Comments
 (0)