diff options
author | Azul <azul@riseup.net> | 2014-03-11 09:36:36 +0100 |
---|---|---|
committer | Azul <azul@riseup.net> | 2014-03-11 09:36:36 +0100 |
commit | e3cbff8afeb661eebf2df517072d08228e0eada5 (patch) | |
tree | 1b5ac52b862ff2dd87092a495d4ea45bfd5caa49 /lib/tapicero/user_database.rb | |
parent | cd02ef4f639aca4b1e222b58a915194b200404ad (diff) |
make warnings more readable to nagios - #5247
Diffstat (limited to 'lib/tapicero/user_database.rb')
-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 |