Uploaded image for project: 'JBoss Web Server'
  1. JBoss Web Server
  2. JWS-1364

JBoss Web Server container image logging to file instead of stdout

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Critical Critical
    • 5.3.0.CR1
    • 5.0.2.GA, 5.1.0.GA
    • cloud, jws-on-openshift
    • None
    • 16
    • User Experience
    • ?
    • Hide

      There are some ways to get all the log traces to the "logs tab":

      • Add one additional step into your docker build strategy to replace the logging.properties from $JWS_HOME/conf with the one attached.

      or

      • Add the attached logging.properties file into a directory that you want and reference it via the LOGGING_CONFIG environment variable into your Deployment Configuration, like:

      ~~~
      LOGGING_CONFIG="-Djava.util.logging.config.file=/<custom directory>/logging.properties"
      ~~~

      or

      • Add one additional step into your docker build strategy to remove the logging.properties from $JWS_HOME/conf to be able to use $JAVA_HOME/jre/lib/logging.properties as default.
        Note: this will change a bit the logging format as before, because the logging.properties from the jdk uses a different formatter than juli.

      or

      • Set the LOGGING_CONFIG environment variable into your Deployment Configuration to use the jdk properties, like:

      ~~~
      LOGGING_CONFIG="-Djava.util.logging.config.file=$JAVA_HOME/jre/lib/logging.properties"
      ~~~
      Note: this also will change a bit the logging format as before, because the logging.properties from the jdk uses a different formatter than juli.

      There are more options, like defining a LOGGING_MANAGER with empty -Djava.util.logging.manager to generate an exception loading the juli handlers (or setting it to java.util.logging.ConsoleHandler and provide other properties file) but you will see errors on stacktrace, this way is not recommended.

      Finally, note for the envvar use cases, you can also set the envvars to the dockerfile instead on deployment config, if you want.

      Show
      There are some ways to get all the log traces to the "logs tab": Add one additional step into your docker build strategy to replace the logging.properties from $JWS_HOME/conf with the one attached. or Add the attached logging.properties file into a directory that you want and reference it via the LOGGING_CONFIG environment variable into your Deployment Configuration, like: ~~~ LOGGING_CONFIG="-Djava.util.logging.config.file=/<custom directory>/logging.properties" ~~~ or Add one additional step into your docker build strategy to remove the logging.properties from $JWS_HOME/conf to be able to use $JAVA_HOME/jre/lib/logging.properties as default. Note: this will change a bit the logging format as before, because the logging.properties from the jdk uses a different formatter than juli. or Set the LOGGING_CONFIG environment variable into your Deployment Configuration to use the jdk properties, like: ~~~ LOGGING_CONFIG="-Djava.util.logging.config.file=$JAVA_HOME/jre/lib/logging.properties" ~~~ Note: this also will change a bit the logging format as before, because the logging.properties from the jdk uses a different formatter than juli. There are more options, like defining a LOGGING_MANAGER with empty -Djava.util.logging.manager to generate an exception loading the juli handlers (or setting it to java.util.logging.ConsoleHandler and provide other properties file) but you will see errors on stacktrace, this way is not recommended. Finally, note for the envvar use cases, you can also set the envvars to the dockerfile instead on deployment config, if you want.
    • Show
      https://github.com/sellersj/tomcat-logging-test

      Hi. This is a support ticket we received from a customer running the latest official JWS5 image on OpenShift 3.11.

      If an app throws an exception that goes up to the container, tomcat is not configured to write to std out / std err. In OpenShift it looks like there was no exception if you look at the "logs" tab.

      If you terminal into the container, the logs are being written to /opt/jws-5.0/tomcat/logs

      I expected all logging configured in tomcat would go to the logs tab.

      Where are you experiencing the behavior? What environment?

      Docker container: jboss-webserver-5/webserver50-tomcat9-openshift
      Version: 1.2-6 / latest
      Openshift 3.11

      When does the behavior occur? Frequently? Repeatedly? At certain times?

      1) If an app throws an exception
      2) if a servlet extends javax.servlet.GenericServlet and uses the built in log method.

      I have pasted the suggestions from support into the "Workaround" part of the ticket. The workarounds do get logging going to console as required, but the expectation is that container images from Red Hat would log to console by default.

      The customer also included a sample git repo to reproduce the issue. I've added to to "steps to reproduce".

      I also sent an email to the internal JWS mailing list, they suggested this is likely a bug and I should create a ticket here.

      Thanks for your help.

            szappis@redhat.com Sokratis Zappis
            rhn-support-apitt Andrew Pitt
            Matus Madzin Matus Madzin
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: