Permalink
Browse files

Backports zylad log_level variable on master

Manually cherry-picked pull #32 work and only kept the changes
that concerned log_level. The other changes that concerned upgrading
puppet DSL or style have been merged to the branch soon to be released
as v1.0.0 and merged to master as such, leaving this obsolete code
for very old puppet installs
  • Loading branch information...
LeoCavaille committed Jul 16, 2014
1 parent ba5563e commit c00309744815fc601fc19fa646cee4c73dae03a9
Showing with 17 additions and 2 deletions.
  1. +16 −1 manifests/init.pp
  2. +1 −1 templates/datadog.conf.erb
View
@@ -19,6 +19,9 @@
# $non_local_traffic
# Enable you to use the agent as a proxy. Defaults to false.
# See https://github.com/DataDog/dd-agent/wiki/Proxy-Configuration
+# $log_level
+# Set value of 'log_level' variable. Default is 'info' as in dd-agent.
+# Valid values here are: critical, debug, error, fatal, info, warn and warning.
#
# Actions:
#
@@ -45,7 +48,8 @@
$tags = [],
$puppet_run_reports = false,
$puppetmaster_user = 'puppet',
- $non_local_traffic = false
+ $non_local_traffic = false,
+ $log_level = 'info'
) inherits datadog::params {
validate_string($dd_url)
@@ -55,8 +59,19 @@
validate_bool($puppet_run_reports)
validate_string($puppetmaster_user)
validate_bool($non_local_traffic)
+ validate_string($log_level)
include datadog::params
+ case upcase($log_level) {
+ 'CRITICAL': { $_loglevel = 'CRITICAL' }
+ 'DEBUG': { $_loglevel = 'DEBUG' }
+ 'ERROR': { $_loglevel = 'ERROR' }
+ 'FATAL': { $_loglevel = 'FATAL' }
+ 'INFO': { $_loglevel = 'INFO' }
+ 'WARN': { $_loglevel = 'WARN' }
+ 'WARNING': { $_loglevel = 'WARNING' }
+ default: { $_loglevel = 'INFO' }
+ }
case $operatingsystem {
"Ubuntu","Debian" : { include datadog::ubuntu }
@@ -196,7 +196,7 @@ non_local_traffic: <%= non_local_traffic %>
# Logging
# ========================================================================== #
-# log_level: INFO
+log_level: <%= _loglevel %>
# collector_log_file: /var/log/datadog/collector.log
# forwarder_log_file: /var/log/datadog/forwarder.log

0 comments on commit c003097

Please sign in to comment.