Re: Log4j closes System.err

2011-02-28 Thread Curt Arnold
On Feb 28, 2011, at 4:41 AM, Martin Nyolt wrote: > No idea, anyone? > Appearently, this has to work somehow, since using a configuration file you > can set the follow-option to be true without closing any stream. > But I never found any hint how to do this. > > Am 18.02.2011 15:01, schrieb Mart

Re: Log4j closes System.err

2011-02-28 Thread Martin Nyolt
On 28/02/11 16:26, Christian Grobmeier wrote: activateOptions calls WriterAppender.setWriter(), which first calls reset(), which in turn calls closeWriter(). see https://svn.apache.org/repos/asf/logging/log4j/trunk/src/main/java/org/apache/log4j/WriterAppender.java (the base class of ConsoleAppe

Re: Log4j closes System.err

2011-02-28 Thread Christian Grobmeier
> > activateOptions calls WriterAppender.setWriter(), which first calls reset(), > which in turn calls closeWriter(). > see > https://svn.apache.org/repos/asf/logging/log4j/trunk/src/main/java/org/apache/log4j/WriterAppender.java > (the base class of ConsoleAppender containing all mentioned methods

Re: Log4j closes System.err

2011-02-28 Thread Martin Nyolt
On 28.02.2011 16:07, Christian Grobmeier wrote: Looking at the source code, I cannot see what you mean - in consoleappender new streams are created, the writerappender is doing nothing. Were is it closed? As far as I can see only the previous stream is closed, once you set a new one. But in thi

Re: Log4j closes System.err

2011-02-28 Thread Christian Grobmeier
>> Not being deep into log4j, but in log4php world its necessary in most >> cases to activateOptions on an appender. > > That's what I'm doing.  Look at my first mail. Yes, I wanted to express that this looks correct to me. >> Looking at the source code, I >> cannot see what you mean - in console

Re: Log4j closes System.err

2011-02-28 Thread Martin Nyolt
On 28.02.2011 15:52, Christian Grobmeier wrote: If I don't call "app.activateOptions()", the follow-option wouldn't take effect (and I do need "follow" to be true). But activateOptions finally calls WriterAppender.reset, which calls ConsoleAppender.close and closes the previous output stream, in

Re: Log4j closes System.err

2011-02-28 Thread Christian Grobmeier
> No idea, anyone? Guess most people prefer xml/properties for config - its a bit unusual >> If I don't call "app.activateOptions()", the follow-option wouldn't take >> effect (and I do need "follow" to be true). >> But activateOptions finally calls WriterAppender.reset, which calls >> ConsoleApp

Re: Log4j closes System.err

2011-02-28 Thread Martin Nyolt
No idea, anyone? Appearently, this has to work somehow, since using a configuration file you can set the follow-option to be true without closing any stream. But I never found any hint how to do this. Am 18.02.2011 15:01, schrieb Martin Nyolt: Hello, I use the following code to load a default

Log4j closes System.err

2011-02-18 Thread Martin Nyolt
Hello, I use the following code to load a default configuration in case no configuration was set using the log4j.configuration property: static { LOGGER = Logger.getLogger(MyClass.class); Logger root = Logger.getRootLogger(); boolean inited = root.getAllAppenders().hasMo