structured_logger 1.0.1-dev.2 copy "structured_logger: ^1.0.1-dev.2" to clipboard
structured_logger: ^1.0.1-dev.2 copied to clipboard

Structured logging for Dart with pluggable CLEF-compatible sinks.

structured_logger #

Structured logging for Dart with pluggable CLEF-compatible sinks.

This package provides an easy way to implement structured logs in Dart and Flutter applications. It allows sending logs to different destinations (terminal, Seq, etc.) through pluggable Sink interfaces.

Features #

  • Pure Dart (works in CLI, servers, Flutter, etc.)
  • Message templates with placeholders (e.g. User {userId} logged in)
  • Multiple sinks: console, Seq (CLEF), custom
  • Dio interceptor support (via companion package)
  • Full CLEF / Seq compatibility

Installation #

dart pub add structured_logger

For Flutter:

flutter pub add structured_logger

Quick Start #

import 'package:structured_logger/structured_logger.dart';

final logger = StructureLogger()
  ..addSink(SimpleLineSink()); // console output

await logger.info('User {userId} did {action}', data: {
  'userId': 42,
  'action': 'checkout',
});

Sinks #

  • SimpleLineSink – human readable console logs
  • SinkSeq – send to Seq (or any CLEF-compatible collector)
  • Custom sinks by implementing LogSink

Example with Seq:

logger.addSink(SinkSeq(
  'https://your-seq-server',
  apiKey: 'your-key',
  deviceIdentifier: 'my-app',
));

Documentation #

Full documentation, guides and API reference:

License #

MIT License. See LICENSE for details.

0
likes
0
points
230
downloads

Publisher

verified publisheraltamir.dev

Weekly Downloads

Structured logging for Dart with pluggable CLEF-compatible sinks.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

http

More

Packages that depend on structured_logger