concise_logging 0.1.1 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +11 -2
- data/lib/concise_logging/log_middleware.rb +1 -1
- data/lib/concise_logging/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 603b07dcf61eb6795bc0f79a460ca733809e42eb
|
4
|
+
data.tar.gz: e8aed747720fe4bae52cca3b766ffb34a798278a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 072e9e1aec56cece9dea9775bf1a6ecc28e3eb420aa9a9c780f67f2496e1d5453ba16e33f8cf98ada4ac4317a32923e0edbc3269655f6b5be13bc3cd89f2e67a
|
7
|
+
data.tar.gz: e091f28b0d4cc422d1792f076b35ad8feff8408e409392ba11fa061bfa185510753acc84bc079264ee03f8e5a25567b54ff46148c7c4435dfbb7fcbde44282b6
|
data/README.md
CHANGED
@@ -39,12 +39,21 @@ Add this to your `config/production.rb`. Configure tagging as per your desires.
|
|
39
39
|
We use tagging to indicate application with a 2 letter code and environment with
|
40
40
|
a single letter (e.g., p = production, s = staging).
|
41
41
|
|
42
|
-
|
42
|
+
```ruby
|
43
43
|
# Configure logger to log warn and above
|
44
44
|
config.log_level = :warn
|
45
45
|
config.log_tags = ["cv-#{Rails.env[0]}"]
|
46
46
|
config.logger = ActiveSupport::TaggedLogging.new(ActiveSupport::Logger.new(File.join(Rails.root, "log", "#{Rails.env}.log")))
|
47
|
-
|
47
|
+
```
|
48
|
+
|
49
|
+
If you want to try the logger in development than you have to manually add the
|
50
|
+
middleware and attach the log subscriber by adding these lines in your
|
51
|
+
`config/development.rb` file. These lines are not needed for production.
|
52
|
+
|
53
|
+
```ruby
|
54
|
+
Rails.application.middleware.use ConciseLogging::LogMiddleware
|
55
|
+
ConciseLogging::LogSubscriber.attach_to :action_controller
|
56
|
+
```
|
48
57
|
|
49
58
|
## Contributing
|
50
59
|
|
@@ -6,7 +6,7 @@ module ConciseLogging
|
|
6
6
|
|
7
7
|
def call(env)
|
8
8
|
request = ActionDispatch::Request.new(env)
|
9
|
-
Thread.current[:logged_ip] = request.ip
|
9
|
+
Thread.current[:logged_ip] = request.env['HTTP_X_REAL_IP'] || request.ip
|
10
10
|
@app.call(env)
|
11
11
|
ensure
|
12
12
|
Thread.current[:logged_ip] = nil
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: concise_logging
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gerry Shaw
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-02-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -91,7 +91,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
91
91
|
version: '0'
|
92
92
|
requirements: []
|
93
93
|
rubyforge_project:
|
94
|
-
rubygems_version: 2.
|
94
|
+
rubygems_version: 2.4.5
|
95
95
|
signing_key:
|
96
96
|
specification_version: 4
|
97
97
|
summary: Alternate logging for Rails production servers
|