logstash-logger-p 0.26.1
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 +7 -0
- data/.gitignore +21 -0
- data/.rspec +3 -0
- data/.rubocop.yml +1156 -0
- data/.travis.yml +26 -0
- data/Appraisals +23 -0
- data/CHANGELOG.md +199 -0
- data/Gemfile +6 -0
- data/LICENSE.txt +22 -0
- data/README.md +880 -0
- data/Rakefile +23 -0
- data/gemfiles/rails_3.2.gemfile +9 -0
- data/gemfiles/rails_4.0.gemfile +9 -0
- data/gemfiles/rails_4.1.gemfile +9 -0
- data/gemfiles/rails_4.2.gemfile +9 -0
- data/gemfiles/rails_5.0.gemfile +9 -0
- data/gemfiles/rails_5.1.gemfile +9 -0
- data/lib/logstash-logger/buffer.rb +336 -0
- data/lib/logstash-logger/configuration.rb +29 -0
- data/lib/logstash-logger/device/aws_stream.rb +94 -0
- data/lib/logstash-logger/device/balancer.rb +40 -0
- data/lib/logstash-logger/device/base.rb +73 -0
- data/lib/logstash-logger/device/connectable.rb +131 -0
- data/lib/logstash-logger/device/file.rb +23 -0
- data/lib/logstash-logger/device/firehose.rb +42 -0
- data/lib/logstash-logger/device/io.rb +11 -0
- data/lib/logstash-logger/device/kafka.rb +57 -0
- data/lib/logstash-logger/device/kinesis.rb +44 -0
- data/lib/logstash-logger/device/multi_delegator.rb +36 -0
- data/lib/logstash-logger/device/redis.rb +76 -0
- data/lib/logstash-logger/device/socket.rb +21 -0
- data/lib/logstash-logger/device/stderr.rb +13 -0
- data/lib/logstash-logger/device/stdout.rb +14 -0
- data/lib/logstash-logger/device/tcp.rb +86 -0
- data/lib/logstash-logger/device/udp.rb +12 -0
- data/lib/logstash-logger/device/unix.rb +18 -0
- data/lib/logstash-logger/device.rb +67 -0
- data/lib/logstash-logger/formatter/base.rb +73 -0
- data/lib/logstash-logger/formatter/cee.rb +11 -0
- data/lib/logstash-logger/formatter/cee_syslog.rb +22 -0
- data/lib/logstash-logger/formatter/json.rb +11 -0
- data/lib/logstash-logger/formatter/json_lines.rb +11 -0
- data/lib/logstash-logger/formatter/logstash_event.rb +6 -0
- data/lib/logstash-logger/formatter.rb +51 -0
- data/lib/logstash-logger/logger.rb +106 -0
- data/lib/logstash-logger/multi_logger.rb +153 -0
- data/lib/logstash-logger/railtie.rb +51 -0
- data/lib/logstash-logger/silenced_logging.rb +83 -0
- data/lib/logstash-logger/tagged_logging.rb +40 -0
- data/lib/logstash-logger/version.rb +3 -0
- data/lib/logstash-logger.rb +11 -0
- data/logstash-logger.gemspec +39 -0
- data/samples/example.crt +16 -0
- data/samples/example.key +15 -0
- data/samples/file.conf +11 -0
- data/samples/redis.conf +12 -0
- data/samples/ssl.conf +15 -0
- data/samples/syslog.conf +10 -0
- data/samples/tcp.conf +11 -0
- data/samples/udp.conf +11 -0
- data/samples/unix.conf +11 -0
- data/spec/configuration_spec.rb +27 -0
- data/spec/constructor_spec.rb +30 -0
- data/spec/device/balancer_spec.rb +31 -0
- data/spec/device/connectable_spec.rb +74 -0
- data/spec/device/file_spec.rb +15 -0
- data/spec/device/firehose_spec.rb +41 -0
- data/spec/device/io_spec.rb +13 -0
- data/spec/device/kafka_spec.rb +32 -0
- data/spec/device/kinesis_spec.rb +41 -0
- data/spec/device/multi_delegator_spec.rb +31 -0
- data/spec/device/redis_spec.rb +52 -0
- data/spec/device/socket_spec.rb +15 -0
- data/spec/device/stderr_spec.rb +16 -0
- data/spec/device/stdout_spec.rb +31 -0
- data/spec/device/tcp_spec.rb +120 -0
- data/spec/device/udp_spec.rb +9 -0
- data/spec/device/unix_spec.rb +23 -0
- data/spec/device_spec.rb +97 -0
- data/spec/formatter/base_spec.rb +125 -0
- data/spec/formatter/cee_spec.rb +15 -0
- data/spec/formatter/cee_syslog_spec.rb +43 -0
- data/spec/formatter/json_lines_spec.rb +14 -0
- data/spec/formatter/json_spec.rb +10 -0
- data/spec/formatter/logstash_event_spec.rb +10 -0
- data/spec/formatter_spec.rb +79 -0
- data/spec/logger_spec.rb +128 -0
- data/spec/multi_logger_spec.rb +59 -0
- data/spec/rails_spec.rb +91 -0
- data/spec/silenced_logging_spec.rb +31 -0
- data/spec/spec_helper.rb +111 -0
- data/spec/syslog_spec.rb +32 -0
- data/spec/tagged_logging_spec.rb +32 -0
- metadata +335 -0
data/.travis.yml
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
language: ruby
|
2
|
+
dist: trusty
|
3
|
+
sudo: false
|
4
|
+
cache: bundler
|
5
|
+
before_install:
|
6
|
+
- gem update --system
|
7
|
+
- gem install bundler
|
8
|
+
after_success:
|
9
|
+
bundle exec codeclimate-test-reporter
|
10
|
+
rvm:
|
11
|
+
- 2.2.7
|
12
|
+
- 2.3.4
|
13
|
+
- 2.4.1
|
14
|
+
- 2.5.0
|
15
|
+
- jruby-9.1.5.0
|
16
|
+
- rubinius-3
|
17
|
+
gemfile:
|
18
|
+
- gemfiles/rails_4.2.gemfile
|
19
|
+
- gemfiles/rails_5.0.gemfile
|
20
|
+
- gemfiles/rails_5.1.gemfile
|
21
|
+
matrix:
|
22
|
+
allow_failures:
|
23
|
+
- rvm: rubinius-3
|
24
|
+
addons:
|
25
|
+
code_climate:
|
26
|
+
repo_token: 4d712355fa2863c0f33f413eeede4e52cc221c4bc989a692d97574b1f6010b69
|
data/Appraisals
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
#appraise "rails-3.2" do
|
2
|
+
#gem "rails", "~> 3.2.18"
|
3
|
+
#end
|
4
|
+
|
5
|
+
appraise "rails-4.0" do
|
6
|
+
gem "rails", "~> 4.0.0"
|
7
|
+
end
|
8
|
+
|
9
|
+
appraise "rails-4.1" do
|
10
|
+
gem "rails", "~> 4.1.1"
|
11
|
+
end
|
12
|
+
|
13
|
+
appraise "rails-4.2" do
|
14
|
+
gem "rails", "~> 4.2.0"
|
15
|
+
end
|
16
|
+
|
17
|
+
appraise "rails-5.0" do
|
18
|
+
gem "rails", "~> 5.0.0"
|
19
|
+
end
|
20
|
+
|
21
|
+
appraise "rails-5.1" do
|
22
|
+
gem "rails", "~> 5.1.0"
|
23
|
+
end
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,199 @@
|
|
1
|
+
## 0.26.1
|
2
|
+
|
3
|
+
- Fix: Support for SSL with the TCP device without an SSL context in Ruby
|
4
|
+
2.4+. [#144](https://github.com/dwbutler/logstash-logger/issues/144)
|
5
|
+
|
6
|
+
## 0.26.0
|
7
|
+
|
8
|
+
- Allow user configuration of the logger class. [#129](https://github.com/dwbutler/logstash-logger/pull/129)
|
9
|
+
- Fix: Allow type to be a string for multi_logger and syslog. [#131](https://github.com/dwbutler/logstash-logger/pull/131)
|
10
|
+
- Fix: Cancelled events are being logged. [#133](https://github.com/dwbutler/logstash-logger/issues/133)
|
11
|
+
- Fix: Expose method to reset logger state. [#138](https://github.com/dwbutler/logstash-logger/pull/138)
|
12
|
+
- Use specific AWS SDK gems. [#136](https://github.com/dwbutler/logstash-logger/pull/136)
|
13
|
+
- Adds support for using the default AWS credential provider chain. [#141](https://github.com/dwbutler/logstash-logger/pull/141)
|
14
|
+
|
15
|
+
## 0.25.1
|
16
|
+
|
17
|
+
- Skip message truncating when there is no message field. [#130](https://github.com/dwbutler/logstash-logger/pull/130)
|
18
|
+
|
19
|
+
## 0.25.0
|
20
|
+
|
21
|
+
- Drops support for Rails 3.2, MRI Ruby < 2.2, and JRuby 1.7, since these have been EOL'ed.
|
22
|
+
- Adds support for customizing events on a per-logger level. [#113](https://github.com/dwbutler/logstash-logger/pull/113)
|
23
|
+
|
24
|
+
## 0.24.1
|
25
|
+
|
26
|
+
- Fixes logging of a hash with symbol keys. [#116](https://github.com/dwbutler/logstash-logger/pull/116)
|
27
|
+
|
28
|
+
## 0.24.0
|
29
|
+
|
30
|
+
- Adds support for AWS Firehose. [#121](https://github.com/dwbutler/logstash-logger/pull/121)
|
31
|
+
|
32
|
+
## 0.23.0
|
33
|
+
|
34
|
+
- Adds support for SSL host verification to the TCP device. [#114](https://github.com/dwbutler/logstash-logger/pull/114)
|
35
|
+
- Fixes `NoMethodError` when `nil` tags are used in tagged logging. [#123](https://github.com/dwbutler/logstash-logger/issues/123)
|
36
|
+
|
37
|
+
## 0.22.1
|
38
|
+
|
39
|
+
- Fixes compatibility with ActiveJob. [#112](https://github.com/dwbutler/logstash-logger/issues/112)
|
40
|
+
|
41
|
+
## 0.22.0
|
42
|
+
|
43
|
+
- Adds support for writing to Amazon Kinesis. [#111](https://github.com/dwbutler/logstash-logger/pull/111)
|
44
|
+
|
45
|
+
## 0.21.0
|
46
|
+
|
47
|
+
- Support for merging top level configuration in MultiLogger and
|
48
|
+
MultiDelegator. [#108](https://github.com/dwbutler/logstash-logger/pull/108)
|
49
|
+
|
50
|
+
## 0.20.1
|
51
|
+
|
52
|
+
- Fixes missing require for URI [#107](https://github.com/dwbutler/logstash-logger/pull/107)
|
53
|
+
|
54
|
+
## 0.20.0
|
55
|
+
|
56
|
+
- Adds support for logging debug/error information for the connectable device's buffer. [#102](https://github.com/dwbutler/logstash-logger/pull/102)
|
57
|
+
|
58
|
+
## 0.19.2
|
59
|
+
|
60
|
+
- Fixes mutex and memory leak issues when resetting buffer.
|
61
|
+
[#97](https://github.com/dwbutler/logstash-logger/issues/97)
|
62
|
+
[#98](https://github.com/dwbutler/logstash-logger/issues/98)
|
63
|
+
[#99](https://github.com/dwbutler/logstash-logger/issues/99)
|
64
|
+
|
65
|
+
## 0.19.1
|
66
|
+
|
67
|
+
- Fixes compatibility with `ActiveRecord::SessionStore`. [#96](https://github.com/dwbutler/logstash-logger/pull/96)
|
68
|
+
|
69
|
+
## 0.19.0
|
70
|
+
|
71
|
+
- Flush buffered messages when exiting. [#92](https://github.com/dwbutler/logstash-logger/pull/92)
|
72
|
+
|
73
|
+
## 0.18.1
|
74
|
+
|
75
|
+
- Fixes usage of ActiveSupport without Rails. [#90](https://github.com/dwbutler/logstash-logger/pull/90)
|
76
|
+
|
77
|
+
## 0.18.0
|
78
|
+
|
79
|
+
This release removes the dependency on `stud` and vendors in a forked version
|
80
|
+
of `Stud::Buffer`. This improves the buffering behavior of LogStashLogger by
|
81
|
+
flushing all log messages in a background thread by default. This eliminates
|
82
|
+
blocking behavior and exceptions bubbling up to the main process.
|
83
|
+
|
84
|
+
- Fixes `Attempt to unlock a mutex which is not locked (ThreadError)`.
|
85
|
+
[#88](https://github.com/dwbutler/logstash-logger/issues/88)
|
86
|
+
|
87
|
+
## 0.17.0
|
88
|
+
- Support for logger silencing. [#87](https://github.com/dwbutler/logstash-logger/pull/87)
|
89
|
+
- Fixes Rails 5 support. [#86](https://github.com/dwbutler/logstash-logger/issues/86)
|
90
|
+
- Fixes support for tagged logging in MultiLogger.
|
91
|
+
|
92
|
+
## 0.16.0
|
93
|
+
|
94
|
+
This release is focused on improving the reliability of LogStashLogger.
|
95
|
+
Connectable log devices are now less likely to block or
|
96
|
+
raise an exception, which avoids impacting the operation of the program. There was
|
97
|
+
also a fix to avoid leaking connections.
|
98
|
+
|
99
|
+
- Allow log messages to be dropped. [#81](https://github.com/dwbutler/logstash-logger/pull/81)
|
100
|
+
- Provide `max_message_size` option. [#80](https://github.com/dwbutler/logstash-logger/pull/80)
|
101
|
+
- Unify error logging. [#82](https://github.com/dwbutler/logstash-logger/pull/82)
|
102
|
+
- Drop message when there is an unrecoverable error. [#83](https://github.com/dwbutler/logstash-logger/pull/83)
|
103
|
+
- Safely close connection when reconnecting. [#84](https://github.com/dwbutler/logstash-logger/pull/84)
|
104
|
+
|
105
|
+
## 0.15.2
|
106
|
+
- Fixes Windows support. [#64](https://github.com/dwbutler/logstash-logger/issues/64)
|
107
|
+
|
108
|
+
## 0.15.1
|
109
|
+
- Fixes MultiLogger overriding each logger with the default formatter. [#61](https://github.com/dwbutler/logstash-logger/issues/61)
|
110
|
+
|
111
|
+
## 0.15.0
|
112
|
+
- Adds buffering and automatic retry support for all connectable outputs. [#35](https://github.com/dwbutler/logstash-logger/pull/35)
|
113
|
+
|
114
|
+
## 0.14.1
|
115
|
+
- Fixes MultiLogger tagged logging in Rails. [#60](https://github.com/dwbutler/logstash-logger/pull/60)
|
116
|
+
|
117
|
+
## 0.14.0
|
118
|
+
- Support for Syslog output. [#59](https://github.com/dwbutler/logstash-logger/pull/59)
|
119
|
+
|
120
|
+
## 0.13.0
|
121
|
+
- Support for sending messages to multiple loggers. Each one can have a different formatter. [#58](https://github.com/dwbutler/logstash-logger/pull/58)
|
122
|
+
- Fixes tagged logging support when using a custom formatter.
|
123
|
+
|
124
|
+
## 0.12.0
|
125
|
+
- Support for other formatters, including custom formatters. [#56](https://github.com/dwbutler/logstash-logger/pull/56)
|
126
|
+
- Support for CEE output.
|
127
|
+
|
128
|
+
## 0.11.0
|
129
|
+
- Support for balancer log device. [#55](https://github.com/dwbutler/logstash-logger/pull/55)
|
130
|
+
|
131
|
+
## 0.10.3
|
132
|
+
- Merge URI and non-URI configuration. [#54](https://github.com/dwbutler/logstash-logger/pull/54)
|
133
|
+
|
134
|
+
## 0.10.2
|
135
|
+
- Fix for Custom Events can't access tags from Tagged Logging. [#48](https://github.com/dwbutler/logstash-logger/issues/48)
|
136
|
+
|
137
|
+
## 0.10.1
|
138
|
+
- Fix for Redis URI parsing issue. [#41](https://github.com/dwbutler/logstash-logger/issues/41)
|
139
|
+
|
140
|
+
## 0.10.0
|
141
|
+
- Support for logging to Kafka. [#37](https://github.com/dwbutler/logstash-logger/issues/37)
|
142
|
+
|
143
|
+
## 0.9.0
|
144
|
+
- Support for customizing the fields on all logged messages via configuration. [#32](https://github.com/dwbutler/logstash-logger/pull/32)
|
145
|
+
|
146
|
+
## 0.8.0
|
147
|
+
- Support for logging to stderr. [#24](https://github.com/dwbutler/logstash-logger/pull/25)
|
148
|
+
- Support multiple log outputs. [#28](https://github.com/dwbutler/logstash-logger/pull/28)
|
149
|
+
|
150
|
+
## 0.7.0
|
151
|
+
- Support for logging to a generic IO object.
|
152
|
+
- Support for overriding IO in stdout logger. [#20](https://github.com/dwbutler/logstash-logger/pull/20)
|
153
|
+
- Support for configuring logger with a URI. [#22](https://github.com/dwbutler/logstash-logger/pull/22)
|
154
|
+
- Support logging any object. [#23](https://github.com/dwbutler/logstash-logger/issues/23)
|
155
|
+
|
156
|
+
## 0.6.2
|
157
|
+
- Allow type to be specified as a string. [#19](https://github.com/dwbutler/logstash-logger/pull/19)
|
158
|
+
|
159
|
+
## 0.6.1
|
160
|
+
- Don't mutate options passed to LogStashLogger. [#18](https://github.com/dwbutler/logstash-logger/pull/18)
|
161
|
+
|
162
|
+
## 0.6.0
|
163
|
+
- Support for logging to a file.
|
164
|
+
- Support for logging to a Redis list.
|
165
|
+
- Support for logging to a local Unix socket.
|
166
|
+
- Railtie supports file logger, using default log path and `config.autoflush_log` configuration.
|
167
|
+
- All `LogStashLogger` types now support a `sync` option, which controls if each message is automatically flushed.
|
168
|
+
|
169
|
+
## 0.5.0
|
170
|
+
- Support for tagged logging. The interface was extracted from `ActiveSupport::TaggedLogging`
|
171
|
+
and outputs to the `tags` key.
|
172
|
+
- The `(host, port, type)` constructor has been deprecated in favor of an options hash constructor.
|
173
|
+
- Support for using SSL for TCP connections.
|
174
|
+
- Support for configuring logger to write to STDOUT.
|
175
|
+
- Support for Rails configuration.
|
176
|
+
- Fixed output to STDOUT in Rails console (Rails 4+).
|
177
|
+
- `host` is no longer required for TCP/UDP. It will default to `0.0.0.0`, the same default port that logstash listens on.
|
178
|
+
- Changed event key `source` to `host` to match what the latest logstash expects.
|
179
|
+
- Output event timestamp consistently even if `Time#to_json` is overridden.
|
180
|
+
- Major refactoring which will lead the way to support other log types.
|
181
|
+
|
182
|
+
## 0.4.1
|
183
|
+
- Fixed support for `LogStash::Event` v1 format when logging a hash. Extra data
|
184
|
+
now goes to the top level instead of into the `@fields` key.
|
185
|
+
|
186
|
+
## 0.4.0
|
187
|
+
- Support for new `LogStash::Event` v1 format. v0 is supported in 0.3+.
|
188
|
+
|
189
|
+
## 0.3.0
|
190
|
+
- Added support for logging to a UDP listener.
|
191
|
+
|
192
|
+
## 0.2.1
|
193
|
+
- Fixed to use Logstash's default time format for timestamps.
|
194
|
+
|
195
|
+
## 0.2.0
|
196
|
+
- Better use of Ruby Logger's built-in LogDevice.
|
197
|
+
|
198
|
+
## 0.1.0
|
199
|
+
- Initial release. Support for logging to a TCP listener.
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2012 David Butler
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|