Re: Can I change log4j configuration programatically?

2006-10-11 Thread James Stauffer
I believe you call it on the appender after you change its settings. On 10/11/06, vincentw <[EMAIL PROTECTED]> wrote: What would I call activateOptions() with? Bender Heri wrote: > > Yes, you can. Don't forget to call activateOptions() at the end of > reconfiguring. You need not to restart th

Re: Can I change log4j configuration programatically?

2006-10-11 Thread vincentw
What would I call activateOptions() with? Bender Heri wrote: > > Yes, you can. Don't forget to call activateOptions() at the end of > reconfiguring. You need not to restart the app. > Heri > > -- View this message in context: http://www.nabble.com/Can-I-change-log4j-configuration-programat

Re: Can I change log4j configuration programatically?

2006-10-11 Thread James Stauffer
Using configureAndWatch you can just change the file and it will update based on the changes. On 10/11/06, vincentw <[EMAIL PROTECTED]> wrote: Well, I use DOMConfigurator initially, but what about when the program is running?? I would like to set a new root level or a log file size. Can I do

Re: Can I change log4j configuration programatically?

2006-10-11 Thread Bender Heri
Yes, you can. Don't forget to call activateOptions() at the end of reconfiguring. You need not to restart the app. Heri > -Original Message- > From: vincentw [mailto:[EMAIL PROTECTED] > Sent: Wednesday, October 11, 2006 7:06 PM > To: log4j-user@logging.apache.org > Subject: [SPAM (Bayesai

Re: Can I change log4j configuration programatically?

2006-10-11 Thread vincentw
Well, I use DOMConfigurator initially, but what about when the program is running?? I would like to set a new root level or a log file size. Can I do something like Logger.getRootLogger.setLevel or something like that? If I do it this way do I have to stop and restart the logger? James Sta

Re: logging into different files

2006-10-11 Thread Michael Giroux
I think that you could use something like: PatternLayout pattern = new PatternLayout("your pattern"); String filename = ; FileAppender threadAppender = new FileAppender(pattern, filename); String threadLogName = ; Logger threadLog = Logger.getLogger(threadLogName); threadLog.setAdditivity(false)

Re: Can I change log4j configuration programatically?

2006-10-11 Thread vincentw
I see...no it's just a standalone Java application. James is probably wondering whether your code is running in a web container, such as Tomcat. In that case, LogWeb might be able to help http://www.codeczar.com/products/logweb/ It works great for me! Jake -- View this message in con

Re: logging into different files

2006-10-11 Thread James Stauffer
That should be possible by writing your own appender. Search the archives as this was discussed recently. On 10/11/06, sudhakardvvn <[EMAIL PROTECTED]> wrote: Have an application where the number of threads that get launched are dynamic. Could be anywhere from 1 to 300 threads that could get

Re: Can I change log4j configuration programatically?

2006-10-11 Thread James Stauffer
A stand-alone Java application could use DOMConfigurator.configureAndWatch (but don't allow it to do automatic configuration). On 10/10/06, vincentw <[EMAIL PROTECTED]> wrote: I'm don't quite understand the question. it's a java application. James Stauffer wrote: > > In what kind of environm

logging into different files

2006-10-11 Thread Bender Heri
This was discussed a lot on this list. Search in archive, keywords: MDC, RepositorySelector, different files. We currently discuss on the developper list the introduction of a MultiFileAppender which addresses just your need. But the work is still in progress... Heri > -Original Message--

logging into different files

2006-10-11 Thread sudhakardvvn
Have an application where the number of threads that get launched are dynamic. Could be anywhere from 1 to 300 threads that could get launched at runtime. I would like to know if it is possible to setup a file appender for each thread and have the indiv threads write to their own file appender.

Re: Can't figure out how to change email appender subject dynamically

2006-10-11 Thread pantichd
Maarten, That was it! Calling appender.activateOptions(); did the trick. Thanks SO much! David. Maarten Bosteels-4 wrote: > > I haven't tried it, but maybe it helps to call activateOptions() > > Like this: > > appender.setSubject(currEnv.toUpperCase()+": "+appender.getSubject()); > append