<p>I'm just trying to set the log level of Guacamole to DEBUG.. I've successfully set the logging level for <code>guacd</code> and tried multiple environment variables for the guacamole container but it's still not working.. I've found a <code>logging.properties</code> file in the Guacamole container at path: <code>/home/guacamole/tomcat/conf/logging.properties</code>. Is it possible to configure the logging file path so I can add a custom <code>logging.properties</code> file?</p>
<p>The current state of the <code>deployment.yml</code> file looks like this:</p>
<pre class="lang-yaml prettyprint-override"><code># apiVersion: v1
# kind: ConfigMap
# metadata:
#   name: logback
#   namespace: $NAMESPACE
# data:
#   logback.xml: |
#     &lt;configuration&gt;
#
#     &lt;!-- Appender for debugging --&gt;
#     &lt;appender name=&quot;GUAC-DEBUG&quot; class=&quot;ch.qos.logback.core.ConsoleAppender&quot;&gt;
#         &lt;encoder&gt;
#             &lt;pattern&gt;%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n&lt;/pattern&gt;
#         &lt;/encoder&gt;
#     &lt;/appender&gt;
#
#     &lt;appender name=&quot;GUAC-DEBUG-2&quot; class=&quot;org.apache.juli.ClassLoaderLogManager&quot;&gt;
#         &lt;encoder&gt;
#             &lt;pattern&gt;%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n&lt;/pattern&gt;
#         &lt;/encoder&gt;
#     &lt;/appender&gt;
#
#     &lt;!-- Log at DEBUG level --&gt;
#     &lt;root level=&quot;debug&quot;&gt;
#         &lt;appender-ref ref=&quot;GUAC-DEBUG&quot;/&gt;
#     &lt;/root&gt;
#
#     &lt;root level=&quot;debug&quot;&gt;
#         &lt;appender-ref ref=&quot;GUAC-DEBUG-2&quot;/&gt;
#     &lt;/root&gt;
#
#     &lt;/configuration&gt;

apiVersion: v1
kind: ConfigMap
metadata:
  name: logging
  namespace: $NAMESPACE
data:
  logging.properties: |
    handlers = 1catalina.org.apache.juli.AsyncFileHandler, 2localhost.org.apache.juli.AsyncFileHandler, 3manager.org.apache.juli.AsyncFileHandler, 4host-manager.org.apache.juli.AsyncFileHandler, java.util.logging.ConsoleHandler

    .handlers = 1catalina.org.apache.juli.AsyncFileHandler, java.util.logging.ConsoleHandler

    ############################################################
    # Handler specific properties.
    # Describes specific configuration info for Handlers.
    ############################################################

    1catalina.org.apache.juli.AsyncFileHandler.level = FINE
    1catalina.org.apache.juli.AsyncFileHandler.directory = ${catalina.base}/logs
    1catalina.org.apache.juli.AsyncFileHandler.prefix = catalina.
    1catalina.org.apache.juli.AsyncFileHandler.encoding = UTF-8

    2localhost.org.apache.juli.AsyncFileHandler.level = FINE
    2localhost.org.apache.juli.AsyncFileHandler.directory = ${catalina.base}/logs
    2localhost.org.apache.juli.AsyncFileHandler.prefix = localhost.
    2localhost.org.apache.juli.AsyncFileHandler.encoding = UTF-8

    3manager.org.apache.juli.AsyncFileHandler.level = FINE
    3manager.org.apache.juli.AsyncFileHandler.directory = ${catalina.base}/logs
    3manager.org.apache.juli.AsyncFileHandler.prefix = manager.
    3manager.org.apache.juli.AsyncFileHandler.encoding = UTF-8

    4host-manager.org.apache.juli.AsyncFileHandler.level = FINE
    4host-manager.org.apache.juli.AsyncFileHandler.directory = ${catalina.base}/logs
    4host-manager.org.apache.juli.AsyncFileHandler.prefix = host-manager.
    4host-manager.org.apache.juli.AsyncFileHandler.encoding = UTF-8

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


    ############################################################
    # Facility specific properties.
    # Provides extra control for each logger.
    ############################################################

    org.apache.catalina.core.ContainerBase.[Catalina].[localhost].level = FINE
    org.apache.catalina.core.ContainerBase.[Catalina].[localhost].handlers = 2localhost.org.apache.juli.AsyncFileHandler

    org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].level = FINE
    org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].handlers = 3manager.org.apache.juli.AsyncFileHandler

    org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager].level = FINE
    org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager].handlers = 4host-manager.org.apache.juli.AsyncFileHandler

    # For example, set the org.apache.catalina.util.LifecycleBase logger to log
    # each component that extends LifecycleBase changing state:
    #org.apache.catalina.util.LifecycleBase.level = FINE

    # To see debug messages in TldLocationsCache, uncomment the following line:
    #org.apache.jasper.compiler.TldLocationsCache.level = FINE

    # To see debug messages for HTTP/2 handling, uncomment the following line:
    #org.apache.coyote.http2.level = FINE

    # To see debug messages for WebSocket handling, uncomment the following line:
    #org.apache.tomcat.websocket.level = FINE
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: guacamole
  namespace: $NAMESPACE
  labels:
    app: guacamole
spec:
  replicas: 1
  selector:
    matchLabels:
      app: guacamole
  template:
    metadata:
      labels:
        app: guacamole
    spec:
      containers:
      - name: guacd
        image: docker.io/guacamole/guacd:$GUACAMOLE_GUACD_VERSION
        env:
        - name: GUACD_LOG_LEVEL
          value: &quot;debug&quot;
        ports:
        - containerPort: 4822
        securityContext:
          runAsUser: 1000
          runAsGroup: 1000
          allowPrivilegeEscalation: false
          readOnlyRootFilesystem: true
      - name: guacamole
        image: docker.io/guacamole/guacamole:$GUACAMOLE_GUACAMOLE_VERSION
        env:
        - name: GUACD_HOSTNAME
          value: &quot;localhost&quot;
        - name: GUACD_PORT
          value: &quot;4822&quot;
        - name: POSTGRES_HOSTNAME
          value: &quot;database-url.nl&quot;
        - name: POSTGRES_PORT
          value: &quot;5432&quot;
        - name: POSTGRES_DATABASE
          value: &quot;guacamole&quot;
        - name: POSTGRES_USER
          value: &quot;guacamole_admin&quot;
        - name: POSTGRES_PASSWORD
          value: &quot;guacamoleadmin&quot;
        - name: HOME
          value: &quot;/home/guacamole&quot;
        - name: GUACAMOLE_LOG_LEVEL
          value: &quot;debug&quot;
        - name: JAVA_TOOL_OPTIONS
          value: &quot;-Djava.util.logging.config.file=/home/guacamole/logging.properties&quot;
        ports:
        - name: http
          containerPort: 8080
        - name: https
          containerPort: 8443
        volumeMounts:
          # - name: logback
          #   mountPath: /home/guacamole/logback.xml
          #   subPath: logback.xml
          - name: logging
            mountPath: /home/guacamole/logging.properties
            subPath: logging.properties
        securityContext:
          runAsUser: 1001
          runAsGroup: 1001
          allowPrivilegeEscalation: false
          runAsNonRoot: true
      volumes:
        # - name: logback
        #   configMap:
        #     name: logback
        - name: logging
          configMap:
            name: logging
</code></pre>
<p>UPDATE 1:
According to <a href="https://guacamole.apache.org/doc/0.9.6/gug/configuring-guacamole.html" rel="nofollow noreferrer">this page</a> it's possible to add custom logging configuration by adding the <code>logback.xml</code> file in the GUACAMOLE HOME folder, but this didn't fixed it. I've added this <code>logback.xml</code> file via a ConfigMap</p>
<p>UPDATE 2:
I can see in the logging of the Guacamole container it adds the following Java Option: <code>-Djava.util.logging.config.file=/home/guacamole/tomcat/conf/logging.properties</code>. So I added the following environment variable to edit this config path and added my own <code>logging.properties</code> file via a ConfigMap:</p>
<pre class="lang-yaml prettyprint-override"><code>- name: JAVA_TOOL_OPTIONS
  value: &quot;-Djava.util.logging.config.file=/home/guacamole/logging.properties&quot;
</code></pre>
<p>I've updated the <code>deployment.yml</code> file so you can see the current state of the file.. According to the logging it updates the argument correctly, but one line later it overwrites the same argument with the old path..</p>
<p>Anybody ideas? :')</p>

<p>I got in contact <a href="https://issues.apache.org/jira/browse/GUACAMOLE-1646" rel="nofollow noreferrer">with Guacamole support</a>.</p>
<p>For the people they're experiencing the same issue because the people from Guacamole didn't documented this yet, you can use the environment variable <code>LOGBACK_LEVEL</code>.</p>
