Install quarkus.properties to add log rotation.

This commit is contained in:
Andrea Dell'Amico 2022-09-30 11:40:40 +02:00
parent e1533cf16d
commit 2507a9c816
Signed by untrusted user: adellam
GPG Key ID: 147ABE6CEB9E20FF
3 changed files with 24 additions and 3 deletions

View File

@ -15,6 +15,10 @@ keycloak_log_directory: '/var/log/keycloak'
keycloak_service_name: keycloak
keycloak_optimize_build_at_startup: true
keycloak_upgrade_db_at_startup: false
keycloak_configuration_files:
- keycloak.conf
- cache-ispn.xml
- quarkus.properties
keycloak_disabled_features: []
keycloak_preview_features: []
keycloak_remote_providers: []
@ -41,12 +45,16 @@ keycloak_https_port: 8443
keycloak_set_hostname: false
keycloak_hostname: '{{ ansible_fqdn }}'
# console, file, gelf
keycloak_log_handlers: console
keycloak_log_console_format: '%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p [%c] (%t) %s%e%n'
keycloak_log_console_output: default
keycloak_log_file: '{{ keycloak_log_directory }}/keycloak.log'
keycloak_log_file_format: '%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p [%c] (%t) %s%e%n'
keycloak_log_level: warning
keycloak_log_backup_index: 10
keycloak_log_max_size: '10M'
keycloak_log_rotate_on_boot: 'true'
# We keep those together because some health checks are available only when the metrics are enabled.
keycloak_metrics_and_health_checks_enabled: 'true'

View File

@ -7,9 +7,7 @@
dest: '{{ keycloak_conf_directory }}/{{ item }}'
owner: root
group: root
loop:
- keycloak.conf
- cache-ispn.xml
loop: '{{ keycloak_configuration_files }}'
notify: Restart Keycloak
tags: [ 'keycloak', 'keycloak_db', 'keycloak_conf' ]

View File

@ -0,0 +1,15 @@
quarkus.log.file.rotation.max-file-size={{ keycloak_log_max_size }}
quarkus.log.file.rotation.max-backup-index={{ keycloak_log_backup_index }}
quarkus.log.file.rotation.file-suffix=.yyyy-MM-dd
quarkus.log.file.rotation.rotate-on-boot={{ keycloak_log_rotate_on_boot }}
# Access log
quarkus.http.access-log.enabled=true
quarkus.http.access-log.log-to-file=true
quarkus.http.access-log.base-file-name=access.
quarkus.http.access-log.log-suffix=log
quarkus.http.access-log.log-directory={{ keycloak_log_directory }}/log
quarkus.http.access-log.rotate=true
quarkus.http.access-log.rotation.max-file-size={{ keycloak_log_max_size }}
quarkus.http.access-log.rotation.max-backup-index={{ keycloak_log_backup_index }}
quarkus.http.access-log.pattern=%t [%{i,X-Forwarded-For}, %h] %l (user:%u) - '%r' => %s (%b bytes) '%{i,User-Agent}' (Referer: '%{i,Referer}') - [%I, %Dms]
quarkus.http.record-request-start-time=true