Creates a new instance of this context info.
(optional) a context name.
(optional) a human-readable description of the context.
Gets the unique context id. Usually it is the current host name.
the unique context id.
Sets the unique context id.
a new unique context id.
the unique context id.
Gets the human-readable description of the context.
the human-readable description of the context.
Sets the human-readable description of the context.
a new human readable description of the context.
the human-readable description of the context.
Gets the context name.
the context name
Sets the context name.
a new name for the context.
the context name
Gets context additional parameters.
a JSON object with additional context parameters.
Sets context additional parameters.
a JSON object with context additional parameters
a JSON object with additional context parameters.
Gets the context start time.
the context start time.
Sets the context start time.
a new context start time.
the context start time.
Calculates the context uptime as from the start time.
number of milliseconds from the context start time.
Configures component by passing configuration parameters.
configuration parameters to be set.
Creates a new ContextInfo and sets its configuration parameters.
configuration parameters for the new ContextInfo.
a newly created ContextInfo
Generated using TypeDoc
Context information component that provides detail information about execution context: container or/and process.
Most often ContextInfo is used by logging and performance counters to identify source of the collected logs and metrics.
Configuration parameters
Example
let contextInfo = new ContextInfo(); contextInfo.configure(ConfigParams.fromTuples( "name", "MyMicroservice", "description", "My first microservice" )); context.name; // Result: "MyMicroservice" context.contextId; // Possible result: "mylaptop" context.startTime; // Possible result: 2018-01-01:22:12:23.45Z context.uptime; // Possible result: 3454345