Class: Logback::FileAppender

Inherits:
JFileAppender
  • Object
show all
Includes:
AppenderUtil
Defined in:
lib/logback.rb

Overview

Extends ch.qos.logback.core.FileAppender with a block initializer.

Note that if buffered (immediate_flush = false, buffer_size > 0), you will need to stop the appender before exiting in order to flush/close the log. Calling:

Logback.configure {}

Will also result in the log being flushed and closed.

Instance Method Summary collapse

Methods included from AppenderUtil

#finish, #set_defaults

Constructor Details

#initialize(file_name, append = true, &block) ⇒ FileAppender

Sets defaults, yields self to block, and calls self.start



240
241
242
243
244
245
246
247
248
# File 'lib/logback.rb', line 240

def initialize( file_name, append = true, &block )
  super()
  set_defaults
  self.file = file_name
  self.append = append
  self.immediate_flush = true #default
  self.encoding = "UTF-8"
  finish( &block )
end