logging-log4cxx-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kendal Montgomery <montgomer...@armadapower.com>
Subject Re: log4cxx configuration...
Date Thu, 09 Apr 2015 22:33:46 GMT
Thank you for the suggestions.  I figured out my problem by turning on 
the debugging. I was trying to figure out how to do the equivalent of 
starting the a JVM with -DLOG4J.DEBUG=true, and I totally forgot you 
could add that to the configuration file.  I had a very silly type-o.

Thanks once again for the help!

Kendal

On 4/9/15 6:18 PM, Jacob L. Anawalt wrote:
> On 4/9/2015 1:42 PM, Kendal Montgomery wrote:
>> I'm curious if anyone else has tried or has issues with configuring 
>> logging
>> levels for specific loggers in a log4cxx.xml file?
>
> I use an xml configuration file and at times configure different 
> levels for specific loggers in the hierarchy.
>
>> I have a logger configured in my code with the name
>> "Outstation.Messaging.TestHandler".
>
> Like this?
>
> #include <log4cxx/logger.h>
>
> int main(int argc, char* argv[]) {
>     log4cxx::LoggerPtr 
> logger(log4cxx::Logger::getLogger("Outstation.Messaging.TestHandler"));
>     LOG4CXX_DEBUG(logger,"Testing");
>
>     return 0;
> }
>
> It appeared to work for me using the log4cxx.xml you had in the email.
>
> 2015-04-09 16:05:48,057 DEBUG [0xb7227710] Messaging.TestHandler - 
> Testing
>
>> Does log4cxx not use hierarchical logger configuration separated by a
>> period like java?
>>
>
> It does.
>
>> Any ideas?  I'm using 0.10.0.
>>
>
> Same. Maybe you're not using the configuration you think you are. Try 
> enabling debug in the configuration or tweaking the ConversionPattern 
> to make sure it's the source of your configuration. Also have you 
> verified this with a small program?
>
> <log4j:configuration debug="true" 
> xmlns:log4j="http://jakarta.apache.org/log4j/">
>


Mime
View raw message