Skip to content

Add parameter activemq_logger_filepath to configure logfile path #187

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions roles/activemq/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,7 @@ See _Role Variables_ below for additional TLS/SSL settings.
|`activemq_logger_audit_rollover_files`| Number of rollover audit log files | `5` | `'log4j2.properties' if activemq_version is version_compare('2.27.0', '>=') else 'logging.properties'` |
|`activemq_logger_config_template_path` | Optional subdirectory of any playbook template lookup directories for the logging facility configuration | `''` |
|`activemq_logger_config_keep_name` | Whether to keep the custom template filename or use the default | `False` |
|`activemq_logger_filepath` | Path for main logfile relative to instance directory | `/log/artemis.log` |


#### Broker plugins
Expand Down
1 change: 1 addition & 0 deletions roles/activemq/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ activemq_logger_config_template_path: ''
activemq_logger_config_keep_name: false
activemq_logger_rollover_files: 5
activemq_logger_audit_rollover_files: 5
activemq_logger_filepath: /log/artemis.log

# Metrics
activemq_jmx_exporter_port: 18080
Expand Down
4 changes: 4 additions & 0 deletions roles/activemq/meta/argument_specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -813,6 +813,10 @@ argument_specs:
description: "Whether or not to enable clustering (cluster-connections)"
default: "{{ activemq_ha_enabled }}"
type: 'bool'
activemq_logger_filepath:
description: "Path for main logfile relative to instance directory."
default: "/log/artemis.log"
type: 'str'
systemd:
options:
activemq_version:
Expand Down
6 changes: 3 additions & 3 deletions roles/activemq/templates/log4j2.properties.j2
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ appender.console.layout.pattern=%d %-5level [%logger] %msg%n
# Log file appender
appender.log_file.type = RollingFile
appender.log_file.name = log_file
appender.log_file.fileName = ${sys:artemis.instance}/log/artemis.log
appender.log_file.filePattern = ${sys:artemis.instance}/log/artemis.log.%d{yyyy-MM-dd}
appender.log_file.fileName = ${sys:artemis.instance}{{ activemq_logger_filepath }}
appender.log_file.filePattern = ${sys:artemis.instance}{{ activemq_logger_filepath }}.%d{yyyy-MM-dd}
appender.log_file.layout.type = PatternLayout
appender.log_file.layout.pattern = %d %-5level [%logger] %msg%n
appender.log_file.policies.type = Policies
Expand All @@ -100,4 +100,4 @@ appender.audit_log_file.policies.cron.type = CronTriggeringPolicy
appender.audit_log_file.policies.cron.schedule = 0 0 0 * * ?
appender.audit_log_file.policies.cron.evaluateOnStartup = true
appender.audit_log_file.strategy.type=DefaultRolloverStrategy
appender.audit_log_file.strategy.max={{ activemq_logger_audit_rollover_files }}
appender.audit_log_file.strategy.max={{ activemq_logger_audit_rollover_files }}
2 changes: 1 addition & 1 deletion roles/activemq/templates/logging.properties.j2
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ handler.FILE.properties=suffix,append,autoFlush,fileName
handler.FILE.suffix=.yyyy-MM-dd
handler.FILE.append=true
handler.FILE.autoFlush=true
handler.FILE.fileName=${artemis.instance}/log/artemis.log
handler.FILE.fileName=${artemis.instance}{{ activemq_logger_filepath }}
handler.FILE.formatter=PATTERN

# Formatter pattern configuration
Expand Down