opentelemetry_logging 0.4.0
opentelemetry_logging: ^0.4.0 copied to clipboard
A simple library implementing sending logs to OpenTelemetry, supports gRPC and HTTP protocols.
OpenTelemetry Logging Dart #
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.