DatadogLogEvent class
A specialized log event for Datadog logging strategy.
This class extends the base LogEvent to include Datadog-specific metadata and formatting options. It provides structured data that can be easily processed by Datadog's logging service.
Example:
var datadogEvent = DatadogLogEvent(
eventName: 'user_action',
eventMessage: 'User completed purchase',
parameters: {'userId': '123', 'amount': 99.99},
tags: ['purchase', 'user_action'],
source: 'mobile_app',
);
Constructors
-
DatadogLogEvent.new({required String eventName, String? eventMessage, Map<
String, Object> ? parameters = const {}, List<String> ? tags, String? source, String? host, String? service, String? env, String? traceId, String? spanId, Map<String, dynamic> ? attributes}) - Constructs a DatadogLogEvent.
-
DatadogLogEvent.fromLogEvent(LogEvent event, {List<
String> ? tags, String? source, String? host, String? service, String? env, String? traceId, String? spanId, Map<String, dynamic> ? attributes}) -
Creates a DatadogLogEvent from a base LogEvent
factory
Properties
-
attributes
→ Map<
String, dynamic> ? -
Custom attributes for the event
final
- env → 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
- service → String?
-
Service name
final
- source → String?
-
Source of the event
final
- spanId → String?
-
Span ID for distributed tracing
final
-
Additional tags for the event
final
- traceId → String?
-
Trace ID for distributed tracing
final
Methods
-
copyWith(
{String? eventName, String? eventMessage, Map< String, Object> ? parameters, List<String> ? tags, String? source, String? host, String? service, String? env, String? traceId, String? spanId, Map<String, dynamic> ? attributes}) → DatadogLogEvent - 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 Datadog-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