Hi everybody,
I'm trying to have a bean inside the application server be able to log, with the possibility to change at run-time the configuration, by changing the log4j.properties.

My bean has the following initialization:
PropertyConfigurator.configureAndWatch(log4j.properties,5000);

In this way every time the bean is invoked I'm sure the configuration file (log4j.properties, which is inside the classpath of the application server) is read.

The problem is that currently, the bean is able to log, but if I change something (i.e. the file where to write the log) in the lo4j.properties, this change is not recognized.

For your information, I add my log4j.properties: be aware that I've added my own new level, and for this reason I added the following classes (which are similar to the homonym classes inside the downloaded log4j-1.2.7.zip file):
-MyLogger
-MyLoggerFactory
-MyLogLevel

Is maybe wrong the bean initialization (I did it for a servlet and worked)? Or maybe the log4j.properties file?

Any suggestion is really really appreciated.
Thank you very much in advance.

Bye
Alessio
[EMAIL PROTECTED]


_____________________________________________________
log4j.loggerFactory=com.mylog.MyLoggerFactory

log4j.category.com.primo.al.PRIMOBean=DEBUG, dest2


#dest2
log4j.appender.dest2=org.apache.log4j.RollingFileAppender
log4j.appender.dest2.Threshold=INFO
log4j.appender.dest2.File=E:/temp/log4j.log
log4j.appender.dest2.Append=true
log4j.appender.dest2.layout=org.apache.log4j.PatternLayout
log4j.appender.dest2.layout.ConversionPattern=[%d{yyyy-MMM-dd hh:mm},%6.6r]%-5p[%t]%x(%F:%L) - %m%n
log4j.appender.dest2.MaxFileSize=100KB
log4j.appender.dest2.MaxBackupIndex=2

_________________________________________________________________
Comunica le tue emozioni in tempo reale con MSN Messenger! http://messenger.msn.it


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

Reply via email to