Grails
  1. Grails
  2. GRAILS-8015

Logging configuration for Grails artifacts (debug 'grails.app.bootstrap') is not working on 2.0.0

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 2.0-M2
    • Fix Version/s: 2.0-RC2
    • Component/s: Commons
    • Labels:
      None

      Description

      Hi.

      // Config.groovy
      log4j = {
          // (...)
          debug  'grails.app.bootstrap'
      }
      
      // BootStrap.groovy
          def init = { servletContext ->
              println 'abc'
              log.debug 'xyz'
          }
      

      don't work on Grails 2.0.0. There are test projects attached.

      Thanks.

      1. log-137.tar.bz2
        145 kB
        Daniel Henrique Alves Lima
      2. log-200.tar.bz2
        95 kB
        Daniel Henrique Alves Lima

        Issue Links

          Activity

          Show
          Daniel Henrique Alves Lima added a comment - http://grails.1312388.n4.nabble.com/2-0-0M2-vs-1-3-7-Debug-enabled-for-grails-app-bootstrap-td3805301.html
          Hide
          Burt Beckwith added a comment -

          It's grails.app.conf.BootStrap in 2.0 - some of the other logger names changed too. We can update the docs, but I'm not sure why this changed - it seems like a very unneccesary breaking change.

          Note - when logging isn't working try adding

          println log.name
          

          to see what the logger name/category is.

          Show
          Burt Beckwith added a comment - It's grails.app.conf.BootStrap in 2.0 - some of the other logger names changed too. We can update the docs, but I'm not sure why this changed - it seems like a very unneccesary breaking change. Note - when logging isn't working try adding println log.name to see what the logger name/category is.
          Hide
          Daniel Henrique Alves Lima added a comment -

          Thanks, Burt.

          Have you tried debug for grails.app only? I'm seeing some messages of the resource plugin, I think...

          Show
          Daniel Henrique Alves Lima added a comment - Thanks, Burt. Have you tried debug for grails.app only? I'm seeing some messages of the resource plugin, I think...
          Hide
          Damir Murat added a comment -

          I believe this one should be reopened since logging in bootstrap doesn't work as specified in reference docs. I tried with grails.app, grails.app.conf and grails.app.conf.BootStrap without success.

          Following Burt's suggestion, println log.name revealed that log name is only BootStrap, without any prefix. With this log name, logging started to work as expected.

          Show
          Damir Murat added a comment - I believe this one should be reopened since logging in bootstrap doesn't work as specified in reference docs. I tried with grails.app , grails.app.conf and grails.app.conf.BootStrap without success. Following Burt's suggestion, println log.name revealed that log name is only BootStrap , without any prefix. With this log name, logging started to work as expected.
          Hide
          Peter Ledbrook added a comment -

          Need to investigate the current logger names and update docs appropriately.

          Show
          Peter Ledbrook added a comment - Need to investigate the current logger names and update docs appropriately.
          Hide
          Dave Oxtoby added a comment -

          debug 'grails.app' does not log anything either

          Show
          Dave Oxtoby added a comment - debug 'grails.app' does not log anything either
          Hide
          Graeme Rocher added a comment -

          This was a Windows only bug. Grails was not handling Windows paths correctly when compiling in the logger names leading to a logger name of "BootStrap" instead of "grails.app.conf.BootStrap".

          Other than that the documentation is correct and the correct logger name to use is "grails.app.conf.BootStrap" for bootstrap from 2.0 onwards.

          Show
          Graeme Rocher added a comment - This was a Windows only bug. Grails was not handling Windows paths correctly when compiling in the logger names leading to a logger name of "BootStrap" instead of "grails.app.conf.BootStrap". Other than that the documentation is correct and the correct logger name to use is "grails.app.conf.BootStrap" for bootstrap from 2.0 onwards.

            People

            • Assignee:
              Graeme Rocher
              Reporter:
              Daniel Henrique Alves Lima
            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development