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 <[email protected]> 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 <[email protected]> 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: [email protected] > For additional commands, e-mail: [email protected] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
