0

I have a Tomcat 9.0.54 installation that I am using along with Apache Guacamole. My default catalina.out log file format includes only a time and not a date. It looks like this:

04:37:05.132 [http-nio-8080-exec-12] INFO  o.a.g.tunnel.TunnelRequestService - User "abc" connected to connection "16".'

I have read online that the right way to update the log format would be to add to conf/logging.properties this line:

org.apache.juli.OneLineFormatter.timeFormat = yyyy-MM-dd HH:mm:ss,SSSZ

... after these existing 3 lines in logging.properties:

java.util.logging.ConsoleHandler.level = FINE
java.util.logging.ConsoleHandler.formatter = org.apache.juli.OneLineFormatter
java.util.logging.ConsoleHandler.encoding = UTF-8

I did this, and my log format continues to be without date after restarting.

My catalina.out does show that the proper logging.properties file is being read on startup. I see no errors.

My Tomcat installation has very little changes from the default. For example, my catalina.properties only adds:

guacamole.home=/local/guacamole

What am I missing!?

Jason K
  • 33
  • 4
  • 1
    `catalina.out` contains the standard output of the Tomcat server, hence many different logging frameworks write to it. Guacamole uses LogBack (cf. [documentation](https://guacamole.apache.org/doc/0.9.6/gug/configuring-guacamole.html#idm140499500759248)), so modifying `logging.properties` will have no effect. – Piotr P. Karwasz Oct 21 '21 at 17:46

1 Answers1

1

Piotr, thank you - you were absolutely right - for anyone who is interested, I added to my guacamole home dir a logback.xml file containing something similar to their default, but with the addition of the date...

<configuration>

    <!-- Default appender -->
    <appender name="GUAC-DEFAULT" class="ch.qos.logback.core.ConsoleAppender">
        <encoder>
            <pattern>%date{yyyy-MM-dd HH:mm:ss.SSSZ} [%thread] %-5level %logger{36} - %msg%n</pattern>
        </encoder>
    </appender>

    <!-- Log at INFO level -->
    <root level="info">
        <appender-ref ref="GUAC-DEFAULT" />
    </root>

</configuration>

Jason K
  • 33
  • 4