Class: Log4r::BufferedSyslogOutputter
- Inherits:
-
SyslogOutputter
- Object
- Monitor
- Outputter
- SyslogOutputter
- Log4r::BufferedSyslogOutputter
- Defined in:
- lib/log4r/outputter/bufferedsyslogoutputter.rb
Constant Summary
Constants inherited from SyslogOutputter
SyslogOutputter::SYSLOG_LEVELS_MAP, SyslogOutputter::SYSLOG_LOG4R_MAP
Instance Attribute Summary
Attributes inherited from Outputter
Instance Method Summary collapse
- #flush ⇒ Object
-
#initialize(*args) ⇒ BufferedSyslogOutputter
constructor
A new instance of BufferedSyslogOutputter.
Methods inherited from SyslogOutputter
#close, #closed?, #get_levels_map, #map_levels_by_name_to_syslog
Methods inherited from Outputter
[], []=, each, each_outputter, #only_at, stderr, stdout
Constructor Details
#initialize(*args) ⇒ BufferedSyslogOutputter
Returns a new instance of BufferedSyslogOutputter.
6 7 8 9 |
# File 'lib/log4r/outputter/bufferedsyslogoutputter.rb', line 6 def initialize(*args) super @buff = {} end |
Instance Method Details
#flush ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/log4r/outputter/bufferedsyslogoutputter.rb', line 11 def flush synch do begin @buff.each do |pri, | Syslog.open(@ident, @logopt, @facility) do |s| s.log(pri, '%s', .join("\t")) end end ensure @buff.clear end end end |