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

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Log4j Console Output" Watch "Log4j Console Output" New topic

Log4j Console Output

David Garratt
Ranch Hand

Joined: Aug 08, 2003
Posts: 196

Within my application I use log4j to see what's going on. I load my log4j settings from an xml file using the syntax below :-


I output debug data using methods like :

final Logger logger = Logger.getLogger(Utility.class);
ogger.debug("something or other etc");

The XML config looks like :-

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">

<log4j:configuration xmlns:log4j=''>

<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
<param name="Threshold" value="DEBUG"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%-5p [%t] %c - %m%n"/>

<level value="debug" />
<appender-ref ref="CONSOLE" />

When I run my application from eclipse I see that the output appears in a eclipse window called "Console".

My question is, when I run the program from the DOS command line why don't I see any output in the DOS window, is that not the console in this case?

The application is a gui/swing application.

Many thanks in advance,

I agree. Here's the link:
subject: Log4j Console Output
Similar Threads
log4j - creating my own file
log4j not logging
How Can I log my pintStackTrace () statement into log file?
log4j: Why aren't my debug statements showing?
log4j console output