concise_logging 0.1.1 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d40d6b23b3dfa9c46912ba3150abe213060f2eef
4
- data.tar.gz: 4a7ab11e1e1ee4a4095c4210088123f696efd9f3
3
+ metadata.gz: 603b07dcf61eb6795bc0f79a460ca733809e42eb
4
+ data.tar.gz: e8aed747720fe4bae52cca3b766ffb34a798278a
5
5
  SHA512:
6
- metadata.gz: c1780c98368c04a24a84db81f6df7d5e7a032dc28a53865e62d90600733b20356b8d687a72cca95d0fcad481a0731cb854dfe2b8f45a45945218817a3bd6f682
7
- data.tar.gz: d75341f93a2c3947263f35a6f8447f06ca293c356cc5779dcf06d411edc1b3901bc8c0fdc496e115027d4679443349188011dca19b11b29ad794e368f8e9bc3f
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
- ````ruby
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
@@ -1,3 +1,3 @@
1
1
  module ConciseLogging
2
- VERSION = "0.1.1"
2
+ VERSION = "1.0.0"
3
3
  end
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.1.1
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: 2014-10-15 00:00:00.000000000 Z
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.2.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