File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes log4j Output to Console and File Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "log4j Output to Console and File" Watch "log4j Output to Console and File" New topic

log4j Output to Console and File

JLS Steff

Joined: Apr 06, 2008
Posts: 3
log4j runs great and builds a log flie.
I want the same log entries to echo to the screen as well as have them written to a file.

I can't find a way to do this.
Manuel DeAngelo

Joined: Jan 25, 2008
Posts: 13
Just create 2 appenders (1 file, 1 stdout), this should be working fine.

If you need more help, it will be useful to know how you configure log4j (property file, xml file, in Java code).

regards, Manuel
I agree. Here's the link:
subject: log4j Output to Console and File
Similar Threads
setting log4j
log files
Not able to save logs into .log file
Log4j rolling policy must be declared?