structure_logs_sink_seq 0.0.2 copy "structure_logs_sink_seq: ^0.0.2" to clipboard
structure_logs_sink_seq: ^0.0.2 copied to clipboard

Sink Seq Log

structure_logs_sink_seq #

structure_logs_sink_seq is a Flutter package that provides a Sink implementation for sending structured logs to Seq Log. This allows you to seamlessly integrate logging into your Flutter applications and send logs to Seq for centralized monitoring.

Installation #

Add the following to your pubspec.yaml file:

dependencies:
  structure_logs_sink_seq: ^current_version

Usage #

  1. Import the package into your Dart file:
import 'package:structure_logs_sink_seq/structure_logs_sink_seq.dart';
  1. Create an instance of the logger:
final logger = StructureLogger();
  1. Add the Seq Sink, providing the Seq server URL and optional API key:
LogSink sink = SinkSeq(
  'https://your-seq-server-url',
  apiKey: 'your-api-key', // Optional, if your Seq server requires an API key
);
logger.addSink(sink);
  1. Register logs using the log method:
await logger.log(
  "Welcome {name}, your level is {level}",
  level: LogLevel.debug,
  data: {"name": "John Doe", "level": 12},
);

Adjust the Seq server URL and API key according to your Seq configuration.

Contributing #

Contributions are welcome! Feel free to open issues or submit pull requests.

License #

This package is distributed under the LICENSE.