Write log4j output to existing file

1.1k Views Asked by At

Is possible to append log4j output to an existing file? For example, defining a FileAppender log file, can we specify a log file that is already in use by other process for its logging, so the log4j output is appended to it.

This query is particular to Windows Server 2008.

Thanks Noman A.

1

There are 1 best solutions below

0
On

You can define new log4j appender and specify the log file with action as "Append"

log4j.appender.appenderName.File=myFileName.log

log4j.appender.appenderName.Append=true