NewRelicLogStrategy constructor

NewRelicLogStrategy({
  1. required String licenseKey,
  2. required String appName,
  3. String? host,
  4. String? environment,
  5. String newrelicUrl = 'https://log-api.newrelic.com/log/v1',
  6. int batchSize = 100,
  7. Duration batchTimeout = const Duration(seconds: 5),
  8. int maxRetries = 3,
  9. Duration retryDelay = const Duration(seconds: 1),
  10. bool useIsolate = true,
  11. LogLevel logLevel = LogLevel.none,
  12. 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 useIsolate - Whether to use isolates for batch preparation (JSON serialization). Defaults to TRUE because batch processing is heavy. 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),
  bool useIsolate = true, // Default: TRUE (batch serialization is heavy)
  super.logLevel = LogLevel.none,
  super.supportedEvents,
}) : super(useIsolate: useIsolate) {
  _startBatchTimer();
}