In log4j, you can configure the logging properties by several ways.
- Through the log4j.xml located in class directories
- Through the plain log4j.properties in class directories
- Direct coding which is place in a class
The first two is recommended since the change of properties should be based on deployment environment. It should not be modified by changing codes. In fact, the manipulation using codes seems easier and you can at least make reference to the API to learn how to configure.
Here is a tutorial on setting the log4j.properties in Simplified Chinese.
http://hedong.3322.org/archives/000195.html








