diff --git a/src/includes/getting-started-primer/dart.mdx b/src/includes/getting-started-primer/dart.mdx index 504fc59d89599..82d01be55f394 100644 --- a/src/includes/getting-started-primer/dart.mdx +++ b/src/includes/getting-started-primer/dart.mdx @@ -13,3 +13,4 @@ Sentry's Dart SDK enables automatic reporting of errors, messages, and exception - [User Feedback](/platforms/dart/enriching-events/user-feedback/) provides the ability to collect user information when an event occurs. - [Performance Monitoring](/product/performance/) creates transactions for: - [HTTP requests](/platforms/dart/configuration/integrations/http-integration/#performance-monitoring-for-http-requests) +- [Logging Integration](/platforms/dart/configuration/integrations/logging) diff --git a/src/includes/getting-started-primer/flutter.mdx b/src/includes/getting-started-primer/flutter.mdx index e4985715296df..650d7752ffbd2 100644 --- a/src/includes/getting-started-primer/flutter.mdx +++ b/src/includes/getting-started-primer/flutter.mdx @@ -16,5 +16,11 @@ Features: - via the Native SDKs [Automatic Breadcrumbs for Android](/platforms/android/enriching-events/breadcrumbs/#automatic-breadcrumbs) and [Automatic Breadcrumbs for iOS](/platforms/apple/configuration/integrations/default/#sentryautobreadcrumbtrackingintegration) - as well as `http` with the [Dart SDK](/platforms/dart/) - [Release Health](/product/releases/health/) tracks crash free users and sessions +- [Attachments](/platforms/flutter/enriching-events/attachments/) enrich your event by storing additional files, such as config or log files. +- [User Feedback](/platforms/flutter/enriching-events/user-feedback/) provides the ability to collect user information when an event occurs. +- [Performance Monitoring](/product/performance/) creates transactions for: + - [HTTP requests](/platforms/flutter/performance/instrumentation/automatic-instrumentation/#httpclient-library-instrumentation) + - [Routing Instumentation](/platforms/flutter/performance/instrumentation/automatic-instrumentation/#routing-instumentation) +- [Logging Integration](/platforms/dart/configuration/integrations/logging) - Limited support for Flutter Web, Windows, and Linux - Under the hood the SDK relies on the [Dart SDK](/platforms/dart/); the minimum required version is `2.12.0` and Flutter SDK version is `1.17.0`. diff --git a/src/platforms/android/configuration/integrations/timber.mdx b/src/platforms/android/configuration/integrations/timber.mdx index f6a189b77f59e..51c8f98f18c09 100644 --- a/src/platforms/android/configuration/integrations/timber.mdx +++ b/src/platforms/android/configuration/integrations/timber.mdx @@ -76,7 +76,7 @@ SentryAndroid.init(this, options -> { ## Verify -This snippet includes a HTTP Request and captures an intentional message, so you can test that everything is working as soon as you set it up: +This snippet captures an intentional error, so you can test that everything is working as soon as you set it up: ```kotlin import androidx.appcompat.app.AppCompatActivity diff --git a/src/platforms/dart/configuration/integrations/logging.mdx b/src/platforms/dart/configuration/integrations/logging.mdx new file mode 100644 index 0000000000000..d2821fc3677a9 --- /dev/null +++ b/src/platforms/dart/configuration/integrations/logging.mdx @@ -0,0 +1,69 @@ +--- +title: Logging Integration +caseStyle: canonical +supportLevel: production +sidebar_order: 3 +description: "Learn more about the Sentry Logging integration for the Dart SDK." +--- + +The `sentry_logging` library provides [Logging](https://pub.dev/packages/logging) support for Sentry using the [onRecord property](https://pub.dev/documentation/logging/latest/logging/Logger/onRecord.html). It is able to collect breadcrumbs and capture events. Once this integration is configured, you can use Logging’s public API exclusively or in combination to the Sentry's SDK API to capture and enrich events. + +The source can be found [on GitHub](https://github.com/getsentry/sentry-dart/tree/main/logging/). + +## Install + +To add the Logging integration, add the `sentry_logging` dependency. + +```yml {filename:pubspec.yaml} +dependencies: + sentry: ^6.3.0 + sentry_logging: ^6.3.0 + logging: ^1.0.2 +``` + +## Configure + +Configuration should happen as early as possible in your application's lifecycle. + +```dart +import 'package:sentry_logging/sentry_logging.dart'; +import 'package:sentry/sentry.dart'; + +Future main() async { + await Sentry.init( + (options) { + options.dsn = '___PUBLIC_DSN___'; + options.addIntegration(LoggingIntegration()); + }, + appRunner: initApp, // Init your App. + ); +} +``` + +## Verify + +This snippet captures an intentional error, so you can test that everything is working as soon as you set it up: + +```dart +import 'package:logging/logging.dart'; + +void main() async { + final log = Logger('MyAwesomeLogger'); + + log.info('a breadcrumb!'); + + try { + throw Exception(); + } catch (error, stackTrace) { + log.severe('an error!', error, stackTrace); + } +} +``` + + + +Learn more about manually capturing an error or message, in our Usage documentation. + + + +To view and resolve the recorded message, log into [sentry.io](https://sentry.io) and open your project. Clicking on the error's title will open a page where you can see detailed information and mark it as resolved.