Skip to content

Commit cfa227f

Browse files
committed
Remove the loggings of urls at startup
When Logstash was starting at the register call we were bleeding all the urls in the log, since we want this plugins to be supported in multiple version of logstash is to simply remove them from the logger. We could also leak the password when an exception happen because the response and the request where both sent to the log, we change the logic if we are running in debug mode we will send the content to the logger. Fixes #82
1 parent 4e52d04 commit cfa227f

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

lib/logstash/inputs/http_poller.rb

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ class LogStash::Inputs::HTTP_Poller < LogStash::Inputs::Base
4242
def register
4343
@host = Socket.gethostname.force_encoding(Encoding::UTF_8)
4444

45-
@logger.info("Registering http_poller Input", :type => @type,
46-
:urls => @urls, :schedule => @schedule, :timeout => @timeout)
45+
@logger.info("Registering http_poller Input", :type => @type, :schedule => @schedule, :timeout => @timeout)
4746

4847
setup_requests!
4948
end
@@ -212,12 +211,19 @@ def handle_failure(queue, name, request, exception, execution_time)
212211
queue << event
213212
rescue StandardError, java.lang.Exception => e
214213
@logger.error? && @logger.error("Cannot read URL or send the error as an event!",
214+
:exception => e,
215+
:exception_message => e.message,
216+
:exception_backtrace => e.backtrace,
217+
:name => name)
218+
219+
# If we are running in debug mode we can display more information about the
220+
# specific request which could give more details about the connection.
221+
@logger.debug? && @logger.debug("Cannot read URL or send the error as an event!",
215222
:exception => e,
216223
:exception_message => e.message,
217224
:exception_backtrace => e.backtrace,
218225
:name => name,
219-
:url => request
220-
)
226+
:url => request)
221227
end
222228

223229
private

0 commit comments

Comments
 (0)