Some time the need arises to have our with different name. By default, if no other configuration is given, log4j will search your classpath for a '' file.

Now to use your own named log4j property add the following line in your main program:

  PropertyConfigurator.configure("File  name with path")


 PropertyConfigurator.configure("c:\\logs\\")   this will set this as a default property name and all done =)

About nitingautam

I am Tech Lead (Java/J2EE/ExtJs) with a MNC located @ Gurgaon.
This entry was posted in HowTo, Java, log4j. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *