RE: Accessing the Commons Logging Interface

2002-09-25 Thread du Plessis, Corneil C

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

In your class:
static private Log log = LogFactory.getLog(MyClass.class);



Corneil du Plessis
Technical Specialist
Internet Development
Retail Channels
Standard Bank
Direct +27 (11) 636-2210
Mobile +27 (83) 442-9221
ICQ# 66747137



-Original Message-
From: Tal Rotbart [mailto:[EMAIL PROTECTED]]
Sent: 25 September, 2002 09:47
To: Struts Users Mailing List
Subject: Accessing the Commons Logging Interface


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


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

__

Disclaimer and confidentiality note


Everything in this e-mail and any attachments relating to the official business of 
Standard Bank Group Limited is proprietary to the company. It is confidential, legally 
privileged and protected by law. Standard Bank does not own and endorse any other 
content. 
Views and opinions are those of the sender unless clearly stated as being that of 
Standard Bank. 

The person addressed in the e-mail is the sole authorised recipient. Please notify the 
sender 
immediately if it has unintentionally reached you and do not read, disclose or use the 
content
in any way. 

Standard Bank can not assure that the integrity of this communication has been 
maintained nor 
that it is free of errors, virus, interception or interference.

__

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




Re: Accessing the Commons Logging Interface

2002-09-25 Thread Eddie Bush

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(W00T!);
}
}

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]