class SysLogger::Logger
Attributes
default_formatter[R]
logdev[R]
Public Class Methods
new(logdev = nil, shift_age = 0, shift_size = 1048576, &block)
click to toggle source
Calls superclass method
# File lib/syslogger/logger.rb, line 7 def initialize(logdev = nil, shift_age = 0, shift_size = 1048576, &block) if logdev.nil? && block_given? super(SysLogger::IO.new(&block), shift_age, shift_size) elsif logdev.nil? super($stdout, shift_age, shift_size) else super(logdev, shift_age, shift_size) end @default_formatter = SysLogger::Formatter::RFC5424.new end
Public Instance Methods
<<(msg)
click to toggle source
# File lib/syslogger/logger.rb, line 35 def <<(msg) # Logger's version of this just dumps the input without formatting. there # is never a case where we don't want to format the content to the syslog # server properly. # default to a serverity of info. msg.split(/\r?\n/).each { |line| if line then self.info(line) end } end
Also aliased as: write
appname()
click to toggle source
# File lib/syslogger/logger.rb, line 23 def appname @default_formatter.appname end
appname=(appname)
click to toggle source
# File lib/syslogger/logger.rb, line 19 def appname=(appname) @default_formatter.appname = appname end
procid()
click to toggle source
# File lib/syslogger/logger.rb, line 31 def procid @default_formatter.appname end
procid=(procid)
click to toggle source
# File lib/syslogger/logger.rb, line 27 def procid=(procid) @default_formatter.procid = procid end