File tree Expand file tree Collapse file tree 6 files changed +18
-8
lines changed
Expand file tree Collapse file tree 6 files changed +18
-8
lines changed Original file line number Diff line number Diff line change 1+ We are still working on Logs. Please open [ a new GitHub issue] ( https://github.com/getsentry/sentry-java/issues/new/choose ) for any integration you would like to see.
Original file line number Diff line number Diff line change 1+ We are still working on Logs. You can follow progress on the following GitHub issues or open a new one for any integration you would like to see.
2+
3+ - [ Logback] ( https://github.com/getsentry/sentry-java/issues/4404 )
4+ - [ Log4j2] ( https://github.com/getsentry/sentry-java/issues/4403 )
5+ - [ JUL] ( https://github.com/getsentry/sentry-java/issues/4405 )
Original file line number Diff line number Diff line change 22
33To filter logs, or update them before they are sent to Sentry, you can use the ` getLogs().beforeSend ` option.
44
5- ``` java {tabTitle: Java}
5+ ``` java {tabTitle: Java} {10-14}
66import io.sentry.SentryLevel ;
77import io.sentry.android.core.SentryAndroid ;
88import android.app.Application ;
@@ -32,7 +32,7 @@ class MyApplication : Application() {
3232 override fun onCreate () {
3333 super .onCreate()
3434 SentryAndroid .init (this ) { options ->
35- options.dsn = " ___PUBLIC_DSN___" ,
35+ options.dsn = " ___PUBLIC_DSN___"
3636 options.logs.beforeSend = BeforeSendLogCallback { logEvent ->
3737 // Modify the event here:
3838 logEvent.body = " new message body"
Original file line number Diff line number Diff line change 22
33To filter logs, or update them before they are sent to Sentry, you can use the ` getLogs().beforeSend ` option.
44
5- ``` java {tabTitle: Java}
5+ ``` java {tabTitle: Java} {5-9}
66import io.sentry.Sentry ;
77
88Sentry . init(options - > {
9+ options. setDsn(" ___PUBLIC_DSN___" );
910 options. getLogs(). setBeforeSend((logEvent) - > {
1011 // Modify the event here:
1112 logEvent. setBody(" new message body" );
@@ -14,11 +15,12 @@ Sentry.init(options -> {
1415});
1516```
1617
17- ``` kotlin {tabTitle: Kotlin}
18+ ``` kotlin {tabTitle: Kotlin} {6-10}
1819import io.sentry.Sentry
1920import io.sentry.SentryOptions.Logs.BeforeSendLogCallback
2021
2122Sentry .init { options ->
23+ options.dsn = " ___PUBLIC_DSN___"
2224 options.logs.beforeSend = BeforeSendLogCallback { logEvent ->
2325 // Modify the event here:
2426 logEvent.body = " new message body"
Original file line number Diff line number Diff line change 11To enable logging, you need to initialize the SDK with the ` logs.enabled ` option set to ` true ` .
22
3- ``` java {tabTitle: Java}
3+ ``` java {tabTitle: Java} {10}
44import io.sentry.SentryLevel ;
55import io.sentry.android.core.SentryAndroid ;
66import android.app.Application ;
@@ -16,7 +16,7 @@ public class MyApplication extends Application {
1616}
1717```
1818
19- ``` kotlin {tabTitle: Kotlin}
19+ ``` kotlin {tabTitle: Kotlin} {11}
2020import io.sentry.android.core.SentryAndroid
2121import io.sentry.SentryOptions.BeforeSendCallback
2222import io.sentry.Hint
Original file line number Diff line number Diff line change 11To enable logging, you need to initialize the SDK with the ` logs.enabled ` option set to ` true ` .
22
3- ``` java {tabTitle: Java}
3+ ``` java {tabTitle: Java} {5}
44import io.sentry.Sentry ;
55
66Sentry . init(options - > {
7+ options. setDsn(" ___PUBLIC_DSN___" );
78 options. getLogs(). setEnabled(true );
89});
910```
1011
11- ``` kotlin {tabTitle: Kotlin}
12+ ``` kotlin {tabTitle: Kotlin} {5}
1213import io.sentry.Sentry
1314
1415Sentry .init { options ->
16+ options.dsn = " ___PUBLIC_DSN___"
1517 options.logs.enabled = true
1618}
1719```
You can’t perform that action at this time.
0 commit comments