Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-3457

Log4j 1.x 2.17.2 bridge - Does standard RollingFileAppender supports multiple process writing to same log file at the same time??

    XMLWordPrintableJSON

Details

    • Question
    • Status: Resolved
    • Major
    • Resolution: Information Provided
    • 2.17.2
    • None
    • Log4j 1.2 bridge
    • None

    Description

      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.javaJavaLoggingMultiThTest.javacustomlog.properties 

      In one of the mail chain to group Log4J Users List <log4j-user@logging.apache.org>,  ralphgoers pointed out that "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)".

      Attachments

        1. CustomLogger.java
          12 kB
          Pooja Pandey
        2. CustomLoggerFactory.java
          0.3 kB
          Pooja Pandey
        3. JavaLoggingMultiThTest.java
          4 kB
          Pooja Pandey
        4. CitedText-RollingFileAppenderNoSupportForMultProcessWritingToSameFile.PNG
          54 kB
          Pooja Pandey
        5. CustomMultiProcessRollingAppender.java
          30 kB
          Pooja Pandey
        6. customlog.properties
          1 kB
          Pooja Pandey

        Activity

          People

            pkarwasz Piotr Karwasz
            PoojaTheCoder Pooja Pandey
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: