ThreadLocalDiagnosticContext

Allows the dynamic setting of log levels on a per-thread basis. Imagine that a user request comes into your production threaded server. You can't afford to turn logging up to trace for the sake of debugging this one users problem, but you also can't afford to find the problem and fix it. So now you just set the override log level to TRACE for the thread the user is on, and you get full trace output for only that user.

Constructors

this
this()

Members

Functions

clear
void clear()

Clear the label stack.

isEnabled
bool isEnabled(ILevel.Level setting, ILevel.Level level)

All log appends will be checked against this to see if a log level needs to be temporarily adjusted.

label
char[] label()

Return the label to use for the current log message. Usually called by the Layout. This implementation returns "{}".

pop
void pop()

pop the current label off the stack.

push
void push(char[] label)

Push another string into the 'stack'. This strings will be appened together when getLabel is called.

setLevel
void setLevel(ILevel.Level level)

set the 'diagnostic' Level for logging. This overrides the Level in the current Logger. The default level starts at NONE, so as not to modify the behavior of existing clients of tango.util.log

Meta