JAVA开发 资料收集之 log4j日志路径的设置

The conclusion comes like that:

The current path (./)is stands for the project location.(see pic 1: Location)

 

How can we set the path of the log file accurately in log4j.properties?

Such as there is a web project which I created in eclipse.

Detail info like following:

pic 1

JAVA开发 资料收集之 log4j日志路径的设置

And we set the log path like following in log4j.properties:

log4j.appender.R.File=./testutilities.log

Then we get the testutilities.log in the following path(path1 in pic2)

If we set the log path like this:

log4j.appender.R.File=./RCA2CRM_/testutilities/testutilities.log then path2(in pic2)

pic 2

JAVA开发 资料收集之 log4j日志路径的设置

 

 

转载于:https://www.cnblogs.com/cici-new/archive/2012/11/23/2783725.html