Enlightensoft's Blog

Helping in your each step

  • Categories

  • Authors

Archive for the ‘Log’ Category

Log for the application

Log4j Configration Step By Step

Posted by Pankil Patel on July 11, 2011

How to configure log4j logging into your web project?

Step 1:

Add below entry into your web.xml file

Step 2:

Add log4j.xml file into direct WEB-INF folder of your project.

Sample log4j.xml is given below:

 

 

 

 

 

 

 

 

 

 

 

 

 

Step 3:

Add LOGGER into your code by traditional way (logger in all methods) or new way as AOP (Spring Point-Cut).

static final Logger LOGGER = Logger.getLogger(SpringFactory.class);

Hurreeeeeeeeeeeeeeeeeeeeeeeeeeeeeee, you are ready to use log4j configration.

Best Of Luck.

 

 

Advertisements

Posted in Log | 1 Comment »

Do you like Logback?

Posted by Pankil Patel on May 19, 2010

How to use “ch.qos.logback.classic.sift.SiftingAppender” ?

Here is the sample for Logback with required jars.

I have integrated it into a JAVA APPLICATION.

Note: please change the downloaded file extension .doc to .rar and than unzip it.

Sample_SiftingAppender

 

You may also reference a resource on the class path instead of a file.

Like:

 

 

 

 

Some nice link related it.

http://logback.qos.ch/index.html

http://logback.qos.ch/manual/introduction.html

Posted in Log | Leave a Comment »