3 Replies Latest reply on Jun 25, 2009 3:13 AM by ataylor

    JBMLoggerFormatter is synchronized

    timfox

      Won't that provide a horrendous contention point?

        • 1. Re: JBMLoggerFormatter is synchronized
          ataylor

           

          Won't that provide a horrendous contention point?


          I guess that depends on how much logging is going on. The alternative is to make SimpleDateFormat and Date local to the format method and create them every time.

          • 2. Re: JBMLoggerFormatter is synchronized
            timfox

            Under trace logging this would be a big problem.

            (Actually the old JDK logging used to have similar issues to what you re-introduced here, but they fixed it)

            It really can't be synchronized. Object creation is extremely fast these days in modern JVMs.

            • 3. Re: JBMLoggerFormatter is synchronized
              ataylor

               

              t really can't be synchronized. Object creation is extremely fast these days in modern JVMs

              Ok I have removed the synchronisation.

              (Actually the old JDK logging used to have similar issues to what you re-introduced here, but they fixed it)


              I'm not sure they have, take a look at java.util.logging.SimpleFormatter which is the default formatter.