RE: redirecting Stdout and stderr to a different log file

2012-01-17 Thread Himanshu Gupta
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

Re: redirecting Stdout and stderr to a different log file

2012-01-17 Thread Tushar Kapila
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. /

RE: redirecting Stdout and stderr to a different log file

2012-01-17 Thread Douglas E Wegscheid
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

RE: redirecting Stdout and stderr to a different log file

2012-01-17 Thread Umesh Paliwal
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

RE: redirecting Stdout and stderr to a different log file

2012-01-17 Thread Douglas E Wegscheid
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