A new child logger can be equipped with a new context by specifying true for the createNewContext parameter:
const logger = log.createLogger(null, true)
Add a boolean return value for setContextProperty(), setCorrelationId(), setTenantId() and setTenantSubdomain() to indicate if the set operation was successful. If a logger does not have a context, the fields cannot be set and the methods return false.
Add test cases for context inheritance
Add/update documentation on contexts and child loggers
Changes
Add context to global child loggers
setContextProperty()
,setCorrelationId()
,setTenantId()
,setTenantSubdomain()
and the respective get methods.A new child logger can be equipped with a new context by specifying
true
for thecreateNewContext
parameter:setContextProperty()
,setCorrelationId()
,setTenantId()
andsetTenantSubdomain()
to indicate if the set operation was successful. If a logger does not have a context, the fields cannot be set and the methods returnfalse
.Fixes #185