pip_services3_components.trace.LogTracer module
-
class
pip_services3_components.trace.LogTracer.
LogTracer
Bases:
pip_services3_commons.config.IConfigurable.IConfigurable
,pip_services3_commons.refer.IReferenceable.IReferenceable
,pip_services3_components.trace.ITracer.ITracer
Tracer that dumps recorded traces to logger.
- ### Configuration parameters ###
- options:
log_level: log level to record traces (default: debug)
- ### References ###
*:logger:*:*:1.0
ILogger
components to dump the captured counters*:context-info:*:*:1.0 (optional)
ContextInfo
to detect the context id and specify counters source
See
ITracer
,CachedCounters
,CompositeLogger
Example:
-
begin_trace
(correlation_id: Optional[str], component: str, operation: str) → pip_services3_components.trace.TraceTiming.TraceTiming Begings recording an operation trace
- Parameters
correlation_id – (optional) transaction id to trace execution through call chain.
component – a name of called component
operation – a name of the executed operation.
- Returns
a trace timing object.
-
configure
(config: pip_services3_commons.config.ConfigParams.ConfigParams) Configures component by passing configuration parameters.
- Parameters
config – configuration parameters to be set.
-
set_references
(references: pip_services3_commons.refer.IReferences.IReferences) Sets references to dependent components.
- Parameters
references – references to locate the component dependencies.
-
trace
(correlation_id: Optional[str], component: str, operation: str, duration: float) Records an operation trace with its name and duration
- Parameters
correlation_id – (optional) transaction id to trace execution through call chain.
component – a name of called component
operation – a name of the executed operation.
duration – execution duration in milliseconds.