Skip to content

Commit

Permalink
fixed a bug that was making the log failing when params are not all h…
Browse files Browse the repository at this point in the history
…ashes
  • Loading branch information
iMacTia committed Jul 7, 2016
1 parent c6c64f2 commit 2044d9b
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 4 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.0-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.1-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.0'
VERSION = '0.2.1'
end
end
2 changes: 1 addition & 1 deletion lib/sidekiq/middleware/server/logstah_logging.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def log_job(payload, started_at, exc = nil)
# Filter sensitive parameters
unless filter_args.empty?
args_filter = Sidekiq::Logging::ArgumentFilter.new(filter_args)
payload['args'].map! { |arg| args_filter.filter(arg) }
payload['args'] = args_filter.filter({ args: payload['args'] })[:args]
end

payload
Expand Down
1 change: 1 addition & 0 deletions spec/factories/jobs.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
FactoryGirl.define do
factory :job, class: Hash do
args [
'just a simple string',
{
object_name: 'stars',
object_id: Kernel.rand(10000),
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'][1]['a_secret_param']).to eq('[FILTERED]')
expect(log_job['args'][2]['a_secret_param']).to eq('[FILTERED]')
end

it 'add custom options' do
Expand Down

0 comments on commit 2044d9b

Please sign in to comment.