Double check that line
log4j.rootLogger=INFO, CONSOLE
This is why I hate the properties file format for log4j configuration and only
use the xml format; it's much easier (in my opinion) to understand. Maybe your
line is right, I dunno.
Ultimately I switched to logback (log4j's successor) and slf4j. And,
fortunately, logback only uses xml for its configuration files.
Seth Duda wrote:
> Could someone please provide an example of how to use Log4J from within
> a Stripes application? I have the following log4j.properties file on the
> class path:
>
> log4j.rootLogger=INFO, CONSOLE
> log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
> log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
> log4j.appender.CONSOLE.layout.ConversionPattern=[%d{dd MMM yyyy
> HH:mm:ss}] [%p] %m%n
>
> In one of my ActionBeans, I'm attempting to write a log message using
> the following:
>
> Loggger loggger = Logger.getLogger( MyActionBean.class );
> logger.info <http://logger.info>("This is a test");
>
> In the console I'm getting the following log message:
>
> [09 Dec 2009 17:48:06] [INFO] [09 Dec 2009 17:48:06] [INFO] This is a test
>
> It appears my log message was caught by stripe's logging before being
> printed to the console? I'm stumped. Any advise would be appreciated.
> I've also noticed that if I call System.out.println("This is a test")
> from within the ActionBean I get the following output to the console:
>
> [09 Dec 2009 17:48:06] [INFO] This is a test
>
> I wouldn't have expected the println to be caught by log4j.
>
> Thanks
>
>
>
>
>
> ------------------------------------------------------------------------
>
> ------------------------------------------------------------------------------
> Return on Information:
> Google Enterprise Search pays you back
> Get the facts.
> http://p.sf.net/sfu/google-dev2dev
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Stripes-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/stripes-users
------------------------------------------------------------------------------
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users