Hi Umesh,
You can define a custom appender and associated logger for this purpose and
then use that logger in your SysOutErrRedirector.
Sample code:
--
public class SysOutErrRedirector
{
private Logger logger;
public SysOutErrRedirector(Logger myLog
You could and should try to pipe out error and std out
But at same time look at declaring a logger in each file and find replace
system. with logger... calls :) that would make for cleaner logging and
with the other options of log4j like controlling which classes are in debug
or error mode, etc.
/
you may want to consider piping stderr and stdout to the apache rotatelogs
program.
■ DOUGLAS E. WEGSCHEID // LEAD ENGINEER
(269) 923-5278 // douglas_e_wegsch...@whirlpool.com
"A wrong note played hesitatingly is a wrong note. A wrong note played
with conviction is interpretation."
Umesh Paliw
We already have this implemented. But the problem is that we are not able to
maintain the files and after few days the file size becomes too large to be
opened.
Hence looking for a solution with Log4j . I have a solution using
java.util.logging but since we are using Log4j for our logging I am
is log4j necessary?
will
java -jar foo.jar > sysout.txt 2> syserr.txt
suffice?
■ DOUGLAS E. WEGSCHEID // LEAD ENGINEER
(269) 923-5278 // douglas_e_wegsch...@whirlpool.com
"A wrong note played hesitatingly is a wrong note. A wrong note played
with conviction is interpretation."
Umesh Paliwa