DatadogLogStrategy constructor

DatadogLogStrategy({
  1. required String apiKey,
  2. required String service,
  3. required String env,
  4. String? host,
  5. String? source,
  6. String? tags,
  7. String datadogUrl = 'https://http-intake.logs.datadoghq.com/api/v2/logs',
  8. bool enableCompression = true,
  9. int batchSize = 100,
  10. Duration batchTimeout = const Duration(seconds: 5),
  11. int maxRetries = 3,
  12. Duration retryDelay = const Duration(seconds: 1),
  13. LogLevel logLevel = LogLevel.none,
  14. List<LogEvent>? supportedEvents,
})

Constructs a DatadogLogStrategy.

apiKey - Your Datadog API key (required) service - Service name for the logs (required) env - Environment name (required) host - Host name (optional, defaults to platform hostname) source - Source name (optional, defaults to 'dart') tags - Additional tags as comma-separated string (optional, e.g., 'team:mobile,version:1.0.0') datadogUrl - Datadog API URL (defaults to v2 endpoint for US region) enableCompression - Enable gzip compression (default: true) batchSize - Number of logs to batch before sending (default: 100) batchTimeout - Maximum time to wait before sending batch (default: 5 seconds) maxRetries - Maximum number of retry attempts (default: 3) retryDelay - Delay between retry attempts (default: 1 second) logLevel - Minimum log level to process supportedEvents - Specific events to handle

Implementation

DatadogLogStrategy({
  required this.apiKey,
  required this.service,
  required this.env,
  this.host,
  this.source,
  this.tags,
  this.datadogUrl = 'https://http-intake.logs.datadoghq.com/api/v2/logs',
  this.enableCompression = true,
  this.batchSize = 100,
  this.batchTimeout = const Duration(seconds: 5),
  this.maxRetries = 3,
  this.retryDelay = const Duration(seconds: 1),
  super.logLevel = LogLevel.none,
  super.supportedEvents,
}) {
  _startBatchTimer();
}