Parent

Class/Module Index [+]

Quicksearch

Fluent::SyslogInput

Public Class Methods

new() click to toggle source
# File lib/fluent/plugin/in_syslog.rb, line 61
def initialize
  super
  require 'cool.io'
  require 'fluent/plugin/socket_util'
end

Public Instance Methods

configure(conf) click to toggle source
# File lib/fluent/plugin/in_syslog.rb, line 84
def configure(conf)
  super

  if conf.has_key?('format')
    @parser = Plugin.new_parser(conf['format'])
    @parser.configure(conf)
  else
    conf['with_priority'] = true
    @parser = TextParser::SyslogParser.new
    @parser.configure(conf)
    @use_default = true
  end
end
run() click to toggle source
# File lib/fluent/plugin/in_syslog.rb, line 119
def run
  @loop.run(@blocking_timeout)
rescue
  log.error "unexpected error", :error=>$!.to_s
  log.error_backtrace
end
shutdown() click to toggle source
# File lib/fluent/plugin/in_syslog.rb, line 112
def shutdown
  @loop.watchers.each {|w| w.detach }
  @loop.stop
  @handler.close
  @thread.join
end
start() click to toggle source
# File lib/fluent/plugin/in_syslog.rb, line 98
def start
  callback = if @use_default
               method(:receive_data)
             else
               method(:receive_data_parser)
             end

  @loop = Coolio::Loop.new
  @handler = listen(callback)
  @loop.attach(@handler)

  @thread = Thread.new(&method(:run))
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.