Skip to content

Commit

Permalink
fixed a compatibility issue with ElasticSearch
Browse files Browse the repository at this point in the history
version bump 0.2.4
  • Loading branch information
iMacTia committed Jul 8, 2016
1 parent a132070 commit 537e61e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Sidekiq::Logstash

[<img src="https://img.shields.io/badge/version-0.2.3-green.svg" alt="version" />](https://github.com/iMacTia/sidekiq-logstash) [<img src="https://travis-ci.org/iMacTia/sidekiq-logstash.svg?branch=master" alt="version" />](https://travis-ci.org/iMacTia/sidekiq-logstash)
[<img src="https://img.shields.io/badge/version-0.2.4-green.svg" alt="version" />](https://github.com/iMacTia/sidekiq-logstash) [<img src="https://travis-ci.org/iMacTia/sidekiq-logstash.svg?branch=master" alt="version" />](https://travis-ci.org/iMacTia/sidekiq-logstash)

Sidekiq::Logstash turns your [Sidekiq](https://github.com/mperham/sidekiq) log into an organised, aggregated, JSON-syntax log ready to be sent to a logstash server.

Expand Down
2 changes: 1 addition & 1 deletion lib/sidekiq/logstash/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Sidekiq
module Logstash
VERSION = '0.2.3'
VERSION = '0.2.4'
end
end
3 changes: 3 additions & 0 deletions lib/sidekiq/middleware/server/logstah_logging.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ def log_job(payload, started_at, exc = nil)
payload['args'] = args_filter.filter({ args: payload['args'] })[:args]
end

# Needs to map all args to strings for ElasticSearch compatibility
payload['args'].map!(&:to_s)

payload
end

Expand Down
2 changes: 1 addition & 1 deletion spec/sidekiq/logstash_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
config.filter_args << 'a_secret_param'
end
log_job = Sidekiq::Middleware::Server::LogstashLogging.new.log_job(job, Time.now.utc)
expect(log_job['args'][2]['a_secret_param']).to eq('[FILTERED]')
expect(log_job['args'][2]).to include('[FILTERED]')
end

it 'add custom options' do
Expand Down

0 comments on commit 537e61e

Please sign in to comment.