class RooOnRails::Checks::Papertrail::LogDestinationExists
Check for a configured log destination in Papertrail
.
Input context
-
papertrail.client: a connected
Papertrail
client
Output context:
-
papertrail.dest.host, .port: the destination logging host
Constants
- NAME
The shared log destination
Public Instance Methods
call()
click to toggle source
# File lib/roo_on_rails/checks/papertrail/log_destination_exists.rb, line 24 def call data = context.papertrail.client.list_destinations.find { |h| h['syslog']['description'] == NAME } fail! "Log destination #{bold NAME} not found" if data.nil? context.papertrail!.dest!.host = data['syslog']['hostname'] context.papertrail!.dest!.port = data['syslog']['port'] pass "logging to #{context.papertrail.dest.host}:#{context.papertrail.dest.port}" end
intro()
click to toggle source
# File lib/roo_on_rails/checks/papertrail/log_destination_exists.rb, line 20 def intro "Checking for log destination #{bold NAME}..." end