Class: LogStasher::Railtie

Inherits:
Rails::Railtie
  • Object
show all
Defined in:
lib/logstasher/railtie.rb

Instance Method Summary collapse

Instance Method Details

#default_loggerObject



47
48
49
50
51
52
53
54
55
56
# File 'lib/logstasher/railtie.rb', line 47

def default_logger
  unless @default_logger
    path = ::Rails.root.join('log', "logstash_#{::Rails.env}.log")
    ::FileUtils.touch(path) # prevent autocreate messages in log

    @default_logger =  ::Logger.new(path)
  end

  @default_logger
end