concise_logging 0.0.1 → 0.1.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: a9038b0d3a150fd312a6a77851a1bd4a2786522f
4
- data.tar.gz: 73d045e793888426413a37f1658959b86ad9ab4a
3
+ metadata.gz: 3b3ddb997dc1557b82d6502f371067527c9f2ede
4
+ data.tar.gz: 55e38ca12a4910fc681b2234b66f8e48f9a0d0c9
5
5
  SHA512:
6
- metadata.gz: d8c3a0a2b7bc52c97f6054b3dd97e0ca29a8858cd0a0904138be97385f798c8e8adb6e575847a3e9fbd342a4ba1adea197bfb2a2e7faf53221a74172f32b1efe
7
- data.tar.gz: 531e929b45056feb0b15829df9a87bc3f4278f9f58bb29d4dd29a4f8ed0fc3c9851a318cf0a3cacc9f197bf9e0ae9bca1a29349c834550ca24a73732106359e8
6
+ metadata.gz: e02b3a5840803c32a7f0c9f20072effafe0d42044d6c54c172e906c929909d6fb0ea6b742d9faaed6f3205e6088b64e7d4965122bc1131b94ae26ad7919344c2
7
+ data.tar.gz: e8c346776f50a2257644a4da6027d6d7c71b5834910c4c89d8fd2b1b6a04ff82f468379ee29a83bc5c6c4e9cbba1923e51b4ae49101cc9c550502dd788595702
data/README.md CHANGED
@@ -1,6 +1,21 @@
1
1
  # ConciseLogging
2
2
 
3
- Alternate logging for Rails production servers
3
+ Concise request logging for Rails production
4
+
5
+ ![screenshot](https://github.com/gshaw/concise_logging/raw/master/img/screenshot.png)
6
+
7
+ Logs a concise single line for each request at `:warn` level. This allows
8
+ logging requests without all the extra logging that `:info` level outputs.
9
+
10
+ Not suitable for development but ideal for production settings where each
11
+ request and associated parameters is logged.
12
+
13
+ Inspired by a [blog post on RubyJunky.com][1].
14
+
15
+ Special thanks to [Zohreh Jabbari](https://github.com/zohrehj) for doing the
16
+ initial coding and proof of concept.
17
+
18
+ [1]: http://rubyjunky.com/cleaning-up-rails-4-production-logging.html
4
19
 
5
20
  ## Installation
6
21
 
@@ -21,11 +36,11 @@ Or install it yourself as:
21
36
  ## Usage
22
37
 
23
38
  Add this to your `config/production.rb`. Configure tagging as per your desires.
39
+ We use tagging to indicate application with a 2 letter code and environment with
40
+ a single letter (e.g., p = production, s = staging).
24
41
 
25
42
  ````ruby
26
- config.middleware.use "ConciseLogging::LogMiddleware"
27
- ConciseLogging::LogSubscriber.attach_to :action_controller
28
-
43
+ # Configure logger to log warn and above
29
44
  config.log_level = :warn
30
45
  config.log_tags = ["cv-#{Rails.env[0]}"]
31
46
  config.logger = ActiveSupport::TaggedLogging.new(ActiveSupport::Logger.new(File.join(Rails.root, "log", "#{Rails.env}.log")))
@@ -17,6 +17,8 @@ Gem::Specification.new do |spec|
17
17
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
18
  spec.require_paths = ["lib"]
19
19
 
20
+ spec.add_runtime_dependency "rails", "~> 4.1"
21
+
20
22
  spec.add_development_dependency "bundler", "~> 1.7"
21
23
  spec.add_development_dependency "rake", "~> 10.0"
22
24
  end
Binary file
@@ -0,0 +1,9 @@
1
+ module ConciseLogging
2
+ class Railtie < Rails::Railtie
3
+ initializer "railtie.configure_rails_initialization" do |app|
4
+ app.middleware.use ConciseLogging::LogMiddleware
5
+ end
6
+
7
+ ConciseLogging::LogSubscriber.attach_to :action_controller
8
+ end
9
+ end
@@ -1,3 +1,3 @@
1
1
  module ConciseLogging
2
- VERSION = "0.0.1"
2
+ VERSION = "0.1.0"
3
3
  end
@@ -1,3 +1,4 @@
1
1
  require "concise_logging/version"
2
2
  require "concise_logging/log_middleware"
3
3
  require "concise_logging/log_subscriber"
4
+ require "concise_logging/railtie" if defined? Rails
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: concise_logging
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.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-11 00:00:00.000000000 Z
11
+ date: 2014-10-15 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '4.1'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '4.1'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: bundler
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -51,9 +65,11 @@ files:
51
65
  - README.md
52
66
  - Rakefile
53
67
  - concise_logging.gemspec
68
+ - img/screenshot.png
54
69
  - lib/concise_logging.rb
55
70
  - lib/concise_logging/log_middleware.rb
56
71
  - lib/concise_logging/log_subscriber.rb
72
+ - lib/concise_logging/railtie.rb
57
73
  - lib/concise_logging/version.rb
58
74
  homepage: https://github.com/gshaw/concise_logging
59
75
  licenses: