You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by John Sowell <JS...@DigMedia.cc> on 2001/12/14 00:55:50 UTC

Re-directing logging messages to an output file

Hi, everybody,
  I'm new to log4j, and am attempting to use log4j in conjunction with a
huge java project, and my question is a simple one: Instead of the logging
statements being printed out to the screen by default, how do I instruct
log4j to output the text to a logfile, let's say Log.txt? Do you have any
sample code to give me to illustrate how this is done? Any help would be
greatly appreciated. Thanks much.

John Sowell

Software Engineer, DigMedia
(760) 431-3500 x1188

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Re-directing logging messages to an output file

Posted by Thomas Tuft Muller <tt...@online.no>.
Assuming you use log4j 1.1.3, you will find a class LoggingOutputStream
under LOG_HOME/contrib/JimMore. Read documentation carefully, as well as the
news contributions accompanied with the class.

Note that this solution involves redirecting System.out and System.err. This
should always be approached with some consideration.

Hope this helps.

--

Thomas

| -----Original Message-----
| From: John Sowell [mailto:JSowell@DigMedia.cc]
| Sent: 13 December 2001 23:56
| To: 'log4j-user@jakarta.apache.org'
| Subject: Re-directing logging messages to an output file
|
|
| Hi, everybody,
|   I'm new to log4j, and am attempting to use log4j in conjunction with a
| huge java project, and my question is a simple one: Instead of the logging
| statements being printed out to the screen by default, how do I instruct
| log4j to output the text to a logfile, let's say Log.txt? Do you have any
| sample code to give me to illustrate how this is done? Any help would be
| greatly appreciated. Thanks much.
|
| John Sowell
|
| Software Engineer, DigMedia
| (760) 431-3500 x1188
|
| --
| To unsubscribe, e-mail:
| <ma...@jakarta.apache.org>
| For additional commands, e-mail:
| <ma...@jakarta.apache.org>
|
|



*************************************************************************
Copyright ERA Technology Ltd. 2001. (www.era.co.uk). All rights reserved. 
Confidential. No liability whatsoever is accepted for any loss or damage 
suffered as a result of accessing this message or any attachments.

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>