NewRelicLogEvent class

A specialized log event for New Relic logging strategy.

This class extends the base LogEvent to include New Relic-specific metadata and formatting options. It provides structured data that can be easily processed by New Relic's logging service.

Example:

var newrelicEvent = NewRelicLogEvent(
  eventName: 'user_action',
  eventMessage: 'User completed purchase',
  parameters: {'userId': '123', 'amount': 99.99},
  attributes: {'custom_attr': 'value'},
  entityName: 'my-app',
);
Inheritance

Constructors

NewRelicLogEvent({required String eventName, String? eventMessage, Map<String, Object>? parameters = const {}, Map<String, dynamic>? attributes, String? entityName, String? entityType, String? host, String? environment, String? traceId, String? spanId})
Constructs a NewRelicLogEvent.
NewRelicLogEvent.fromLogEvent(LogEvent event, {Map<String, dynamic>? attributes, String? entityName, String? entityType, String? host, String? environment, String? traceId, String? spanId})
Creates a NewRelicLogEvent from a base LogEvent
factory

Properties

attributes → Map<String, dynamic>?
Custom attributes for the event
final
entityName → String?
Entity name (application name)
final
entityType → String?
Entity type
final
environment → String?
Environment name
final
eventMessage → String?
An optional message associated with the event, providing additional detail about the event's context or outcome.
finalinherited
eventName → String
The name of the event. This is a required field and is used to identify the type of the event.
finalinherited
hashCode → int
Generates a hash code based on the event name.
no setteroverride
host → String?
Host where the event occurred
final
parameters → Map<String, Object>?
A map of key-value pairs containing additional parameters that provide more context to the event. This is useful for passing additional data that may be relevant to specific logs.
finalinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
spanId → String?
Span ID for distributed tracing
final
traceId → String?
Trace ID for distributed tracing
final

Methods

copyWith({String? eventName, String? eventMessage, Map<String, Object>? parameters, Map<String, dynamic>? attributes, String? entityName, String? entityType, String? host, String? environment, String? traceId, String? spanId}) → NewRelicLogEvent
Creates a copy of this event with updated values
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toMap() → Map<String, dynamic>
Converts the event to a map with New Relic-specific formatting
override
toString() → String
A string representation of this object.
override

Operators

operator ==(Object other) → bool
Checks the equality of LogEvent instances based on the event name.
override