Skip to content

Commit 6c2c108

Browse files
committed
Add docs
1 parent 373b0dc commit 6c2c108

File tree

6 files changed

+78
-0
lines changed

6 files changed

+78
-0
lines changed

docs/platforms/dart/common/logs/index.mdx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,18 @@ sidebar_order: 5755
99

1010
With Sentry Structured Logs, you can send text based log information from your applications to Sentry. Once in Sentry, these logs can be viewed alongside relevant errors, searched by text-string, or searched using their individual attributes.
1111

12+
## Requirements
13+
14+
<PlatformContent includePath="logs/requirements" />
15+
1216
## Setup
1317

1418
<PlatformContent includePath="logs/setup" />
1519

1620
## Usage
1721

1822
<PlatformContent includePath="logs/usage" />
23+
24+
## Options
25+
26+
<PlatformContent includePath="logs/options" />
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
title: Set Up Logs
3+
sidebar_title: Logs
4+
description: "Structured logs allow you to send, view and query logs sent from your applications within Sentry."
5+
sidebar_order: 5755
6+
---
7+
8+
<Include name="feature-stage-beta-logs.mdx" />
9+
10+
With Sentry Structured Logs, you can send text based log information from your applications to Sentry. Once in Sentry, these logs can be viewed alongside relevant errors, searched by text-string, or searched using their individual attributes.
11+
12+
## Requirements
13+
14+
<PlatformContent includePath="logs/requirements" />
15+
16+
## Setup
17+
18+
<PlatformContent includePath="logs/setup" />
19+
20+
## Usage
21+
22+
<PlatformContent includePath="logs/usage" />
23+
24+
## Options
25+
26+
<PlatformContent includePath="logs/options" />
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#### beforeSendLog
2+
3+
To filter logs, or update them before they are sent to Sentry, you can use the `beforeSendLog` option.
4+
5+
```dart
6+
await SentryFlutter.init(
7+
(options) {
8+
options.dsn = "___PUBLIC_DSN___";
9+
options.beforeSendLog = (log) {
10+
if (log.level == SentryLevel.info) {
11+
// Filter out all info logs
12+
return null;
13+
}
14+
15+
return log;
16+
};
17+
},
18+
);
19+
```
20+
21+
The `beforeSend` function receives a log object, and should return the log object if you want it to be sent to Sentry, or `null` if you want to discard it.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#### beforeSendLog
2+
3+
To filter logs, or update them before they are sent to Sentry, you can use the `beforeSendLog` option.
4+
5+
```dart
6+
await Sentry.init(
7+
(options) {
8+
options.dsn = "___PUBLIC_DSN___";
9+
options.beforeSendLog = (log) {
10+
if (log.level == SentryLevel.info) {
11+
// Filter out all info logs
12+
return null;
13+
}
14+
15+
return log;
16+
};
17+
},
18+
);
19+
```
20+
21+
The `beforeSend` function receives a log object, and should return the log object if you want it to be sent to Sentry, or `null` if you want to discard it.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Logs for Dart are supported in Sentry Flutter SDK version `9.0.0` and above.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Logs for Dart are supported in Sentry Dart SDK version `9.0.0` and above.

0 commit comments

Comments
 (0)