Skip to content

Commit cb02a70

Browse files
adinauerimatwawana
andauthored
Add note explaining that minimumEventLevel and minimumBreadcrumbLevel… (#5137)
* Add note explaining that minimumEventLevel and minimumBreadcrumbLevel only affect log messages, not direct calls to Sentry.capture * Update src/includes/getting-started-config/java.jul.mdx Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com> * Update src/includes/getting-started-config/java.log4j2.mdx Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com> * Update src/includes/getting-started-config/java.logback.mdx Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com> Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com>
1 parent 5430c8c commit cb02a70

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

src/includes/getting-started-config/java.jul.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ Two log levels are used to configure this integration:
4040
1. Configure the lowest level required for a log message to become an event (`minimumEventLevel`) sent to Sentry.
4141
2. Configure the lowest level a message has to be to become a breadcrumb (`minimumBreadcrumbLevel`).
4242

43+
<Note>
44+
45+
Setting `minimumEventLevel` or `minimumBreadcrumbLevel` in `logging.properties` only affects events logged by way of JUL. The settings will have no effect when calling `Sentry.captureMessage` or similar directly.
46+
47+
</Note>
48+
4349
Breadcrumbs are kept in memory (by default the last 100 records) and are sent with events. For example, by default, if you log 100 entries with `logger.config` or `logger.warn`, no event is sent to Sentry. If you then log with `logger.error`, an event is sent to Sentry which includes those 100 `config` or `warning` messages. For this to work, `SentryHandler` needs to receive **all** log entries to decide what to keep as breadcrumb or send as event. Set the `SentryHandler` log level configuration to a value lower than what is set for the `minimumBreadcrumbLevel` and `minimumEventLevel` so that `SentryHandler` receives these log messages.
4450

4551
```properties {tabTitle:logging.properties}

src/includes/getting-started-config/java.log4j2.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@ Two log levels are used to configure this integration, as illustrated below in t
4545
1. Configure the lowest level required for a log message to become an event (`minimumEventLevel`) sent to Sentry.
4646
2. Configure the lowest level a message has to be to become a breadcrumb (`minimumBreadcrumbLevel`)
4747

48+
<Note>
49+
50+
Setting `minimumEventLevel` or `minimumBreadcrumbLevel` in `log4j2.xml` only affects events logged by way of Log4j2. The settings will have no effect when calling `Sentry.captureMessage` or similar directly.
51+
52+
</Note>
53+
4854
Breadcrumbs are kept in memory (by default the last 100 records) and are sent with events. For example, by default, if you log 100 entries with `logger.info` or `logger.warn`, no event is sent to Sentry. If you then log with `logger.error`, an event is sent to Sentry that includes those 100 `info` or `warn` messages. For this to work, `SentryAppender` needs to receive **all** log entries to decide what to keep as breadcrumb or send as event. Set the `SentryAppender` log level configuration to a value lower than what is set for the `minimumBreadcrumbLevel` and `minimumEventLevel` so that `SentryAppender` receives these log messages.
4955

5056
```xml

src/includes/getting-started-config/java.logback.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@ Two log levels are used to configure this integration:
5454
1. Configure the lowest level required for a log message to become an event (`minimumEventLevel`) sent to Sentry.
5555
2. Configure the lowest level a message has to be to become a breadcrumb (`minimumBreadcrumbLevel`).
5656

57+
<Note>
58+
59+
Setting `minimumEventLevel` or `minimumBreadcrumbLevel` in `logback.xml` only affects events logged by way of Logback. The settings will have no effect when calling `Sentry.captureMessage` or similar directly.
60+
61+
</Note>
62+
5763
Breadcrumbs are kept in memory (by default the last 100 records) and are sent with events. For example, by default, if you log 100 entries with `logger.info` or `logger.warn`, no event is sent to Sentry. If you then log with `logger.error`, an event is sent to Sentry which includes those 100 `info` or `warn` messages. For this to work, `SentryAppender` needs to receive **all** log entries to decide what to keep as breadcrumb or sent as event. Set the `SentryAppender` log level configuration to a value lower than what is set for the `minimumBreadcrumbLevel` and `minimumEventLevel` so that `SentryAppender` receives these log messages.
5864

5965
```xml

0 commit comments

Comments
 (0)