Re: [Log4cplus-devel] FW: change level for different loggers
Logging Framework for C++
Brought to you by:
wilx
From: Václav Z. <vha...@gm...> - 2012-09-21 22:45:25
|
On 09/21/2012 11:23 PM, Tobias Allén wrote: > > Hey im very new to log4cplus and woundering following: > > logger logVar1; > logger logVar2; > > if i have two different logger in my code and i want to change the > level to be logged for only one off. I want to do this from the > property file. how should i solve this? I have read examples on doing > this for only one logger variable but not for 2 separeatly. Assuming that both logVar1 and logVar2 point to the same logger instance (same logger name "foo.bar.baz"), then it is sufficient to change the log level through just one of the two variables. > I want to change the levels during run time and therefore i have to > use the property file. You do not have to use a property file to change log level for one or two loggers. You can just call logVar1->setLogLevel(log4cplus::OFF_LOG_LEVEL) and nothing will be logged through logVar1 any more. -- VZ |