logging-log4cxx-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kendal Montgomery <montgomer...@armadapower.com>
Subject log4cxx configuration...
Date Thu, 09 Apr 2015 19:42:54 GMT
I'm curious if anyone else has tried or has issues with configuring 
logging levels for specific loggers in a log4cxx.xml file?  I have the 
following log4cxx.xml file:

<?xml version="1.0" encoding="UTF-8" ?>
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
     <!-- Output the log message to system console.
     <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
         <param name="Target" value="System.out"/>
         <layout class="org.apache.log4j.PatternLayout">
             <param name="ConversionPattern" value="%d{ISO8601} %-5p 
[%t] %c{2} - %m%n" />

         <level value="INFO" />
         <appender-ref ref="CONSOLE"/>

     <category name="Outstation.Messaging">
         <priority value ="DEBUG" />
     <logger name="Outstation.Messaging">
         <level value="DEBUG" />

     <logger name="Outstation.Messaging.TestHandler">
         <level value="DEBUG" />


I have a logger configured in my code with the name 
"Outstation.Messaging.TestHandler". I'm used to using log4j and if I 
configured it this way, all messages that did not have a specific 
priority set would be logged at level INFO, but with this configuration, 
anything with Outstation.Messaging or lower should be logged at level 
DEBUG, and specifically the logger i have defined in my code that I 
mention above should log DEBUG level messages to the console.  However, 
this is not happening; I get nothing but INFO all around.  If I change 
the root logger level to DEBUG, I get everything logging at DEBUG level, 
but finer grained logger configuration doesn't seem to work.  Does 
log4cxx not use hierarchical logger configuration separated by a period 
like java?

Any ideas?  I'm using 0.10.0.

Thanks in advance.


View raw message