Redirect system.out into FileAppender

2009-01-08 Thread Thomas.TH.Hamacher
Hi,

is it possible to redirect the normal system.out or system.err into a 
FileAppender defined through log4j.

I have the problem that I´m using a 3rd-party application, that uses 
System.out.println() in it´s code and I´d like to combine this with my other 
log4j-configurations into one single file currently defined through a 
FileAppender. Any idea how to do that?

Thanks
Thomas


AW: Redirect system.out into FileAppende

2009-01-08 Thread Bender Heri
I suggest to implement a specialized OutputStream which writes to the file 
appender (or directly to the file appender's file, if no threading issue 
arise). Then replace the default System.out and System.err streams by this 
specialized stream.
Heri

-Ursprüngliche Nachricht-
Von: thomas.th.hamac...@partner.bmw.ch 
[mailto:thomas.th.hamac...@partner.bmw.ch] 
Gesendet: Donnerstag, 8. Januar 2009 14:06
An: log4j-user@logging.apache.org
Betreff: [SPAM (Bayesain Analysis)] - Redirect system.out into FileAppender - 
Bayesian Filter detected spam

Hi,

is it possible to redirect the normal system.out or system.err into a 
FileAppender defined through log4j.

I have the problem that I´m using a 3rd-party application, that uses 
System.out.println() in it´s code and I´d like to combine this with my other 
log4j-configurations into one single file currently defined through a 
FileAppender. Any idea how to do that?

Thanks
Thomas


-
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-user-h...@logging.apache.org



Re: TimeBasedRollingPolicy with hourly filenames not getting compressed

2009-01-08 Thread agEE

Hey Curt,
  That is really strange. I think the nabble editor does not like the
parameter line. It also removed my parameter  of Append = true. 
 
I already have the fileNamePattern parameter set with the value of
loader.%d{-MM-dd}.log.gz

I hope you can see this one. Thanks for replying and i really hope to get
this solved. 
thanks again
AG.




Curt Arnold-3 wrote:
 
 
 On Jan 7, 2009, at 6:30 PM, agEE wrote:
 

 Thanks for the reply,

 I am already specifying the following. sorry if it did not show up  
 in the
 original thread

  appender name=ROLL
 class=org.apache.log4j.rolling.RollingFileAppender

rollingPolicy  
 class=org.apache.log4j.rolling.TimeBasedRollingPolicy

/rollingPolicy
layout class=org.apache.log4j.PatternLayout

/layout
  /appender

 I have not luck with that in my log4j.xml file. Is there anything  
 else i
 should try?
 
 The line that I inserted in my previous message appears to be dropped,  
 you need to specify the fileNamePattern parameter to some value that  
 ends with .gz.  Something like (substituting [ and ] for less than and  
 greater than).
 
   [rollingPolicy  
 class=org.apache.log4j.rolling.TimeBasedRollingPolicy]
   [param name=fileNamePattern value=something-%d{-MM-dd- 
 HH}.gz/]
 [/rollingPolicy]
 
 -
 To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
 For additional commands, e-mail: log4j-user-h...@logging.apache.org
 
 
 

-- 
View this message in context: 
http://www.nabble.com/TimeBasedRollingPolicy-with-hourly-filenames-not-getting-compressed-tp21342608p21356598.html
Sent from the Log4j - Users mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-user-h...@logging.apache.org



Re: Redirect system.out into FileAppender

2009-01-08 Thread Brett Randall
Almost this exact same question was answered very recently and rather
brilliantly by Michael Erskine here:
http://www.nabble.com/I-need-to-make-logging-in-a-complete-application-td21174776.html.

Brett

On Fri, Jan 9, 2009 at 12:05 AM, thomas.th.hamac...@partner.bmw.ch wrote:

 Hi,

 is it possible to redirect the normal system.out or system.err into a
 FileAppender defined through log4j.

 I have the problem that I´m using a 3rd-party application, that uses
 System.out.println() in it´s code and I´d like to combine this with my other
 log4j-configurations into one single file currently defined through a
 FileAppender. Any idea how to do that?

 Thanks
 Thomas



Writing to Database

2009-01-08 Thread Aswani Kommireddy
Hello Everybody,

We have one requirement in our Application.
We want to write Logs to database, but not one DB call per logging event.
Plans are like collecting all logging events till the end of each
server request, and commit that to database as a single message(single
record). I mean collect all log messages of a request (client - server -
client) into some sort of buffer, and insert all those messages buffer as a
single message (clob data) into the DB table.

 We are currently using log4j to log events to a file (a single file for all
users). Now we want to insert into DB.

Looking forward.

Thanks in advance

Ash


How to change the DEBUG level log message to be displayed in stdout

2009-01-08 Thread Allen
Hey guys,
I would like to know how to change the DEBUG level log message to be
displayed in stdout ?

Any useful info will be appreciate.

John