logstash-logger 0.18.1 → 0.19.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +1 -0
- data/lib/logstash-logger/buffer.rb +6 -1
- data/lib/logstash-logger/device/connectable.rb +9 -1
- data/lib/logstash-logger/version.rb +1 -1
- 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: 87c30ee495dde3dc0d332c0c112108f14bf66dc5
|
4
|
+
data.tar.gz: da338ca8a8eb2595740199307a14b9f7526f0886
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: de82021502e6ff643318b41a82fa8a8b135e0215c65d2f2d92356d00deb39d32a89571e5dfb8fc3441ef92fa4cfd4b23159fef69fe08640db1817b97488383d9
|
7
|
+
data.tar.gz: d8046cde7755499f924b90dc9dc4045d2de9567e5492241c241e3d22c1ce8cd157a7b9195cde444db8a3411f3a973c12c14ab4d9be862d02342322f1686bc471
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -253,6 +253,7 @@ You can configure its behavior by passing the following options to LogStashLogge
|
|
253
253
|
* :drop_messages_on_flush_error - Drop messages when there is a flush error. Defaults to false.
|
254
254
|
* :drop_messages_on_full_buffer - Drop messages when the buffer is full. Defaults to true.
|
255
255
|
* :sync - Flush buffer every time a message is received (blocking). Defaults to false.
|
256
|
+
* :buffer_flush_at_exit - Flush messages when exiting the program. Defaults to true.
|
256
257
|
|
257
258
|
You can turn buffering off by setting `sync = true`.
|
258
259
|
|
@@ -95,9 +95,14 @@ module LogStashLogger
|
|
95
95
|
:has_on_flush_error => self.class.method_defined?(:on_flush_error),
|
96
96
|
:has_on_full_buffer_receive => self.class.method_defined?(:on_full_buffer_receive),
|
97
97
|
:drop_messages_on_flush_error => options.fetch(:drop_messages_on_flush_error, false),
|
98
|
-
:drop_messages_on_full_buffer => options.fetch(:drop_messages_on_full_buffer, false)
|
98
|
+
:drop_messages_on_full_buffer => options.fetch(:drop_messages_on_full_buffer, false),
|
99
|
+
:flush_at_exit => options.fetch(:flush_at_exit, false)
|
99
100
|
}
|
100
101
|
|
102
|
+
if @buffer_config[:flush_at_exit]
|
103
|
+
at_exit { buffer_flush(final: true) }
|
104
|
+
end
|
105
|
+
|
101
106
|
reset_buffer
|
102
107
|
end
|
103
108
|
|
@@ -33,12 +33,20 @@ module LogStashLogger
|
|
33
33
|
true
|
34
34
|
end
|
35
35
|
|
36
|
+
@buffer_flush_at_exit =
|
37
|
+
if opts.key?(:buffer_flush_at_exit)
|
38
|
+
opts.delete(:buffer_flush_at_exit)
|
39
|
+
else
|
40
|
+
true
|
41
|
+
end
|
42
|
+
|
36
43
|
buffer_initialize(
|
37
44
|
max_items: @buffer_max_items,
|
38
45
|
max_interval: @buffer_max_interval,
|
39
46
|
autoflush: @sync,
|
40
47
|
drop_messages_on_flush_error: @drop_messages_on_flush_error,
|
41
|
-
drop_messages_on_full_buffer: @drop_messages_on_full_buffer
|
48
|
+
drop_messages_on_full_buffer: @drop_messages_on_full_buffer,
|
49
|
+
flush_at_exit: @buffer_flush_at_exit
|
42
50
|
)
|
43
51
|
end
|
44
52
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-logger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.19.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Butler
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-08-
|
11
|
+
date: 2016-08-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: logstash-event
|