Skip to content

Commit

Permalink
Merge pull request #105 from alvarolmedo/master
Browse files Browse the repository at this point in the history
A pair of log4j properties like vars
  • Loading branch information
deric authored Sep 7, 2017
2 parents fc790b0 + ac5f5ca commit 606893f
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,16 @@ class { 'zookeeper':
console_threshold => 'INFO',
rollingfile_threshold => 'INFO',
tracefile_threshold => 'TRACE',
maxfilesize => '256MB',
maxbackupindex => '20',
}
```
supported values are: `ALL`, `DEBUG`, `ERROR`, `FATAL`, `INFO`, `OFF`, `TRACE` and `WARN`.
Threshold supported values are: `ALL`, `DEBUG`, `ERROR`, `FATAL`, `INFO`, `OFF`, `TRACE` and `WARN`.

[Maxfilesize](https://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/RollingFileAppender.html#maxFileSize)

[MaxBackupIndex](https://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/RollingFileAppender.html#maxBackupIndex)


## Hiera Support

Expand Down
2 changes: 2 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@
# log4j properties
$environment_file = $::zookeeper::params::environment_file,
$log4j_prop = $::zookeeper::params::log4j_prop,
$maxfilesize = $::zookeeper::params::maxfilesize,
$maxbackupindex = $::zookeeper::params::maxbackupindex,
$max_allowed_connections = $::zookeeper::params::max_allowed_connections,
$peer_type = $::zookeeper::params::peer_type,
$rollingfile_threshold = $::zookeeper::params::rollingfile_threshold,
Expand Down
2 changes: 2 additions & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@
$rollingfile_threshold = 'INFO'
$console_threshold = 'INFO'
$tracefile_threshold = 'TRACE'
$maxfilesize = '256MB'
$maxbackupindex = '20'

# sasl options
$keytab_path = '/etc/zookeeper/conf/zookeeper.keytab'
Expand Down
4 changes: 2 additions & 2 deletions templates/conf/log4j.properties.erb
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ zookeeper.console.threshold=<%= scope.lookupvar("zookeeper::console_threshold")
zookeeper.log.dir=.
zookeeper.log.file=zookeeper.log
zookeeper.log.threshold=<%= scope.lookupvar("zookeeper::rollingfile_threshold") %>
zookeeper.log.maxfilesize=256MB
zookeeper.log.maxbackupindex=20
zookeeper.log.maxfilesize=<%= scope.lookupvar("zookeeper::maxfilesize") %>
zookeeper.log.maxbackupindex=<%= scope.lookupvar("zookeeper::maxbackupindex") %>

zookeeper.tracelog.dir=${zookeeper.log.dir}
zookeeper.tracelog.file=zookeeper_trace.log
Expand Down

0 comments on commit 606893f

Please sign in to comment.