md-logstasher 1.0.2 → 1.0.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1cdc20dc2cdca7d6f5bf250b984ce45bd9516f95
4
- data.tar.gz: 12d323b20ed3e9e9d62f79310ff192dfe5707dae
3
+ metadata.gz: e1dc5c8256a5a1eb30a87703624388eb5e59281c
4
+ data.tar.gz: 5694155917291d83831fb1d47c20647dc2cc795c
5
5
  SHA512:
6
- metadata.gz: 279df626a6134fae42a548058c4b8f77cac064f04cd080d4a035dcf35d1700cd9786a9aa93a02cffc22e699ebbb91b2ac2a69ceb935942aa5d3b43e0ca00fe95
7
- data.tar.gz: 0a295d32642284254328d0972a01e40aed7bb50a31a9b80f47d5c77ae6b06c678e2f43724083627f7e32911a1b17d5325f8b5ea336d228acd5ef14016c36b5cc
6
+ metadata.gz: 97384e4e4a420b4ab250a86149f172234512e674e269e38533157c660be340cd3a88498df9b579750245e733acd383ef9b5db76156a2adc5abb5f31aa909fa63
7
+ data.tar.gz: d11255e6b2c5f40e43cca37237f2467ceb6d5ac7a2633f5e43e2efee2bc390d59cf71cc834d18ecdf8e367a1a38cbeda2f0b02d124136c21b6255a902626f1e9
data/README.md CHANGED
@@ -61,7 +61,14 @@ add the following to your `<environment>.rb`
61
61
 
62
62
  # Disable logging of request parameters
63
63
  config.logstasher.include_parameters = false
64
-
64
+
65
+ If you want the parameters to be sent unserialized, so they are indexed and
66
+ searchable individually in elasticsearch, skip the serialization step.
67
+
68
+ # Log parameters individually
69
+ config.logstasher.serialize_parameters = false
70
+
71
+
65
72
  ## Adding custom fields to the log
66
73
 
67
74
  Since some fields are very specific to your application, e.g., *user_name*,
@@ -71,8 +78,8 @@ it is left upto you to add them. Here's how to do it:
71
78
 
72
79
  if LogStasher.enabled
73
80
  LogStasher.append_fields do |fields|
74
- # This block is run in application_controller context,
75
- # so you have access to all controller methods
81
+ # This block is run within the context of the controller handling the
82
+ # request, so you have access to all its methods and instance variables
76
83
  fields[:user] = current_user && current_user.mail
77
84
  fields[:site] = request.path =~ /^\/api/ ? 'api' : 'user'
78
85
  end
@@ -52,7 +52,7 @@ module LogStasher
52
52
  fail ::RuntimeError, 'Cannot write. The device has been closed.' if closed?
53
53
 
54
54
  with_syslog_open do
55
- ::Syslog.log(facility, '%s', log)
55
+ ::Syslog.log(priority, '%s', log)
56
56
  end
57
57
  end
58
58
 
@@ -1,3 +1,3 @@
1
1
  module LogStasher
2
- VERSION = "1.0.2"
2
+ VERSION = "1.0.3"
3
3
  end
@@ -86,7 +86,7 @@ describe LogStasher::Device::Syslog do
86
86
  end
87
87
 
88
88
  it 'writes the log to syslog' do
89
- expect(::Syslog).to receive(:log).with(subject.facility, '%s', 'a log')
89
+ expect(::Syslog).to receive(:log).with(subject.priority, '%s', 'a log')
90
90
  subject.write('a log')
91
91
  end
92
92
 
@@ -26,6 +26,7 @@ describe LogStasher::LogSubscriber do
26
26
  around do |example|
27
27
  backup_logger = LogStasher.logger
28
28
  LogStasher.logger = logger
29
+ LogStasher.append_fields { }
29
30
  Thread.current[:logstasher_context] = context
30
31
  Timecop.freeze { example.run }
31
32
  Thread.current[:logstasher_context] = nil
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: md-logstasher
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Devin Christensen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-10 00:00:00.000000000 Z
11
+ date: 2015-06-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: logstash-event