celluloid / dcell

UNMAINTAINED: See celluloid/celluloid#779 - Actor-based distributed objects in Ruby based on Celluloid and 0MQ
http://celluloid.io
MIT License
595 stars 65 forks source link

Setting the path for logging #110

Open bararchy opened 8 years ago

bararchy commented 8 years ago

How do I tell the Celluloid::Logger to log to a file and not STDOUT ?

bogdanRada commented 8 years ago

I think you need something like this:

require 'logger' 
require 'dcell'

Celluloid.logger = ::Logger.new(ENV['LOG_PATH'].nil? ? STDOUT : ENV['LOG_PATH'])
DCell.start :id => "itchy", :addr => "tcp://127.0.0.1:9001"

And then you can set ENV['LOG_path'] to the absolute path of a file, or you can just hardcode that value . I hope that helps :)