logging-log4cxx-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jacob L. Anawalt" <janaw...@geckosoftware.com>
Subject Re: log4cxx configuration...
Date Thu, 09 Apr 2015 22:18:30 GMT
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/">

-- 
Jacob Anawalt
Gecko Software, Inc.
janawalt@geckosoftware.com
435-752-8026

Mime
View raw message