Skip to content

Commit e5e567a

Browse files
committed
fix core attributes
1 parent 11a6e8d commit e5e567a

File tree

3 files changed

+21
-19
lines changed

3 files changed

+21
-19
lines changed
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
### Device and OS Attributes
1+
### Core Attributes
22

3-
- `os.name`: The name of the operating system.
4-
- `os.version`: The version of the operating system.
5-
- `device.brand`: The brand of the device.
6-
- `device.model`: The model of the device.
7-
- `device.family`: The family of the device.
3+
- `environment`: The environment set in the SDK if defined. This is sent from the SDK as `sentry.environment`.
4+
- `release`: The release set in the SDK if defined. This is sent from the SDK as `sentry.release`.
5+
- `trace.parent_span_id`: The span ID of the span that was active when the log was collected (only set if there was an active span). This is sent from the SDK as `sentry.trace.parent_span_id`.
6+
- `sdk.name`: The name of the SDK that sent the log. This is sent from the SDK as `sentry.sdk.name`. This is sent from the SDK as `sentry.sdk.name`.
7+
- `sdk.version`: The version of the SDK that sent the log. This is sent from the SDK as `sentry.sdk.version`. This is sent from the SDK as `sentry.sdk.version`.

includes/logs/javascript-usage.mdx

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,30 +7,32 @@ Aside from the primary logging methods, we've provided a format text function, `
77
These properties will be sent to Sentry, and can be searched from within the Logs UI, and even added to the Logs views as a dedicated column.
88

99
```js
10-
const { logger } = Sentry;
11-
12-
logger.error(logger.fmt`Uh on, something broke, here's the error: '${error}'`);
13-
logger.info(logger.fmt`'${user.username}' added '${product.name}' to cart.`);
10+
Sentry.logger.error(
11+
Sentry.logger.fmt`Uh on, something broke, here's the error: '${error}'`
12+
);
13+
Sentry.logger.info(
14+
Sentry.logger.fmt`'${user.username}' added '${product.name}' to cart.`
15+
);
1416
```
1517

1618
You can also pass additional attributes directly to the logging functions, avoiding the need to use the `fmt` function.
1719

1820
```js
19-
const { logger } = Sentry;
20-
21-
logger.trace("Starting database connection", { database: "users" });
22-
logger.debug("Cache miss for user", { userId: 123 });
23-
logger.info("Updated profile", { profileId: 345 });
24-
logger.warn("Rate limit reached for endpoint", {
21+
Sentry.logger.trace("Starting database connection", { database: "users" });
22+
Sentry.logger.debug("Cache miss for user", { userId: 123 });
23+
Sentry.logger.info("Updated profile", { profileId: 345 });
24+
Sentry.logger.warn("Rate limit reached for endpoint", {
2525
endpoint: "/api/results/",
2626
isEnterprise: false,
2727
});
28-
logger.error("Failed to process payment", {
28+
Sentry.logger.error("Failed to process payment", {
2929
orderId: "order_123",
3030
amount: 99.99,
3131
});
32-
logger.fatal("Database connection pool exhausted", {
32+
Sentry.logger.fatal("Database connection pool exhausted", {
3333
database: "users",
3434
activeConnections: 100,
3535
});
3636
```
37+
38+
Setting a log message is required for the Sentry SDK to send the log to Sentry.

platform-includes/logs/usage/android.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,4 @@ Sentry.logger().log(
6464
"log message %s",
6565
"param1"
6666
)
67-
```
67+
```

0 commit comments

Comments
 (0)