A spike to log events
Create a new Auditor
task.
# File lib/symphony/tasks/auditor.rb, line 20
def initialize( * )
super
@logdir = Pathname.pwd
@logfile = @logdir + 'events.log'
@log = @logfile.open( File::CREAT|File::APPEND|File::WRONLY, encoding: 'utf-8' )
self.log.info "Logfile is: %s" % [ @logfile ]
end
Log the event.
# File lib/symphony/tasks/auditor.rb, line 38
def work( payload, metadata )
@log.puts "%d%s [%s]: %p" % [
metadata[:delivery_info][:delivery_tag],
metadata[:delivery_info][:redelivered] ? '+' : '',
metadata[:delivery_info][:routing_key],
payload
]
return true
end