Module: Vx::Lib::Logger
- Defined in:
- lib/vx/lib/logger.rb,
lib/vx/lib/logger/version.rb,
lib/vx/lib/logger/sanitizer.rb,
lib/vx/lib/logger/base_logger.rb,
lib/vx/lib/logger/stdout_logger.rb,
lib/vx/lib/logger/logstash_device.rb,
lib/vx/lib/logger/logstash_logger.rb,
lib/vx/lib/logger/stdout_formatter.rb,
lib/vx/lib/logger/logstash_formatter.rb,
lib/vx/lib/logger/rack/handle_exceptions.rb
Defined Under Namespace
Modules: LogstashFormatter, Rack, Sanitizer, StdoutFormatter
Classes: BaseLogger, LogstashDevice, LogstashLogger, StdoutLogger
Constant Summary
collapse
- VERSION =
"0.3.7"
- @@progname =
$0 && File.basename($0)
- @@default =
nil
- @@logstash_device =
nil
Class Method Summary
collapse
Class Method Details
.get(target = nil) ⇒ Object
34
35
36
37
38
39
40
41
42
|
# File 'lib/vx/lib/logger.rb', line 34
def self.get(target = nil)
@@default ||= begin
if logstash_device.enabled?
LogstashLogger.new
else
StdoutLogger.new(target || STDOUT)
end
end
end
|
.install_handle_exceptions_middleware ⇒ Object
44
45
46
47
48
49
50
51
52
|
# File 'lib/vx/lib/logger.rb', line 44
def self.install_handle_exceptions_middleware
if defined? Rails
::Rails.application.config.middleware.insert 0, Vx::Lib::Logger::Rack::HandleExceptions
if ::Rails.env.production?
::Rails.application.config.middleware.delete ::ActionDispatch::DebugExceptions
end
end
end
|
.logstash_device ⇒ Object
30
31
32
|
# File 'lib/vx/lib/logger.rb', line 30
def self.logstash_device
@@logstash_device ||= LogstashDevice.new
end
|
.progname ⇒ Object
26
27
28
|
# File 'lib/vx/lib/logger.rb', line 26
def self.progname
@@progname
end
|
.progname=(value) ⇒ Object
22
23
24
|
# File 'lib/vx/lib/logger.rb', line 22
def self.progname=(value)
@@progname = value
end
|