3 Replies Latest reply on Jun 14, 2013 12:18 PM by James Perkins

    Location of log files

    John Carver Newbie

      Ported a web app from another JEee appserver to JBoss Enterprise Application Platform 6.1.0.GA. I am running an out-of-the-box standlone server.

      Servlets and Jsp use System.out.println and System.err.println for logging. None of these log statements seem to show up in the server.log or console.log as i expected.

      I realize i should be using a logging system, but where are these logs vanishing to?

      I have the following in a jsp deplayed in a war file, where do these go?

       

      <%

          System.out.println("TEST TO STDOUT");

          System.err.println("TEST TO STDERR");

      %>

       

      logging.properties

      loggers=com.arjuna,jacorb,org.jboss.as.config,org.apache.tomcat.util.modeler,sun.rmi,jacorb.config

       

      logger.level=INFO

      logger.handlers=CONSOLE,FILE

       

      logger.com.arjuna.level=WARN

      logger.com.arjuna.useParentHandlers=true

       

      logger.jacorb.level=WARN

      logger.jacorb.useParentHandlers=true

       

      logger.org.jboss.as.config.level=DEBUG

      logger.org.jboss.as.config.useParentHandlers=true

       

      logger.org.apache.tomcat.util.modeler.level=WARN

      logger.org.apache.tomcat.util.modeler.useParentHandlers=true

       

      logger.sun.rmi.level=WARN

      logger.sun.rmi.useParentHandlers=true

       

      logger.jacorb.config.level=ERROR

      logger.jacorb.config.useParentHandlers=true

       

      handler.CONSOLE=org.jboss.logmanager.handlers.ConsoleHandler

      handler.CONSOLE.level=INFO

      handler.CONSOLE.formatter=CONSOLE

      handler.CONSOLE.properties=autoFlush,target,enabled

      handler.CONSOLE.autoFlush=true

      handler.CONSOLE.target=SYSTEM_OUT

      handler.CONSOLE.enabled=true

       

      handler.FILE=org.jboss.logmanager.handlers.PeriodicRotatingFileHandler

      handler.FILE.level=ALL

      handler.FILE.formatter=FILE

      handler.FILE.properties=autoFlush,append,fileName,suffix,enabled

      handler.FILE.constructorProperties=fileName,append

      handler.FILE.autoFlush=true

      handler.FILE.append=true

      handler.FILE.fileName=/home/jboss/jboss-eap-6.1/standalone/log/server.log

      handler.FILE.suffix=.yyyy-MM-dd

      handler.FILE.enabled=true

       

      formatter.CONSOLE=org.jboss.logmanager.formatters.PatternFormatter

      formatter.CONSOLE.properties=pattern

      formatter.CONSOLE.pattern=%K{level}%d{HH\:mm\:ss,SSS} %-5p [%c] (%t) %s%E%n

       

      formatter.FILE=org.jboss.logmanager.formatters.PatternFormatter

      formatter.FILE.properties=pattern

      formatter.FILE.constructorProperties=pattern

      formatter.FILE.pattern=%d{HH\:mm\:ss,SSS} %-5p [%c] (%t) %s%E%n

       

       

      standlone.xml

       

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

            <console-handler name="CONSOLE">

                     <level name="INFO"/>

                      <formatter>

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

                      </formatter>

             </console-handler>

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

                      <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>

             <logger category="com.arjuna">

                      <level name="WARN"/>

              </logger>

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

                      <level name="WARN"/>

              </logger>

                  <logger category="org.jboss.as.config">

                      <level name="DEBUG"/>

              </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>

        • 1. Re: Location of log files
          James Perkins Master

          They should be going to both the console out and the server.log. They should have a category of stdout and stderr looking something like:

          09:00:28,245 WARN  [stdout] (Controller Boot Thread) TEST TO STDOUT
          09:00:28,245 WARN  [stderr] (Controller Boot Thread) TEST TO STDERR
          

           

          --

          James R. Perkins

          1 of 1 people found this helpful
          • 2. Re: Location of log files
            John Carver Newbie

            James Perkins wrote:

             

            They should be going to both the console out and the server.log. They should have a category of stdout and stderr looking something like:

            09:00:28,245 WARN  [stdout] (Controller Boot Thread) TEST TO STDOUT
            09:00:28,245 WARN  [stderr] (Controller Boot Thread) TEST TO STDERR
            

            Thats where i expected them to be and didnt find it. Decided to rewrite logging using log4j and set that up. log4j works just fine. Now that i have set that up, the System.err lines are showing up in the server.log! I have no idea what caused this, but i am good for now. Thanks for your help.

            • 3. Re: Location of log files
              James Perkins Master

              Seems odd. I've done loads of testing with System.xxx.println and it's always worked for me. Oh well, at least you got it sorted.

               

              --

              James R. Perkins