Module: DTR::SyncLogger::Synchronizer
- Defined in:
- lib/dtr/agent/sync_logger.rb
Overview
Synchronizer loads SyncLogger provided by master process from Rinda server. Any process need sync logs with master process should start service first, so that local logger could be replaced by SyncLogger. For logs would be sent back to master process, all messages would be sent as string message. The message logged as block would be converted to string message.
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.included(base) ⇒ Object
25 26 27 |
# File 'lib/dtr/agent/sync_logger.rb', line 25 def self.included(base) base.alias_method_chain :start_service, :sync_logger end |
Instance Method Details
#start_service_with_sync_logger ⇒ Object
29 30 31 32 33 34 35 |
# File 'lib/dtr/agent/sync_logger.rb', line 29 def start_service_with_sync_logger start_service_without_sync_logger if logger_tuple = lookup_ring.read_all([:logger, nil]).first sync_logger = logger_tuple[1] DTR.logger = MessageDecoratedLogger.new(sync_logger) end end |