Unable to enable file-based logging inside the Docker container for Keycloak Quarkus 19.0.3 #36129
pallavi0412
started this conversation in
Archive
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to set up file-based logging inside a Docker container for Keycloak Quarkus v19.0.3.
I have tried few approaches, including adding the following application.properties configuration for logging:-
//Enable file-based logging
quarkus.log.file.enable=true
// Specify the path to the log file inside the container
quarkus.log.file.path=/opt/keycloak/logs/keycloak.log
// Log file rotation configuration (optional)
quarkus.log.file.rotation.size=10M # Rotate logs when the size exceeds 10 MB
quarkus.log.file.rotation.max-files=5 # Keep up to 5 rotated log files
// Set the logging level for Keycloak
quarkus.log.category."org.keycloak".level=INFO
quarkus.log.category."org.keycloak.services".level=DEBUG
quarkus.log.category."org.keycloak.events".level=DEBUG
// Enable logging to the console (optional)
quarkus.log.console.enable=true
quarkus.log.console.level=INFO
// Optional: Structured logging in JSON format
quarkus.log.console.json=true
I also updated the Dockerfile to copy the application.properties file with the correct permissions -
FROM quay.io/keycloak/keycloak:19.0.3
// Create the logs directory (if not created already)
RUN mkdir -p /opt/keycloak/logs && chmod -R 777 /opt/keycloak/logs
WORKDIR /opt/keycloak
// Copy the application.properties file into the container
COPY ./resources/application.properties /opt/keycloak/conf/application.properties
However, I am still unable to generate logs in the file for Keycloak. Has anyone faced a similar issue or could someone help me with the proper steps to enable logging in this setup?
Beta Was this translation helpful? Give feedback.
All reactions