Jacob L. Anawalt wrote:
I am getting info and debug messages in my system logs.

I have purchased the log4j manual and it looks like I have the appender threshold settings correct.

Here is the output of the attached program and configuration file.

2008-02-29 23:07:12 DEBUG root  - 1
2008-02-29 23:07:12 DEBUG MyApp  - 2
2008-02-29 23:07:12 WARN  root  - 3
2008-02-29 23:07:12 WARN  MyApp  - 4

--
Jacob Anawalt
Gecko Software, Inc.
[EMAIL PROTECTED]
435-752-8026
#include <log4cxx/logger.h>
#include <log4cxx/propertyconfigurator.h>

int 
main(void)
{
        log4cxx::PropertyConfigurator::configure("log4cxx.properties");
        log4cxx::LoggerPtr loggerRoot = log4cxx::Logger::getRootLogger();
        log4cxx::LoggerPtr loggerApp = log4cxx::Logger::getLogger("MyApp");

        LOG4CXX_DEBUG(loggerRoot,"1");
        LOG4CXX_DEBUG(loggerApp,"2");
        LOG4CXX_WARN(loggerRoot,"3");
        LOG4CXX_WARN(loggerApp,"4");

        return EXIT_SUCCESS;
}

# A1 is set to be a ConsoleAppender.
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender

# A1 uses PatternLayout.
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern=%d{%Y-%m-%d %H:%M:%S} %-5p %c 
%x - %m%n
log4j.appender.CONSOLE.Threshold=WARN;

log4j.rootLogger=ALL, CONSOLE

Reply via email to