Before You Start

    If you're planning to use Log4J as your logging implementation, grab 
a fresh copy of commons-logging from the commons site and install it. 
 There were issues with the JAR included in the 1.1 bx distributions 
that cause ... problems :-)

Doing the Nasty With commons-logging:

package com.foo;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public class Bar
{
    private static Log log = LogFactory.getLog(Bar.class);

    public void baz()
    {
        ...
        if (log.isDebugEnabled())
            log.debug("W0000000000T!");
    }
}

That really is it.  There is some property config you could possibly 
need if you're using Log4J under JDK1.4.  You didn't say much about your 
environment, so I'll leave this out for now.

Tal Rotbart wrote:

>Hi all,
>
>In Struts 1.1b2, how do I access the Commons Logging Interface from withing
>a Struts Plug-In?
>1. The chapter in the User Guide is still [TO DO]
>2. It seems that the "log" static member field from within "ActionServlet"
>is not public.
>3. I have not found any "getLog" member function anywhere... Seems like a
>missing feature...
>
>Any ideas?
>
>Thanks!
>Tal Rotbart
>

-- 
Eddie Bush




--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to