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/v1/input',
  8. int batchSize = 100,
  9. Duration batchTimeout = const Duration(seconds: 5),
  10. int maxRetries = 3,
  11. Duration retryDelay = const Duration(seconds: 1),
  12. LogLevel logLevel = LogLevel.none,
  13. 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) source - Source name (optional) tags - Additional tags (optional) datadogUrl - Datadog API URL (defaults to US region) batchSize - Number of logs to batch before sending batchTimeout - Maximum time to wait before sending batch maxRetries - Maximum number of retry attempts retryDelay - Delay between retry attempts 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/v1/input',
  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();
}