Class: Logsly::Outputs::Syslog

Inherits:
Base
  • Object
show all
Defined in:
lib/logsly/outputs.rb

Overview

SYSLOG

Instance Attribute Summary

Attributes inherited from Base

#build

Instance Method Summary collapse

Methods inherited from Base

#initialize, #to_layout

Constructor Details

This class inherits a constructor from Logsly::Outputs::Base

Instance Method Details

#data(*args) ⇒ Object



126
127
128
# File 'lib/logsly/outputs.rb', line 126

def data(*args)
  SyslogData.new(*args, &self.build)
end

#to_appender(data) ⇒ Object



130
131
132
133
134
135
136
137
138
# File 'lib/logsly/outputs.rb', line 130

def to_appender(data)
  ::Syslog.close if ::Syslog.opened?

  Logsly::Logging182.appenders.syslog(data.identity, {
    :logopt   => data.log_opts,
    :facility => data.facility,
    :layout   => self.to_layout(data)
  })
end