I realize I misread the question. Yes, two web applications running in the same 
JVM can write to the same log file. If there is only one instance of log4j in 
the JVM then you should be able to safely use the RollingFileAppender.

Ralph

> On Aug 10, 2018, at 7:38 AM, Ralph Goers <ralph.go...@dslextreme.com> wrote:
> 
> You can have multiple applications write to the same log file if you use file 
> locking, otherwise your log file is likely to get corrupted. The 
> RollingFileAppender does not support file locking as it is not possible, or 
> at least very difficult, to have multiple applications try to safely roll the 
> files. 
> 
> Ralph 
> 
>> On Aug 10, 2018, at 3:29 AM, Rajvinder Pal <rajvinder....@gmail.com> wrote:
>> 
>> Hi,
>> 
>> Can multiple web applications write to same log file using log4j2 ? Should
>> i create separate log file for each web application?
>> 
>> Thanks,
>> Raj
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
> For additional commands, e-mail: log4j-user-h...@logging.apache.org
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-user-h...@logging.apache.org

Reply via email to