biola_logs 0.2.1 → 0.3.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: c26cee0e0e3494d6294520b3e4e28d6129c7fd80
4
- data.tar.gz: f1ca6c6a8fbb86bb1ac02e9d2bdcc7d53963a1a5
3
+ metadata.gz: dea0d10b035a6f6cc7850816bf9639a27267012f
4
+ data.tar.gz: 23dfe99e7a0e38857bf6bbf72fa0587535936fcd
5
5
  SHA512:
6
- metadata.gz: 9fecd0263f8464aad5742b2c4ca21bfd9fdfbbdc5b5f8940f4cf86bd9ae8226674a2156bba09528460a2d8184e5eb5aa4f476e29a15f089b040b817c435a0797
7
- data.tar.gz: ccb871e2cc83e6db1b7e3166da87bddceb02e2afa70cae1dcd900bf25b692eca70c038557970502f2056bd461877647167534a2e96ff232482a0889448f4ba7a
6
+ metadata.gz: 7b3f8b70a03e4e4800a2beae8b8fe31c93b46098c8a1b8f2ccbfa12cd33abc12beb51a41fb31f4d31c1c16bcd0f18d6f63fb71cd4077f28cac628b3df1166ebc
7
+ data.tar.gz: 7b909e078e0a7d092fb51b98a396184bf9c646fe59f48011a0a83341efd4736ddd598eb2c6a3b4d35d08a999b199b9e3b85ff64ba8b035dd7a386df8083d7210
data/README.md CHANGED
@@ -24,12 +24,7 @@ To log `session_id`, `request_id` (or uuid), and `host_name` you need to add the
24
24
  ```ruby
25
25
  # app/controllers/application_controller.rb
26
26
  class ApplicationController < ActionController::Base
27
- def append_info_to_payload(payload)
28
- super
29
- payload[:session_id] = request.session_options[:id]
30
- payload[:uuid] = request.uuid
31
- payload[:host] = request.host
32
- end
27
+ include BiolaLogs::ControllerExtensions if defined?(BiolaLogs::ControllerExtensions)
33
28
  end
34
29
  ```
35
30
 
@@ -1,4 +1,5 @@
1
1
  require 'lograge'
2
+ require 'biola_logs/controller_extensions'
2
3
  require 'biola_logs/generators'
3
4
  require 'biola_logs/generators/base'
4
5
  require 'biola_logs/generators/headers'
@@ -0,0 +1,21 @@
1
+ # Include this module in your application controller to get the additional
2
+ # data into the log
3
+ #
4
+ # class ApplicationController < ActionController::Base
5
+ # include BiolaLogs::ControllerExtensions if defined?(BiolaLogs::ControllerExtensions)
6
+ # end
7
+ #
8
+ module BiolaLogs
9
+ module ControllerExtensions
10
+
11
+ protected
12
+
13
+ # Custom attributes for lograge logging
14
+ def append_info_to_payload(payload)
15
+ super
16
+ payload[:session_id] = request.session_options[:id]
17
+ payload[:uuid] = request.uuid
18
+ payload[:host] = request.host
19
+ end
20
+ end
21
+ end
@@ -1,3 +1,3 @@
1
1
  module BiolaLogs
2
- VERSION = '0.2.1'
2
+ VERSION = '0.3.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: biola_logs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Crownoble
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-06 00:00:00.000000000 Z
11
+ date: 2016-05-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lograge
@@ -33,6 +33,7 @@ files:
33
33
  - MIT-LICENSE
34
34
  - README.md
35
35
  - lib/biola_logs.rb
36
+ - lib/biola_logs/controller_extensions.rb
36
37
  - lib/biola_logs/generators.rb
37
38
  - lib/biola_logs/generators/base.rb
38
39
  - lib/biola_logs/generators/headers.rb
@@ -59,7 +60,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
59
60
  version: '0'
60
61
  requirements: []
61
62
  rubyforge_project:
62
- rubygems_version: 2.2.2
63
+ rubygems_version: 2.6.1
63
64
  signing_key:
64
65
  specification_version: 4
65
66
  summary: Standardized log formatter