I currently use Log4j with NDC enabled combined with struts.
Here is how I use it:
- Run PropertyConfigurator from a startup servlet
- import org.apache.log4j.Category in your code
- set reference to log4j in your code
public class loginAction extends Action {
static Category cat = Category.getInstance(loginAction.class.getName());
....
...
.
.
and in the body just call it:
if ( cat.isDebugEnabled() )
cat.debug("Attempting login with session: " + sessionid);
I hope that helps. I wish all products were as easy as log4j to integrate.
-Mark
----- Original Message -----
From: "Sundar @eSaravana" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, February 27, 2001 2:01 PM
Subject: Has any one used struts and log4j successfully?
> Has anyone used log4j with struts? I have used log4j before, but I am new
to
> struts. So, I am just looking for a short cut. If you have,could you
please
> send me some code fragments to start off.
>
> I would really appreciate it.
>
> Cheers.....!
> Sundar
>
>