Log4J Problem in WSSD 5.1.2

From: gilgantic (gilgantic_at_yahoo.com)
Date: 02/28/05


Date: 28 Feb 2005 08:38:17 -0800

We have a Struts application with Log4J as our logger. We are trying to
get the logger to print out to the console, but it on does it on the
first time we hit Log4j, after that no more messages. Any ideas as to
what is wrong?

These are snippets from the classes and log4j config files.

// Define logger
private static final Logger logger
                            = Logger.getLogger(<CLASSNAME>.class);

// Call logger
logger.debug("Some log message.");

<appname>.log4j.clf -- The Log4J configuration file for app.
log4j.rootLogger=DEBUG, cons
# console appender
log4j.appender.cons=org.apache.log4j.ConsoleAppender
log4j.appender.cons.layout=org.apache.log4j.PatternLayout
log4j.appender.cons.layout.ConversionPattern=FINANCE [%-5p] %c{1} Date:
%d -%m%n



Relevant Pages

  • Re: Log4j - why Static Final, why not protected?
    ... > We use Log4j for all our logging, I want to know why we have to do the ... > define the logger in each class.. ... > b) you have granularity in turning off your logging. ... Sometimes programmers will compromise runtime resources for coding gains ...
    (comp.lang.java)
  • Re: log4j methods: instance or class?
    ... If the named logger already exists, then the existing instance will be ... Not AFAIK from log4j. ... Sun recommends that class names begin with upper-case letters, non-constant variables and methods should start with lower-case letters. ...
    (comp.lang.java.programmer)
  • Re: Multiple foreground colors in AWT TextArea?
    ... AccessControlException ... but I've seen lots of examples of both java.util.logging Logger ... "log4j bloatware" - not sure why we're talking the other library ... now) that run just fine outside of applets. ...
    (comp.lang.java.programmer)
  • Re: Multiple foreground colors in AWT TextArea?
    ... log4j Logger (which is where we started when you mentioned "log4j ... lies not in our logging libraries but in our applets. ...
    (comp.lang.java.programmer)
  • Re: java Logger vs. Log4J
    ... I was surprised to see that there was a built in logging mechanism ... that log4j has many more logger output destinations than the sun one. ...
    (comp.lang.java.programmer)