Hope u can help me with this.

Could i have more than one configuration file with the same name but in
different directories?

That is, in two different directories,

e.g.
1st configuration file
/proj/proj100/projtest1/log.config

log4j.categoryFactory=com.sns.util.logging.LoggerFactory
log4j.rootCategory=DEBUG

log4j.category.com.sns.util=WARN,A-UTIL

log4j.appender.A-UTIL=org.apache.log4j.RollingFileAppender
log4j.appender.A-UTIL.layout=org.apache.log4j.PatternLayout
log4j.appender.A-UTIL.layout.ConversionPattern=%d %-5p %c - %m%n

log4j.appender.A-UTIL.File=/sns/infrastructure/base/logs/util.log

log4j.appender.A-UTIL.MaxFileSize=100KB
log4j.appender.A-UTIL.MaxBackupIndex=5

log4j.additivity.com.sns.util=false


&

2nd configuration file
/proj/proj100/projtest2/log.config

log4j.categoryFactory=com.sns.util.logging.LoggerFactory
log4j.rootCategory=DEBUG

log4j.category.com.sns.base=WARN,A-BASE

log4j.appender.A-BASE=org.apache.log4j.RollingFileAppender
log4j.appender.A-BASE.layout=org.apache.log4j.PatternLayout
log4j.appender.A-BASE.layout.ConversionPattern=%d %-5p %c - %m%n

log4j.appender.A-BASE.File=/sns/infrastructure/base/logs/base.log

log4j.appender.A-BASE.MaxFileSize=100KB
log4j.appender.A-BASE.MaxBackupIndex=5

log4j.additivity.com.sns.base=false


here is the program,

package com.sns.base;

import com.sns.util.logging.*;

public class TestLogPrinter2 {

static LogPrinter logs =
LogPrinter.getInstance(TestLogPrinter2.class.getName(),
"/proj/proj100/projtest1/log.config");

        public TestLogPrinter2(){
        }

        /**
        * There is a set of prioritized methods which can be used.
        * Here are they, debug, info, warn, error, and fatal
        */
        public static void main(String[] args) {

                logs.debug("2DEBUG MESSAGE");
                logs.info("2INFO MESSAGE");
                logs.warn("2WARN MESSAGE");
                logs.error("2ERROR MESSAGE");
                logs.fatal("2Fatal MESSAGE");
        }
}

If i run the above program, this, /sns/infrastructure/base/logs/util.log
will be created with the messages.
/sns/infrastructure/base/logs/base.log is also created with no message.

why is this so?

please advice!


thanks & happy easter
Derek


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

Reply via email to