hello,

i have a question concerning log4j. it is already discussed/mentioned in the

log4j troubleshooting guide but it won't work either. the error message ist 
like the following:

log4j:ERROR No appenders could be found for category 
(com.lufthansatechnik.cws.more.RuntimeConfiguration).

log4j:ERROR Please initialize the log4j system properly.

the guide tells me to support the root-category with an appender
and everything' s fine. the funny site is, that a logfile is generated
as if there were no errors. but for beautyfying it s recommended,
that there were no errors like that.

in the above mentioned class RuntimeConfiguration the code looks
like:

public class RuntimeConfiguration {
  static private RuntimeConfiguration instance = null;

  private Category cat =
Category.getInstance(RuntimeConfiguration.class.getName());

 [...]

  /**
   ** Default constructor. Loading properties
   */
  protected RuntimeConfiguration() {
 
PropertyConfigurator.configure(Log4JPropertyLoader.getInstance().getLog4jPro
perties());
    // load the properties file
    InputStream istream =
RuntimeConfiguration.class.getResourceAsStream("runtimeconfiguration.propert
ies");
    props = new Properties();
    try {
      props.load(istream);
    }
    catch (IOException ex) {
      cat.fatal("Cannot find properties file!", ex);
    }
  }

[...]

last but not least you can see my propertyfile that is delivered by the
class Log4JPropertyLoader.
the method getLog4JProperties() returns the Properties below, that are
loaded via an InputStream.

#Set root category to debug and its only appender to R
log4j.rootCategory=DEBUG, R

#R appender
log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=LHMORe.log
log4j.appender.R.MaxFileSize=100KB

#Keep one backup file
log4j.appender.R.MaxBackupIndex=1

log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] (%F:%L) - %m%n

Please answer directly to mailto:[EMAIL PROTECTED]

hope you can help me,
 regards, oliver

Oliver Toma

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to