You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: develop-docs/sdk/telemetry/logs.mdx
+26-17Lines changed: 26 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,19 +29,24 @@ The `log` envelope item payload is a JSON object that represents a Sentry Log. M
29
29
"body": "User John has logged in!",
30
30
"attributes": {
31
31
"sentry.message.template": {
32
-
"string_value": "User %s has logged in!"
32
+
"value": "User %s has logged in!",
33
+
"type": "string"
33
34
},
34
35
"sentry.message.parameters.0": {
35
-
"string_value": "John"
36
+
"value": "John",
37
+
"type": "string"
36
38
},
37
39
"sentry.environment": {
38
-
"string_value": "production"
40
+
"value": "production",
41
+
"type": "string"
39
42
},
40
43
"sentry.release": {
41
-
"string_value": "1.0.0"
44
+
"value": "1.0.0",
45
+
"type": "string"
42
46
},
43
47
"sentry.trace.parent_span_id": {
44
-
"string_value": "b0e6f15b45c36b12"
48
+
"value": "b0e6f15b45c36b12",
49
+
"type": "string"
45
50
}
46
51
}
47
52
}
@@ -69,24 +74,28 @@ It consists of the following fields:
69
74
70
75
: **Object, optional**. A dictionary of key-value pairs of arbitrary data attached to the log. Attributes must also declare the type of the value. The following types are supported: `string`, `boolean`, `integer`, `double`.
71
76
72
-
Note: `intValue` is a string because JSON only recognizes numbers as floating point values.
77
+
Note: `type: "integer"` has string values because JSON only recognizes numbers as floating point values.
73
78
74
79
Example:
75
80
76
81
```json
77
82
{
78
83
"attributes": {
79
-
"string_item": {
80
-
"stringValue": "value"
84
+
"db.namespace": {
85
+
"value": "projects",
86
+
"type": "string"
81
87
},
82
-
"integer_item": {
83
-
"intValue": "123"
88
+
"db.response.returned_rows": {
89
+
"value": "123",
90
+
"type": "integer"
84
91
},
85
-
"boolean_item": {
86
-
"boolValue": true
92
+
"db_query_processing_time": {
93
+
"value": 123.456,
94
+
"type": "double"
87
95
},
88
-
"double_item": {
89
-
"doubleValue": 123.456
96
+
"is_production_db": {
97
+
"value": false,
98
+
"type": "boolean"
90
99
}
91
100
}
92
101
}
@@ -136,7 +145,7 @@ The SDKs need to expose the following two configuration options:
136
145
137
146
```js
138
147
Sentry.init({
139
-
enableSentryLogs:true,
148
+
enableLogs:true,
140
149
141
150
beforeSendLog(log) {
142
151
// Prevent logs from being sent to Sentry if the plan type is enterprise
@@ -280,9 +289,9 @@ Beyond these attributes, we are exploring if the SDK should also send OS, user,
280
289
281
290
### SDK Integrations
282
291
283
-
SDKs should aim to have it so that console/logger integrations create logs as per the appropriate log level if `enableSentryLogs` is set to true. Examples of this include JavaScript's `console`methods and Pythons `logging` standard library.
292
+
SDKs should aim to have it so that console/logger integrations create logs as per the appropriate log level if `enableLogs` is set to true. Examples of this include JavaScript's `console`object and Pythons `logging` standard library.
284
293
285
-
If SDK authors feel the need, they can also introduce additional options to beyond `enableSentryLogs` to gate this functionality. For example an option to control log appenders added via external config like with `Log4j` in the Java SDK.
294
+
If SDK authors feel the need, they can also introduce additional options to beyond `enableLogs` to gate this functionality. For example an option to control log appenders added via external config like with `Log4j` in the Java SDK.
0 commit comments