Skip to content
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

feat(log4j): (optional) disable DailyRollingFileAppender #447

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 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
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,10 @@ The maximum number of threads used by Rundeck for concurrent jobs by default is

The log4j logging level to be set for the Rundeck application.

##### `rd_log4j_rotatedaily`

Enable log4j daily logrotation. Log files are rotated daily and saved as xxx.log.yyyy-MM-dd.

##### `rdeck_profile_template` (**Requires Rundeck v2.8.x**)

Allows you to use your own profile template instead of the default from the package maintainer
Expand Down
1 change: 1 addition & 0 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
$quartz_job_threadcount = $rundeck::quartz_job_threadcount
$rd_loglevel = $rundeck::rd_loglevel
$rd_auditlevel = $rundeck::rd_auditlevel
$rd_log4j_rotatedaily = $rundeck::rd_log4j_rotatedaily
$rdeck_config_template = $rundeck::rdeck_config_template
$rdeck_home = $rundeck::rdeck_home
$manage_home = $rundeck::manage_home
Expand Down
4 changes: 4 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@
#
# [*rd_loglevel*]
# The log4j logging level to be set for the Rundeck application.
#
# [*rd_log4j_rotatedaily*]
# Enable log4j daily logrotation. Log files are rotated daily and saved as xxx.log.yyyy-MM-dd.
#
# [*rd_auditlevel*]
# The log4j logging level to be set for the Rundeck application.
Expand Down Expand Up @@ -248,6 +251,7 @@
Integer $quartz_job_threadcount = $rundeck::params::quartz_job_threadcount,
Rundeck::Loglevel $rd_loglevel = $rundeck::params::loglevel,
Rundeck::Loglevel $rd_auditlevel = $rundeck::params::loglevel,
Boolean $rd_log4j_rotatedaily = $rundeck::params::rd_log4j_rotatedaily,
zebraartefakt marked this conversation as resolved.
Show resolved Hide resolved
String $rdeck_config_template = $rundeck::params::rdeck_config_template,
Stdlib::Absolutepath $rdeck_home = $rundeck::params::rdeck_home,
Boolean $manage_home = $rundeck::params::manage_home,
Expand Down
1 change: 1 addition & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@
$file_default_mode = '0640'

$loglevel = 'INFO'
$rd_log4j_rotatedaily = true
zebraartefakt marked this conversation as resolved.
Show resolved Hide resolved
$rss_enabled = false

$clustermode_enabled = false
Expand Down
18 changes: 16 additions & 2 deletions templates/log4j.properties.erb
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,11 @@ log4j.appender.stdout.layout.ConversionPattern=%-5p %c{1}: %m%n
#
# Output of the RunDeck command line utilities
#
<% if @rd_log4j_rotatedaily -%>
log4j.appender.cmd-logger=org.apache.log4j.DailyRollingFileAppender
log4j.appender.cmd-logger.file=<%= @service_logs_dir %>/command.log
log4j.appender.cmd-logger.datePattern='.'yyyy-MM-dd
<% end -%>
log4j.appender.cmd-logger.file=<%= @service_logs_dir %>/command.log
log4j.appender.cmd-logger.append=true
log4j.appender.cmd-logger.layout=org.apache.log4j.PatternLayout
log4j.appender.cmd-logger.layout.ConversionPattern=%d{ISO8601} [%t] %-5p %c - %m%n
Expand All @@ -95,9 +97,12 @@ log4j.appender.cmd-logger.layout.ConversionPattern=%d{ISO8601} [%t] %-5p %c - %m
#
# Captures all output from the rundeckd server.
#

<% if @rd_log4j_rotatedaily -%>
log4j.appender.server-logger=org.apache.log4j.DailyRollingFileAppender
log4j.appender.server-logger.file=<%= @service_logs_dir %>/rundeck.log
log4j.appender.server-logger.datePattern='.'yyyy-MM-dd
<% end -%>
log4j.appender.server-logger.file=<%= @service_logs_dir %>/rundeck.log
log4j.appender.server-logger.append=true
log4j.appender.server-logger.layout=org.apache.log4j.PatternLayout
log4j.appender.server-logger.layout.ConversionPattern=%d{ISO8601} [%t] %-5p %c - %m%n
Expand All @@ -107,6 +112,7 @@ log4j.appender.server-logger.layout.ConversionPattern=%d{ISO8601} [%t] %-5p %c -
#
# Captures all audit events.
#
<% if @rd_log4j_rotatedaily -%>
log4j.appender.audit=org.apache.log4j.DailyRollingFileAppender
log4j.appender.audit.file=<%= @service_logs_dir %>/rundeck.audit.log
log4j.appender.audit.append=true
Expand All @@ -118,7 +124,9 @@ log4j.appender.audit.layout.ConversionPattern=%d{ISO8601} - %m%n
#
# Logs remote HTTP requests for Options JSON data
#
<% if @rd_log4j_rotatedaily -%>
log4j.appender.options=org.apache.log4j.DailyRollingFileAppender
<% end -%>
log4j.appender.options.file=<%= @service_logs_dir %>/rundeck.options.log
log4j.appender.options.append=true
log4j.appender.options.layout=org.apache.log4j.PatternLayout
Expand All @@ -129,7 +137,9 @@ log4j.appender.options.layout.ConversionPattern=[%d{ISO8601}] %X{httpStatusCode}
#
# Logs all Job definition changes
#
<% if @rd_log4j_rotatedaily -%>
log4j.appender.jobchanges=org.apache.log4j.DailyRollingFileAppender
<% end -%>
log4j.appender.jobchanges.file=<%= @service_logs_dir %>/rundeck.jobs.log
log4j.appender.jobchanges.append=true
log4j.appender.jobchanges.layout=org.apache.log4j.PatternLayout
Expand All @@ -140,7 +150,9 @@ log4j.appender.jobchanges.layout.ConversionPattern=[%d{ISO8601}] %X{user} %X{cha
#
# Logs all API requests
#
<% if @rd_log4j_rotatedaily -%>
log4j.appender.apirequests=org.apache.log4j.DailyRollingFileAppender
<% end -%>
log4j.appender.apirequests.file=<%= @service_logs_dir %>/rundeck.api.log
log4j.appender.apirequests.append=true
log4j.appender.apirequests.layout=org.apache.log4j.PatternLayout
Expand All @@ -151,7 +163,9 @@ log4j.appender.apirequests.layout.ConversionPattern=[%d{ISO8601}] %X{remoteHost}
#
# Logs all Web requests
#
<% if @rd_log4j_rotatedaily -%>
log4j.appender.access=org.apache.log4j.DailyRollingFileAppender
<% end -%>
log4j.appender.access.file=<%= @service_logs_dir %>/rundeck.access.log
log4j.appender.access.append=true
log4j.appender.access.layout=org.apache.log4j.PatternLayout
Expand Down