log2json-loggers 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/log2json/railslogger.rb +7 -2
- metadata +2 -2
data/lib/log2json/railslogger.rb
CHANGED
@@ -1,10 +1,14 @@
|
|
1
1
|
# Use it like this in your config/environments/{staging,production}.rb:
|
2
2
|
#
|
3
|
+
# require 'log2json/railslogger'
|
3
4
|
# config.logger = ::Log2Json::create_custom_ralis_logger(config)
|
4
5
|
#
|
5
6
|
# Also, in unicorn.rb, add it like this:
|
6
7
|
#
|
7
|
-
#
|
8
|
+
# if %w(staging production).include?(ENV['RAILS_ENV'])
|
9
|
+
# require 'log2json/railslogger'
|
10
|
+
# logger ::Log2Json::create_custom_unicorn_logger(self)
|
11
|
+
# end
|
8
12
|
#
|
9
13
|
|
10
14
|
require 'logger'
|
@@ -26,9 +30,10 @@ module Log2Json
|
|
26
30
|
unless File.exist? File.dirname path
|
27
31
|
FileUtils.mkdir_p File.dirname path
|
28
32
|
end
|
33
|
+
config.colorize_logging = false
|
29
34
|
logger = ::Logger.new(path)
|
30
35
|
logger.formatter = ::Log2Json::log_formatter
|
31
|
-
logger
|
36
|
+
ActiveSupport::TaggedLogging.new(logger)
|
32
37
|
end
|
33
38
|
|
34
39
|
# Simiar to the custom rails logger, but for unicorn.
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: log2json-loggers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-10-02 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: ! "Log2json lets you read, filter and send logs as JSON objects via Unix
|
15
15
|
pipes.\nIt is inspired by Logstash, and is meant to be compatible with it at the
|