When I have tried the configure and watch option I have found that it only
seems to pick up the changes dynamically if you explicitly specify the path
to the properties file rather than letting log4j find it on the classpath

Cheers

Adrian

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: 03 February 2003 11:42
To: aleron76
Cc: log4j-user
Subject: Re:Real-time configuration for a bean inside application server


Hi everybody,
unfortunately nobody answered me at my previous mail (shown below) about
logging for a bean.

Now, I 'm wondering whether I did not receive any answer because mine is a
complicated problem that nobody has already investigated, or I'm following a
completely wrong way or I haven't been able to explain my problem properly
or something else.

What's the reason, please?  :-) 

Thanks in advance,
best regards,
Alessio

___________________________________________________________________________
>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]


=======================================================================
Information in this email and any attachments are confidential, and may
not be copied or used by anyone other than the addressee, nor disclosed
to any third party without our permission.  There is no intention to
create any legally binding contract or other commitment through the use
of this email.

Experian Limited (registration number 653331).  
Registered office: Talbot House, Talbot Street, Nottingham NG1 5HF

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

Reply via email to