log4j.properties
-----------------------
# An example log4j configuration file that outputs to System.out.  The
# output information consists of relative time, log level, thread
# name, logger name, nested diagnostic context and the message in that
# order.

# For the general syntax of property based configuration files see the
# documenation of org.apache.log4j.PropertyConfigurator.

log4j.rootLogger=INFO,stdout

log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{dd-MMM-yyyy:HH:mm:ss} %t 
[%M] %p --- %m%n

Log4JTest.java
-----------------------
import org.apache.log4j.*;
public class Log4JTest
{

        static Logger logger = null;

        static
        {
                try
                {
                        logger = Logger.getLogger (Log4JTest.class);
                        PropertyConfigurator.configure( 
"./log4j.properties" );
                        //BasicConfigurator.configure();
                        //logger.setLevel (Level.INFO);
                }
                catch (Exception expGeneral)
                {
                        expGeneral.printStackTrace ();
                }
        }

        public static void main (String a[]) throws Exception
        {
                logger.info ("Start");
                logger.warn ("Warning SOPs");
                logger.info ("Information SOPs");
                logger.debug ("Debug SOPs");
                logger.info ("End");
        }
}

Thanks and regards,
Pazhanikanthan. P
Project Leader,
Caritor (India) Pvt. Ltd.,
Madras - 600 006
Mob: 9886152717
Extn: 40123



Pazhanikanthan Periasamy <[EMAIL PROTECTED]> 
12/28/2005 09:44 AM
Please respond to
"Struts Users Mailing List" <user@struts.apache.org>


To
"Struts Users Mailing List" <user@struts.apache.org>
cc
Vasumathi <[EMAIL PROTECTED]>
Subject
Re: Regarding Log4j








I have written a sample program which yyou can use to start. Read teh 
documentation provided in Log4J package too for more information 

Thanks and regards,
Pazhanikanthan. P
Project Leader,
Caritor (India) Pvt. Ltd.,
Madras - 600 006
Mob: 9886152717
Extn: 40123 


Vasumathi <[EMAIL PROTECTED]> 
12/28/2005 09:27 AM 

Please respond to
"Struts Users Mailing List" <user@struts.apache.org>


To
Struts Users Mailing List <user@struts.apache.org> 
cc

Subject
Regarding Log4j










Hi Guys
 I am working on struts for last one year. In my current project we are 
using 
Log4j for Logger.i like to know how to configure and use in our 
application.
particularly we are using Ant tool.
Anyone can help me please.
its very urgent please....
regards
vasumathi.p

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

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

Reply via email to