You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4cxx-user@logging.apache.org by Pete Rowley <pe...@openrowley.com> on 2004/05/12 21:07:06 UTC
Appenders in configuration issue
I have some code which uses file configuration for log4cxx, pretty much as in
the sample in the "short introduction to log4cxx". However, whenever the
file is parsed I get the following message:
Could not instantiate class [org.apache.log4j.ConsoleAppender].
Class 'org.apache.log4j.ConsoleAppender' not found
Could not instantiate appender named "A1".
No appenders could be found for logger (pam_eda.auth).
Please initialize the log4cxx system properly.
The config file is as in the example:
# Set root logger level to DEBUG and its only appender to A1.
log4j.rootLogger=DEBUG, A1
# A1 is set to be a ConsoleAppender.
log4j.appender.A1=org.apache.log4j.ConsoleAppender
log4j.appender.A.File=temp.log
# A1 uses PatternLayout.
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
The code that intiates configuration:
// BasicConfigurator::configure();
String propertyFileName = "/etc/pam_eda_log4cxx";
PropertyConfigurator::configure(propertyFileName);
If I comment out the PropertyConfigurator line and uncomment BasicConfigurator
I get console output just fine.
Is there a step I am missing?
Build system: Suse 9.0, kernel 2.4.21-202-default, gcc 3.3.1
Regards
---
Pete