f92bde5af2
Add Logger#[] and Logger#[]= alias methods to get and set fields
2017-07-25 00:03:47 +02:00
9656297762
Remove ANSI color codes from the message in JSON encoder
2017-07-22 00:06:35 +02:00
da97e9d54e
Inline Message#cleanup to save one method invocation per log line
2017-07-21 23:39:17 +02:00
05145b400b
Fix Typo
2017-07-21 23:34:29 +02:00
667beb662f
Freeze Messages directly after initialization
...
This ensures that they are actually immutable.
2017-07-21 22:50:44 +02:00
9536b0473b
Forward Logger#timestamp to Buffer#timestamp
2017-07-21 18:34:29 +02:00
5213574ec7
Don't include Forwardable into Rackstash::Logger anymore, we are not using it
2017-07-21 17:12:46 +02:00
cce94b70ed
Explicitly require concurrent gem for Buffer class
2017-07-21 17:06:37 +02:00
1b81e763b2
Improve documentation for Sink#default_* accessors
2017-07-21 17:04:25 +02:00
c53d85fac5
Forward Logger#tag to the current Buffer
2017-07-21 16:57:44 +02:00
fc4a917b71
Forward Logger#close and Logger#reopen to the Sink
2017-07-21 16:44:11 +02:00
40f920dafb
Forward config methods for the Sink on the Logger
2017-07-21 16:37:47 +02:00
1d67d819d0
Complete code documentation of Rackstash::Message
2017-07-20 23:46:03 +02:00
25dfa87de7
Add Rackstash::Logger#add_exception to easily add details about exceptions as buffer fields
2017-07-20 23:19:06 +02:00
67955f8629
Add force parameter to Rackstash::Fields::Hash#set so it works like #merge!
2017-07-20 22:11:11 +02:00
9fc9ea248b
Use Rackstash::Helpers::UTF8 in Message class
2017-07-20 14:12:05 +02:00
d73b7ba8e1
Extract utf8_encode helper into Rackstash::Helpers::UTF8 module
2017-07-20 14:12:05 +02:00
2c8d6ac009
Don't cleanup ANSI chars and newlines in messages anymore
...
These characters might be there deliberately. If they should be cleaned
up, it can easily be done later with a filter.
2017-07-20 13:45:55 +02:00
5eeaab4afa
Allow to overwrite logger attributes in Logger#initialize
2017-07-20 00:47:26 +02:00
4a62e3d189
Allow to write a Hash to the Logger to deep_merge fields
2017-07-20 00:29:43 +02:00
33ee63bffb
Improve code documentation for Logger
2017-07-20 00:20:23 +02:00
4e1f6af273
Use the same argument names in Logger methods
2017-07-20 00:18:41 +02:00
720406b318
Implement the full Sink class
...
A single Sink is tied to a single Logger. It is responsible to:
* Create a log event from a Buffer on #write and send it to each of the
flows independently.
* Forward all actions to all of the defined Flows.
The Sink provides access to all configured data of the Logger which is
used for persisting the Buffers.
2017-07-20 00:06:06 +02:00
54a6f5d160
Implement the Flow to transform and persist log events
...
A single Buffer can be send to one or more flows which in turn each
write to a different adapter. A Flow object is responsible for
filtering, encoding, and finally persisting the event to an adapter.
Each Flow object can be configured differently which allows to write a
single log event to multiple targets as required.
2017-07-19 23:55:52 +02:00
7032cc6999
Do not mutate external time objects when getting UTC time
2017-07-19 13:37:38 +02:00
b573581a26
Add Null adapter which just swallows any logs
2017-07-19 13:08:11 +02:00
b72b8cf94b
Fix @return documentation tag for Rackstash::Filters::SkipEvent#call
2017-07-19 11:09:32 +02:00
dc3d2b20bf
Add tests and clarify edge-case for Rackstash.severity_label
2017-07-18 23:28:26 +02:00
e21108b7c2
Add first example SkipEvent filter
2017-07-18 23:13:35 +02:00
466c377565
Add FilterChain to wrap and filters on event hashes
2017-07-18 16:49:04 +02:00
a4a6b248cf
Use frozen string literals throughout the codebase in Ruby >= 2.3
2017-07-17 13:35:24 +02:00
e3611c8720
Add Message#severity_label and Message#length utility methods
2017-07-17 12:00:13 +02:00
364426f228
Return the flows object in Rackstash::Flows#each
2017-07-15 16:27:09 +02:00
ba61940a95
Improve code formatting
2017-07-15 14:30:07 +02:00
9f2a330a6c
Support arbitrarily nested Procs when setting/merging fields
2017-07-15 11:13:41 +02:00
dd7f79db0a
No need to freeze Strings from utf8_encode again in Fields::Tags
2017-07-15 10:50:55 +02:00
2f33e10ba9
Clarify that Buffer#add_message also sets the timestamp
2017-07-14 11:05:19 +02:00
0d1ad5e170
Add basic documentation for Rackstash::Fields
2017-07-11 23:52:49 +02:00
637245d836
Don't detail other adapters in IO adapter documentation
2017-07-11 23:43:48 +02:00
ee429fa71e
Add Rackstash::Fields::Array#shift and #unshift
2017-07-11 23:42:13 +02:00
779f3bb81d
Improve code documentation of Rackstash::Fields
2017-07-11 23:42:13 +02:00
a461b36b97
Allow to query and replace subarrays of Rackstash::Fields::Array
2017-07-11 23:42:13 +02:00
d07a9452f4
Add Rackstash::UNDEFINED constant
...
The {UNDEFINED} object can be used as the default value for method
arguments to distinguish it from `nil`. See
https://holgerjust.de/2016/detecting-default-arguments-in-ruby/#special-default-value
for details.
2017-07-11 23:42:13 +02:00
da1999dba3
Unify the conflict resolution behavior of merge! and deep_merge! in Rackstash::Fields::Hash
...
When setting `force: true` (the default), in both cases we not raise an
ArgumentError when setting a forbidden field and overwrite existing
fields. When setting it to `false`, we ignore forbidden or existing
fields in both cases.
We also allow a custom conflict resolution block to be passed to both
methods. In the case of deep_merge! and deep_merge, this applies to all
(potentially deeply nested) fields. Compatible objects, i.e. Hashes and
Arrays are still always merged without calling the block.
2017-07-11 22:23:19 +02:00
a0c92d57f8
Add File adapter to directly write to a local file
2017-07-10 23:45:02 +02:00
e96a0aaf94
Separate the PRERELEASE version part with a dash instead of a dot
2017-07-05 19:21:24 +02:00
d6c3111999
Always generate positive object IDs in inspect
...
Sometimes, object_ids are created as signed Integers which are invalid
in `inspect`. By using the default implementation of `Object#to_s`, we
can get valid object_ids the same way Ruby itself would have created
them.
For a motivation of this change, see
* https://bugs.ruby-lang.org/issues/13397
* https://github.com/ruby-concurrency/concurrent-ruby/pull/651
2017-07-03 13:37:05 +02:00
4eecc559a4
Transform list of forbidden_keys in Rackstash::Fields::Hash.new to a frozen Set
...
We then expose this frozen Set on the `forbidden_keys` attribute.
2017-06-30 19:27:46 +02:00
d26858c103
Add Rackstash::Fields::Array#size as an alias to length
2017-06-22 23:00:51 +02:00
7c0c983dc2
Add Message encoder to just log the log message
...
This encoder is useful for local consumption of the raw log stream, e.g.
during development where the developer might not care for any additional
fields. With this encoder, the log output can mostly resemble a "classic"
line-based log feed.
2017-06-21 01:38:11 +02:00