OpenTelemetry Logging Dart

Pub Version Coverage OpenSSF Scorecard

A Dart package for logging with OpenTelemetry, supporting gRPC backends and seamless integration with observability platforms.

Features

  • Simple logging
  • OpenTelemetry protocol support (gRPC and HTTP)

Getting Started

Add the package to your pubspec.yaml:

dependencies:
  opentelemetry_logging_dart: ^latest

Import and use in your Dart code:

import 'package:opentelemetry_logging/opentelemetry_logging_dart.dart';

// Create logger
final logger = OpenTelemetryLogger(
  backend: OpenTelemetryHttpBackend(
      endpoint: Uri.parse('http://localhost:4318/v1/logs')),
  batchSize: 10,
  flushInterval: const Duration(seconds: 5),
  traceId: '1234567890abcdef1234567890abcdef',
);

// Use logger
logger.debug('Hello!');

Contributing

Contributions are welcome! Please open issues or pull requests on GitHub.

License

This project is licensed under the MIT License.

Libraries

opentelemetry_logging
OpenTelemetry Logging Library