Title: RE: [JBoss-user] log4j+JBoss

You should be able to use log4j the same way as you do for any class. See the examples on the Log4J docs.

This is my code on a state-full session bean,


//*** IMPORT AS NEEDED ***//
import org.apache.log4j.Category;
import org.apache.log4j.PatternLayout;
import org.apache.log4j.Layout;
import org.apache.log4j.FileAppender;
import org.apache.log4j.PropertyConfigurator;

//** ON MY ejbCreate **//

    //set logging options
    try{
      Layout layout = new PatternLayout("%d{HH:mm:ss,SSS}%r [%t] %c %x - %m%n");
      cat.addAppender(new FileAppender(layout,"C:/temp/your.log",true));
      cat.info("Started Log for EJB");
    } catch(IOException e){
      isDebug = false;
    };


___________________________
Paul Jaime
[EMAIL PROTECTED]
___________________________

 -----Original Message-----
From:   Isidoro Fernandez Diaz [mailto:[EMAIL PROTECTED]]
Sent:   Wednesday, May 23, 2001 9:03 AM
To:     [EMAIL PROTECTED]
Subject:        [JBoss-user] log4j+JBoss


        Hi!

                I need to download log4j for JBoss... Can help me anybody?
                Also I need to learn how to install and to configure log4j for JBoss.

        Thanks folks. Bye.

Isidoro Fern�ndez D�az
mailto:[EMAIL PROTECTED]
Software Engineer
TELENIUM, The New Millennium Telecom Company
Agust�n de Fox�, 25, plta. 13
28036 MADRID
Tel. +34 91 315 85 62
Fax +34 91 315 63 37
http://www.telenium.es


_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to