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 +4 -4
- data/README.md +10 -3
- data/lib/logstasher/device/syslog.rb +1 -1
- data/lib/logstasher/version.rb +1 -1
- data/spec/lib/logstasher/device/syslog_spec.rb +1 -1
- data/spec/lib/logstasher/log_subscriber_spec.rb +1 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e1dc5c8256a5a1eb30a87703624388eb5e59281c
|
4
|
+
data.tar.gz: 5694155917291d83831fb1d47c20647dc2cc795c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
75
|
-
# so you have access to all
|
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
|
data/lib/logstasher/version.rb
CHANGED
@@ -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.
|
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.
|
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-
|
11
|
+
date: 2015-06-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: logstash-event
|