12 Replies Latest reply on Jul 10, 2012 7:44 PM by thebravedave

    Grails project on Jboss 7 Blocks logging

    thebravedave

      I have a grails project that I am attempting to get working correctly for my company. We had the project running smoothly on Jboss 4.2.3, but upgrading to Jboss 7 causes a problem. When I deploy the grails war with another ear project in the deployments folder of jboss 7, Jboss stops logging part way through the deploy. Both the grails war and the ear project deploy properly, but logging just doesn't work. Also even after deploy, when I run a webservice that is available from the ear project, the webservice method runs properly, but the logging I added to the webservice method doesn't show up in the logs. If I stop the server and remove the grails project and restart it and run the same webservice method all of the logging shows up, also all of the logging that was supposed to show up during deployment.

      I'm not seeing any errors in the logs involving class loader issues. Please someone throw me a bone!

      Sincerely,

      David

        • 1. Re: Grails project on Jboss 7 Blocks logging
          dmlloyd

          Can you post an outline of your deployment's structure (i.e. what JARs it contains, what descriptors are there, etc.)?

          • 2. Re: Grails project on Jboss 7 Blocks logging
            dmlloyd

            My hypothesis is that something in the Grails deployment is deliberately reconfiguring logging (i.e. turning it off).  We've got a per-deployment log isolation feature in upstream right now that would be quite suitable for this situation if I'm right.

            • 3. Re: Grails project on Jboss 7 Blocks logging
              thebravedave

              The Jboss version is 7.1.1.Final.

               

              In deployment folder:

              _____________________

               

              User-ear.ear

              --------------->api.war

              --------------->AreaVault.war

              --------------->UserServer-ejb.jar

               

              ServerConfig.war

              ----------------->*standard grails project makeup*

               

              __________________________

               

               

              I'm not sure what else you want to know about the deployment structure (just let me know and I will be happy to add information).

               

              I am doing a pretty standard logging setup in standalone.xml as such:

               

              <subsystem xmlns="urn:jboss:domain:logging:1.1">

                          <async-handler name="ASYNC_SESSION">

                              <queue-length value="1024"/>

                              <subhandlers>

                                  <handler name="sessionFileHandler"/>

                              </subhandlers>

                          </async-handler>

                          <async-handler name="ASYNC_HIBERNATE">

                              <queue-length value="1024"/>

                              <subhandlers>

                                  <handler name="hibernateFileHandler"/>

                              </subhandlers>

                          </async-handler>

                          <console-handler name="CONSOLE">

                              <level name="INFO"/>

                              <formatter>

                                  <pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/>

                              </formatter>

                          </console-handler>

                          <periodic-rotating-file-handler name="FILE">

                              <formatter>

                                  <pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/>

                              </formatter>

                              <file relative-to="jboss.server.log.dir" path="server.log"/>

                              <suffix value=".yyyy-MM-dd"/>

                              <append value="true"/>

                          </periodic-rotating-file-handler>

                          <periodic-rotating-file-handler name="hibernateFileHandler">

                              <formatter>

                                  <pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t)  %s%E%n"/>

                              </formatter>

                              <file relative-to="jboss.server.log.dir" path="hibernate.log"/>

                              <suffix value=".yyyy-MM-dd"/>

                              <append value="true"/>

                          </periodic-rotating-file-handler>

                          <periodic-rotating-file-handler name="sessionFileHandler">

                              <formatter>

                                  <pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t)  %s%E%n"/>

                              </formatter>

                              <file relative-to="jboss.server.log.dir" path="session.log"/>

                              <suffix value=".yyyy-MM-dd"/>

                              <append value="true"/>

                          </periodic-rotating-file-handler>

                          <logger category="sococo.session">

                              <level name="INFO"/>

                              <handlers>

                                  <handler name="ASYNC_SESSION"/>

                              </handlers>

                          </logger>

                          <logger category="org.hibernate">

                              <level name="WARN"/>

                              <handlers>

                                  <handler name="ASYNC_HIBERNATE"/>

                              </handlers>

                          </logger>

                          <logger category="org.hibernate.jdbc.ConnectionManager">

                              <level name="WARN"/>

                              <handlers>

                                  <handler name="ASYNC_HIBERNATE"/>

                              </handlers>

                          </logger>

                          <logger category="com.arjuna">

                              <level name="WARN"/>

                          </logger>

                          <logger category="org.apache.tomcat.util.modeler">

                              <level name="WARN"/>

                          </logger>

                          <logger category="sun.rmi">

                              <level name="WARN"/>

                          </logger>

                          <logger category="jacorb">

                              <level name="WARN"/>

                          </logger>

                          <logger category="jacorb.config">

                              <level name="ERROR"/>

                          </logger>

                          <root-logger>

                              <level name="INFO"/>

                              <handlers>

                                  <handler name="CONSOLE"/>

                                  <handler name="FILE"/>

                              </handlers>

                          </root-logger>

                      </subsystem>

               

              __________________________________________

               

              Once again all the logging works if I don't have ServerConfig.war added in the deployment folder.

              If anyone can help, please do. Also if you need more information, just let me know.

               

              Thank you for your help.

              • 4. Re: Grails project on Jboss 7 Blocks logging
                thebravedave

                Hello, you said " We've got a per-deployment log isolation feature in upstream right now that would be quite suitable for this situation if I'm right."

                What exactly does this mean? Does this mean that you have this feature available in an upcoming release? If so, which release is it, and when can we expect it to be out?

                If you mean something else, can you please explain?

                Thanks,

                 

                David

                • 5. Re: Grails project on Jboss 7 Blocks logging
                  dmlloyd

                  David Pugh wrote:

                   

                  Hello, you said " We've got a per-deployment log isolation feature in upstream right now that would be quite suitable for this situation if I'm right."

                  What exactly does this mean? Does this mean that you have this feature available in an upcoming release? If so, which release is it, and when can we expect it to be out?

                  If you mean something else, can you please explain?

                  Thanks,

                   

                  David

                  It'll be in 7.2.0 for sure.  I don't know if we have another 7.1.x coming up.

                   

                  Basically what it means is that you can tell the container that your deployment's log configuration should be separate.  So if your JAR tries to wipe out the container logging config, as it appears it is, then it won't have any affect on the rest of the container.

                  • 6. Re: Grails project on Jboss 7 Blocks logging
                    1977

                    Hi , I also have this issue

                     

                    so what is the solution for this in the meantime ? i.e. until 7.2.0 comes out

                     

                    thanks

                    • 7. Re: Grails project on Jboss 7 Blocks logging
                      dmlloyd

                      You should be able to build and use the 7.1.2 tag.

                      • 8. Re: Grails project on Jboss 7 Blocks logging
                        1977

                        thanks can you point me to a resource that shows me how to configure this feature ?

                        • 9. Re: Grails project on Jboss 7 Blocks logging
                          1977

                          thanks can you point me to a resource that shows me how to configure this feature ?

                           

                          im looking at the docs and obnly see a section about ears containing multiple wars. My situation is that I have 2 separate wars in their own right

                          • 10. Re: Grails project on Jboss 7 Blocks logging
                            dmlloyd

                            All you should need to do is add a logging.properties file into your deployment META-INF area.  It doesn't even need to contain anything - especially if my hypothesis is right (i.e., something in the deployment is wiping out the logging configuration).

                            • 11. Re: Grails project on Jboss 7 Blocks logging
                              1977

                              i tried adding logging.properties of META-INF of the grails app and it still did not help. The grails app can write to the log, but the other app cannot write to it

                              • 12. Re: Grails project on Jboss 7 Blocks logging
                                thebravedave

                                I also added a logging.properties file to META-INF in my grails app and it is also not helping. Logging is still cut off. As soon as grails starts to deploy all logging stops.