public class ThreadFilter extends Object implements Filter
This is for example suitable in a scenario where a log should be associated with the processing of a functor object but the functor is executed in different worker threads. If the functor activates its filter upon entry, all activities can be sent to the same log, even from different workers. In this case the thread associated with the filter is switched with "activate" and "deactivate". These methods should always be used in a "finally" style block.
Another scenario is where a thread has a dedicated task and all its activities have to be logged. Here the thread is associated at startup and remains the same.
| Constructor and Description |
|---|
ThreadFilter(boolean activate) |
public boolean activate()
public boolean deactivate()
public boolean isActive()
public boolean isLoggable(LogRecord record)
isLoggable in interface FilterCopyright © 2013 intarsys consulting GmbH. All Rights Reserved.