DatadogLogStrategy constructor
DatadogLogStrategy({
- required String apiKey,
- required String service,
- required String env,
- String? host,
- String? source,
- String? tags,
- String datadogUrl = 'https://http-intake.logs.datadoghq.com/v1/input',
- int batchSize = 100,
- Duration batchTimeout = const Duration(seconds: 5),
- int maxRetries = 3,
- Duration retryDelay = const Duration(seconds: 1),
- LogLevel logLevel = LogLevel.none,
- 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();
}