NewRelicLogStrategy constructor
NewRelicLogStrategy({
- required String licenseKey,
- required String appName,
- String? host,
- String? environment,
- String newrelicUrl = 'https://log-api.newrelic.com/log/v1',
- 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 NewRelicLogStrategy.
licenseKey - Your New Relic license key (required)
appName - Application name (required)
host - Host name (optional)
environment - Environment name (optional)
newrelicUrl - New Relic 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
NewRelicLogStrategy({
required this.licenseKey,
required this.appName,
this.host,
this.environment,
this.newrelicUrl = 'https://log-api.newrelic.com/log/v1',
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();
}