logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Clandes Tino <clandestino_...@yahoo.co.uk>
Subject log4j stops logging at console
Date Mon, 16 May 2005 13:50:53 GMT
Hello all.
I am facing the problem with log4j usage in two
separate applications.
I am using CONSOLE appenders for both of them.
Applications are started separately (in two shell
windows). The first app (App1) is assembled as EAR and
deployed under JBoss (it uses log4j.jar from
JBoss/server/default/lib and initializes log4j through
MBean, where appenders and loggers are configured).

Here is the method in MBean that configures log4j in
App1:
-------------------------------------------------------
private void initLog4j() throws ConfigurationException
{        
    final Properties props = new Properties();     
    props.setProperty("log4j.category.com.myapp",
”DEBUG, CONSOLE, FILE");
   
props.setProperty("log4j.appender.CONSOLE","org.apache.log4j.ConsoleAppender");
props.setProperty("log4j.appender.CONSOLE.layout","org.apache.log4j.PatternLayout")
       
props.setProperty("log4j.appender.CONSOLE.layout.ConversionPattern","%d{ISO8601}
 %-5p [%c{1}] [%X{user}]  - %m%n");
           
props.setProperty("log4j.appender.FILE","org.apache.log4j.RollingFileAppender");
           
props.setProperty("log4j.appender.FILE.File",
getConfigurationSetting(LOG_FILE));
           
props.setProperty("log4j.appender.FILE.MaxFileSize",
getConfigurationSetting(MAX_FILE_SIZE));
           
props.setProperty("log4j.appender.FILE.MaxBackupIndex",
getConfigurationSetting(MAX_BACKUP_FILE));
           
props.setProperty("log4j.appender.FILE.layout","org.apache.log4j.PatternLayout");
           
props.setProperty("log4j.appender.FILE.layout.ConversionPattern","%d{ISO8601}
 %-5p [%c{1}] [%X{user} %X{ip} %X{userAgent}] -
%m%n");
            
        PropertyConfigurator.configure(props);
     }

App1 uses A.jar and B.jar from App2 in compilation and
runtime. Both jars are placed in sar archive and
deployed in default/deploy folder under Jboss.

The other (App2) is RMI Server application deployed
separately (it uses another log4j-1.2.8.jar placed in
its classpath). A.jar and B.jar are in its classpath.
App2 configures log4j by log4j properties file:

------------------------------------------------
log4j.category.CONSOLE = , aCONSOLE
log4j.appender.aCONSOLE =
org.apache.log4j.ConsoleAppender
log4j.additivity.CONSOLE=false
log4j.appender.aCONSOLE.ImmediateFlush=true
log4j.appender.aCONSOLE.layout=org.apache.log4j.PatternLayout
--------------------------------------------------

Both applications are physically on the same machine.
The problem occurs when some class from App1 invokes a
class from B.jar. Then logging disappears from console
 window of App1. No further message in log appears.
However logging into file works OK.

My question is:
What can cause such behavior?

Thanx for the hint in advance.
Best regards
Milan



		
___________________________________________________________ 
How much free photo storage do you get? Store your holiday 
snaps for FREE with Yahoo! Photos http://uk.photos.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Mime
View raw message