Skip to content
krisleech edited this page Oct 7, 2014 · 1 revision

Logging events to a file takes a little extra setup. You can use the LoggerBroadcaster to wrap the default broadcaster with logging.

In a Rails app you would do the following:

# config/initializers/wisper.rb

Wisper.configure do |config|
  config.broadcaster :default, LoggerBroadcaster.new(Rails.logger, SendBroadcaster.new)
  config.broadcaster :async,   LoggerBroadcaster.new(Rails.logger, SidekiqBroadcaster.new) # if using async
end

The LoggerBroadcaster write all received events to the given logger (1st argument) and then delegates the broadcasting to the given broadcaster (2nd argument).