CachedTracer class abstract
Abstract tracer that caches recorded traces in memory and periodically dumps them. Child classes implement saving cached traces to their specified destinations.
Configuration parameters
- source: source (context) name
- options:
- interval: interval in milliseconds to save log messages (default: 10 seconds)
- max_cache_size: maximum number of messages stored in this cache (default: 100)
References
- *:context-info:*:*:1.0 (optional) ContextInfo to detect the context id and specify counters source
- Implemented types
Constructors
- CachedTracer()
- Creates a new instance of the logger.
Properties
- hashCode → int
-
The hash code for this object.
read-onlyinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
read-onlyinherited
Methods
-
beginTrace(
String? correlationId, String component, String operation) → TraceTiming -
Begings recording an operation trace
override
-
clear(
) → void - Clears (removes) all cached log messages.
-
configure(
ConfigParams config) → void - Configures component by passing configuration parameters.
-
dump(
) → void - Dumps (writes) the currently cached log messages.
-
failure(
String? correlationId, String component, String operation, Exception error, int duration) → void -
Records an operation failure with its name, duration and error
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
save(
List< OperationTrace> messages, void callback(Exception? err)) → void - Saves log messages from the cache.
-
setReferences(
IReferences references) → void - Sets references to dependent components.
-
toString(
) → String -
A string representation of this object.
inherited
-
trace(
String? correlationId, String component, String operation, int duration) → void -
Records an operation trace with its name and duration
override
-
update(
) → void - Makes trace cache as updated and dumps it when timeout expires.
-
write(
String? correlationId, String? component, String? operation, Exception? error, int duration) → void - Writes a log message to the logger destination.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited