Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-57888

Custom log format broken by 2.177

    XMLWordPrintable

Details

    • Jenkins 2.218

    Description

      Upon upgrading from 2.176 to 2.177, it would appear that support for providing a custom log format has been broken, due to what looks like an undocumented change (https://github.com/jenkinsci/winstone/pull/63) in the Winstone library. 

      Logging.properties file:

      .level=ALL
      handlers=java.util.logging.ConsoleHandler
      
      java.util.logging.SimpleFormatter.format=[%1$tF %1$tT.%1$tL][%4$s][%2$s] %5$s %6$s%n 
      java.util.logging.ConsoleHandler.level=INFO java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter

      I've also added the following JVM argument:

      -Djava.util.logging.config.file=/var/lib/jenkins/logging.properties
      

       

      Log format with 2.176:

      [2019-06-06 15:10:07.881][INFO][jenkins.InitReactorRunner$1 onAttained] Completed initialization
      [2019-06-06 15:10:08.052][INFO][hudson.WebAppMain$3 run] Jenkins is fully up and running
      

       

      Log format with 2.177:

      2019-06-06 15:11:40.956+0000 [id=29] INFO jenkins.InitReactorRunner$1#onAttained: Completed initialization 
      2019-06-06 15:11:41.136+0000 [id=20] INFO hudson.WebAppMain$3#run: Jenkins is fully up and running
      

      Attachments

        Issue Links

          Activity

            fatmcgav Gavin Williams created issue -
            fatmcgav Gavin Williams made changes -
            Field Original Value New Value
            Description Upon upgrading from 2.176 to 2.177, it would appear that support for providing a custom log format has been broken, I suspect by the upgrade of Jetty. 

            Logging.properties file:
            {code:java}
            .level=ALL
            handlers=java.util.logging.ConsoleHandler

            java.util.logging.SimpleFormatter.format=[%1$tF %1$tT.%1$tL][%4$s][%2$s] %5$s %6$s%n
            java.util.logging.ConsoleHandler.level=INFO java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter{code}
            I've also added the following JVM argument:
            {code:java}
            -Djava.util.logging.config.file=/var/lib/jenkins/logging.properties
            {code}
             

            Log format with 2.176:
            {noformat}
            [2019-06-06 15:10:07.881][INFO][jenkins.InitReactorRunner$1 onAttained] Completed initialization
            [2019-06-06 15:10:08.052][INFO][hudson.WebAppMain$3 run] Jenkins is fully up and running
            {noformat}
             

            Log format with 2.177:
            {noformat}
            2019-06-06 15:11:40.956+0000 [id=29] INFO jenkins.InitReactorRunner$1#onAttained: Completed initialization
            2019-06-06 15:11:41.136+0000 [id=20] INFO hudson.WebAppMain$3#run: Jenkins is fully up and running
            {noformat}
            Upon upgrading from 2.176 to 2.177, it would appear that support for providing a custom log format has been broken, due to what looks like an undocumented [change|[https://github.com/jenkinsci/winstone/pull/63]] in the Winstone library. 

            Logging.properties file:
            {code:java}
            .level=ALL
            handlers=java.util.logging.ConsoleHandler

            java.util.logging.SimpleFormatter.format=[%1$tF %1$tT.%1$tL][%4$s][%2$s] %5$s %6$s%n
            java.util.logging.ConsoleHandler.level=INFO java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter{code}
            I've also added the following JVM argument:
            {code:java}
            -Djava.util.logging.config.file=/var/lib/jenkins/logging.properties
            {code}
             

            Log format with 2.176:
            {noformat}
            [2019-06-06 15:10:07.881][INFO][jenkins.InitReactorRunner$1 onAttained] Completed initialization
            [2019-06-06 15:10:08.052][INFO][hudson.WebAppMain$3 run] Jenkins is fully up and running
            {noformat}
             

            Log format with 2.177:
            {noformat}
            2019-06-06 15:11:40.956+0000 [id=29] INFO jenkins.InitReactorRunner$1#onAttained: Completed initialization
            2019-06-06 15:11:41.136+0000 [id=20] INFO hudson.WebAppMain$3#run: Jenkins is fully up and running
            {noformat}
            fatmcgav Gavin Williams made changes -
            Description Upon upgrading from 2.176 to 2.177, it would appear that support for providing a custom log format has been broken, due to what looks like an undocumented [change|[https://github.com/jenkinsci/winstone/pull/63]] in the Winstone library. 

            Logging.properties file:
            {code:java}
            .level=ALL
            handlers=java.util.logging.ConsoleHandler

            java.util.logging.SimpleFormatter.format=[%1$tF %1$tT.%1$tL][%4$s][%2$s] %5$s %6$s%n
            java.util.logging.ConsoleHandler.level=INFO java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter{code}
            I've also added the following JVM argument:
            {code:java}
            -Djava.util.logging.config.file=/var/lib/jenkins/logging.properties
            {code}
             

            Log format with 2.176:
            {noformat}
            [2019-06-06 15:10:07.881][INFO][jenkins.InitReactorRunner$1 onAttained] Completed initialization
            [2019-06-06 15:10:08.052][INFO][hudson.WebAppMain$3 run] Jenkins is fully up and running
            {noformat}
             

            Log format with 2.177:
            {noformat}
            2019-06-06 15:11:40.956+0000 [id=29] INFO jenkins.InitReactorRunner$1#onAttained: Completed initialization
            2019-06-06 15:11:41.136+0000 [id=20] INFO hudson.WebAppMain$3#run: Jenkins is fully up and running
            {noformat}
            Upon upgrading from 2.176 to 2.177, it would appear that support for providing a custom log format has been broken, due to what looks like an undocumented change ([https://github.com/jenkinsci/winstone/pull/63]) in the Winstone library. 

            Logging.properties file:
            {code:java}
            .level=ALL
            handlers=java.util.logging.ConsoleHandler

            java.util.logging.SimpleFormatter.format=[%1$tF %1$tT.%1$tL][%4$s][%2$s] %5$s %6$s%n
            java.util.logging.ConsoleHandler.level=INFO java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter{code}
            I've also added the following JVM argument:
            {code:java}
            -Djava.util.logging.config.file=/var/lib/jenkins/logging.properties
            {code}
             

            Log format with 2.176:
            {noformat}
            [2019-06-06 15:10:07.881][INFO][jenkins.InitReactorRunner$1 onAttained] Completed initialization
            [2019-06-06 15:10:08.052][INFO][hudson.WebAppMain$3 run] Jenkins is fully up and running
            {noformat}
             

            Log format with 2.177:
            {noformat}
            2019-06-06 15:11:40.956+0000 [id=29] INFO jenkins.InitReactorRunner$1#onAttained: Completed initialization
            2019-06-06 15:11:41.136+0000 [id=20] INFO hudson.WebAppMain$3#run: Jenkins is fully up and running
            {noformat}
            danielbeck Daniel Beck made changes -
            Labels regression
            danielbeck Daniel Beck made changes -
            Component/s winstone-jetty [ 20645 ]

            Is there a workaround to be able to provide a ConsoleHandler formatter?

            If not, I'll be submitting a PR removing the overriding of it.

            It will still be possible to set the formatter from the command line or the logging.properties as usual.

            What do you think?

            l_r Louis-Rémi Paquet added a comment - Is there a workaround to be able to provide a ConsoleHandler formatter? If not, I'll be submitting a PR removing the overriding of it. It will still be possible to set the formatter from the command line or the logging.properties as usual. What do you think?
            jglick Jesse Glick added a comment -

            The new formatter is deliberate. There could be a Winstone option to select an alternate formatter if someone cares to write it, or perhaps just by disabling the new formatter when java.util.logging.config.file is defined.

            jglick Jesse Glick added a comment - The new formatter is deliberate. There could be a Winstone option to select an alternate formatter if someone cares to write it, or perhaps just by disabling the new formatter when java.util.logging.config.file is defined.

            Yes, that would be possible.

            I'm wondering, though, why the standard java behavior is overridden. It's not something one would expect.

            l_r Louis-Rémi Paquet added a comment - Yes, that would be possible. I'm wondering, though, why the standard java behavior is overridden. It's not something one would expect.
            l_r Louis-Rémi Paquet made changes -
            Assignee Louis-Rémi Paquet [ l_r ]
            jglick Jesse Glick made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            jglick Jesse Glick made changes -
            Status In Progress [ 3 ] In Review [ 10005 ]
            jglick Jesse Glick made changes -
            Remote Link This issue links to "winstone #87 (Web Link)" [ 24301 ]
            oleg_nenashev Oleg Nenashev made changes -
            oleg_nenashev Oleg Nenashev added a comment - https://github.com/jenkinsci/jenkins/pull/4452
            oleg_nenashev Oleg Nenashev added a comment -

            It was released in 2.218, thanks to l_r! I will mark it as LTS candidate, but it would require Winstone backporting due to the JENKINS-60857 regressions in 5.6. If olivergondza decides it is important enough, I will do such backporting. 

            oleg_nenashev Oleg Nenashev added a comment - It was released in 2.218, thanks to l_r ! I will mark it as LTS candidate, but it would require Winstone backporting due to the JENKINS-60857 regressions in 5.6. If olivergondza decides it is important enough, I will do such backporting. 
            oleg_nenashev Oleg Nenashev made changes -
            Released As Jenkins 2.218
            Resolution Fixed [ 1 ]
            Status In Review [ 10005 ] Resolved [ 5 ]
            oleg_nenashev Oleg Nenashev made changes -
            Labels regression lts-candidate regression
            olivergondza Oliver Gondža made changes -
            Labels lts-candidate regression 2.204.3-fixed regression
            olivergondza Oliver Gondža made changes -
            Labels 2.204.3-fixed regression 2.204.3-fixed 2.204.5-rejected lts-candidate regression

            This will be reverted in 2.204.5 as it has caused regressions much more impactfull.

            olivergondza Oliver Gondža added a comment - This will be reverted in 2.204.5 as it has caused regressions much more impactfull.
            jglick Jesse Glick added a comment -

            To be clear, it was not this fix which caused the regressions, but unrelated changes in winstone.

            jglick Jesse Glick added a comment - To be clear, it was not this fix which caused the regressions, but unrelated changes in winstone .
            olivergondza Oliver Gondža made changes -
            Labels 2.204.3-fixed 2.204.5-rejected lts-candidate regression 2.204.3-fixed 2.204.5-rejected 2.222.1-fixed regression
            oleg_nenashev Oleg Nenashev made changes -
            Labels 2.204.3-fixed 2.204.5-rejected 2.222.1-fixed regression 2.204.3-fixed 2.204.5-rejected 2.222.1-fixed non-trivial-lts-backporting regression
            oleg_nenashev Oleg Nenashev made changes -
            Link This issue causes JENKINS-60857 [ JENKINS-60857 ]

            People

              l_r Louis-Rémi Paquet
              fatmcgav Gavin Williams
              Votes:
              3 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: