Uploaded image for project: 'JBoss Log Manager'
  1. JBoss Log Manager
  2. LOGMGR-117

Fork Log4J ConosleAppender to simply handling of calls to System.out

    Details

    • Type: Enhancement
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 1.1.2.CR1
    • Component/s: None
    • Labels:
      None

      Description

      While the use of ConsoleAppender in Log4J application logging configurations is discouraged, JBoss could probably do a better job of managing its use.

      Currently it's possible to encounter a deadlock if thread A invokes System.out.println() and thread B invokes Logger.info(). Thread A will get the lock on System.out (a java.io.PrintWriter), but then thread B will get the lock on the org.apache.log4j.ConsoleAppender. Then each thread is waiting on the other's lock.

      The suggested improvement (discussed with James Perkins) is to fork Log4J's ConsoleAppender so that instead of calling System.out.println, it calls the real stdout.

      Bonus enhancement: Drop a WARN message to the system root logger discouraging the use of ConsoleAppender in application configurations.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                gaol Lin Gao
                Reporter:
                klape Kyle Lape
              • Votes:
                2 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: