DatadogLogger class
An interface for sending logs to Datadog.
It allows you to create a specific context (automatic information, custom attributes, tags) that will be embedded in all logs sent through this logger.
You can have multiple loggers configured in your application, each with their own settings.
To create a DatadogLogger, use DatadogLogging.createLogger. Attempting to construct a logger through its constructor will result in an unusable logger.
Constructors
- DatadogLogger(InternalLogger internalLogger, DatadogLoggerConfiguration configuration)
- For internal use only. To construct a DatadogLogger, use DatadogLogging.createLogger
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- loggerHandle → String
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addAttribute(
String key, Object value) → void - Add a custom attribute to all future logs sent by this logger.
-
addTag(
String key, [String? value]) → void - Add a tag to all future logs sent by this logger.
-
debug(
String message, {String? errorMessage, String? errorKind, StackTrace? errorStackTrace, Map< String, Object?> attributes = const {}}) → void -
Sends a
debug
log message. -
error(
String message, {String? errorMessage, String? errorKind, StackTrace? errorStackTrace, Map< String, Object?> attributes = const {}}) → void -
Sends an
error
log message. -
info(
String message, {String? errorMessage, String? errorKind, StackTrace? errorStackTrace, Map< String, Object?> attributes = const {}}) → void -
Sends an
info
log message. -
log(
LogLevel level, String message, {String? errorMessage, String? errorKind, StackTrace? errorStackTrace, Map< String, Object?> attributes = const {}}) → void -
Sends a log message with
LogLevel
oflevel
. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
removeAttribute(
String key) → void - Remove a custom attribute from all future logs sent by this logger.
-
removeTag(
String tag) → void -
Remove a given
tag
from all future logs sent by this logger. -
removeTagWithKey(
String key) → void -
Remove all tags with the given
key
from all future logs sent by this logger. -
toString(
) → String -
A string representation of this object.
inherited
-
warn(
String message, {String? errorMessage, String? errorKind, StackTrace? errorStackTrace, Map< String, Object?> attributes = const {}}) → void -
Sends a
warn
log message.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited