Enlightensoft's Blog

Helping in your each step

  • Categories

  • Authors

  • Advertisements

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.




One Response to “Log4j Configration Step By Step”

  1. trilok said

    this is good site thanks pankil for sharing knowledge.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: