ConsoleAppender ignores System.setOut

J

Juergen Weber

Hi,

from a bean called from a jsp I tried to System.setOut to a
ByteArrayOutputStream and then call an application via X.main.
X logs via log4j. I exspected, that X's log would now go into the
ByteArrayOutputStream, but it still goes to the console log output.
How can
that be?

Also, it seemed to happen, that on further calls from the jsp, log4j
would
no longer work for X at all, there was no output any more.

So I wonder, if I should start X via Runtime.exec(), but it seems like
a waste of ressources to start a VM if I just could call main(). But
as it seems, an app ran with log4j needs its own VM.

Juergen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top