You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Pooja Pandey (Jira)" <ji...@apache.org> on 2022/04/01 07:35:00 UTC
[jira] [Comment Edited] (LOG4J2-3457) Log4j 1.x 2.17.2 bridge - Does standard RollingFileAppender supports multiple process writing to same log file at the same time??
[ https://issues.apache.org/jira/browse/LOG4J2-3457?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17515762#comment-17515762 ]
Pooja Pandey edited comment on LOG4J2-3457 at 4/1/22 7:34 AM:
--------------------------------------------------------------
Hi [~pkarwasz] ,
-> I don't understand what's the "*.roll" file purpose in your code, since it does not appear to be created anywhere.
Please find the below explanation.
*If roll file exists and it is windows, implies rollover is in progress. On windows, roll file is deleted after rollover. Whereas on unix it is left around to make sure everyone is resetting their url. On unix rename doesn't fail whereas on windows it does when other processes have the file open. Hence on windows the rollover function will retry automatically till it times out or rename succeeds. Whereas on unix, rename goes through and rollover is complete only when everyone else resets their file.*
was (Author: JIRAUSER285751):
Hi [~pkarwasz] ,
-> I don't understand what's the "*.roll" file purpose in your code, since it does not appear to be created anywhere.
Please find the below explanation.
/*If roll file exists and it is windows, implies rollover is in progress. On windows, roll file is deleted after rollover. Whereas on unix it is left around to make sure everyone is resetting their url. On unix rename doesn't fail whereas on windows it does when other processes have the file open. Hence on windows the rollover function will retry automatically till it times out or rename succeeds. Whereas on unix, rename goes through and rollover is complete only when everyone else resets their file.*/
> Log4j 1.x 2.17.2 bridge - Does standard RollingFileAppender supports multiple process writing to same log file at the same time??
> ---------------------------------------------------------------------------------------------------------------------------------
>
> Key: LOG4J2-3457
> URL: https://issues.apache.org/jira/browse/LOG4J2-3457
> Project: Log4j 2
> Issue Type: Question
> Components: Log4j 1.2 bridge
> Affects Versions: 2.17.2
> Reporter: Pooja Pandey
> Assignee: Piotr Karwasz
> Priority: Major
> Attachments: CitedText-RollingFileAppenderNoSupportForMultProcessWritingToSameFile.PNG, CustomLogger.java, CustomLoggerFactory.java, CustomMultiProcessRollingAppender.java, JavaLoggingMultiThTest.java, customlog.properties
>
>
> In our application we require a rolling file appender which can be used across multiple processes targeting the same file.
> I wanted to check if current log4j1.x 2.17.2 bridge version supports multi process rolling file appender, if not then is there any plan to support this feature in future releases??
> For reference, as per our application requirement, I am attaching sample java class files for custom appender, custom multi process rolling appender, sample test program with multiple threads for which we can run multiple instances to test multi process rolling and log4j property file.[^CustomLogger.java][^JavaLoggingMultiThTest.java][^customlog.properties]
> In one of the mail chain to group Log4J Users List <lo...@logging.apache.org>, [~ralphgoers] pointed out that {color:#ff0000}_"FWIW the Log4j 2 RollingFileAppender does not support being used across multiple processes targeting the same file either. I’d love to know how you avoided having the file roll multiple times (once for each process)"_{color}. !CitedText-RollingFileAppenderNoSupportForMultProcessWritingToSameFile.PNG|width=756,height=434!
--
This message was sent by Atlassian Jira
(v8.20.1#820001)