diff options
author | Elijah Sparrow <elijah@riseup.net> | 2014-03-11 11:04:46 -0700 |
---|---|---|
committer | Elijah Sparrow <elijah@riseup.net> | 2014-03-11 11:04:46 -0700 |
commit | fdc9a1253e4a6623dd6459f10ec6924207cf9f07 (patch) | |
tree | 1b5ac52b862ff2dd87092a495d4ea45bfd5caa49 /lib/tapicero | |
parent | cd02ef4f639aca4b1e222b58a915194b200404ad (diff) | |
parent | e3cbff8afeb661eebf2df517072d08228e0eada5 (diff) |
Merge pull request #12 from azul/logging/merge-lines-for-nagios
make warnings more readable to nagios - #5247
Diffstat (limited to 'lib/tapicero')
-rw-r--r-- | lib/tapicero/user_database.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/tapicero/user_database.rb b/lib/tapicero/user_database.rb index 26d013d..f04e3e7 100644 --- a/lib/tapicero/user_database.rb +++ b/lib/tapicero/user_database.rb @@ -71,9 +71,9 @@ module Tapicero rescue RestClient::Exception => exc raise exc if Tapicero::RERAISE if second_try - log_error "#{action} #{db.name} failed twice due to:", exc + log_error "#{action} #{db.name} failed twice due to: ", exc else - log_error "#{action} #{db.name} failed due to:", exc + log_error "#{action} #{db.name} failed due to: ", exc sleep 5 second_try = true retry @@ -81,8 +81,8 @@ module Tapicero end def log_error(message, exc) - Tapicero.logger.warn message if message - Tapicero.logger.warn exc.class.name + ': ' + exc.to_s + # warn message is a one liner so nagios can parse it + Tapicero.logger.warn message.to_s + exc.class.name + ': ' + exc.to_s Tapicero.logger.debug exc.backtrace.join("\n") end |