-
Notifications
You must be signed in to change notification settings - Fork 481
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Http: Add verbose option to http() destination #1526
Conversation
Build SUCCESS, the tests were executed on test branch: master and test suite: functions |
This is useful indeed, however it'd be great if
The first should be easy, the 2nd us only possible if libcurl has an API for it. Bazsi |
@bazsi Thank you for your comment. |
@bazsi I am a bit afraid that when verbose is on, this would generate too much logs. Those large chunks are printed per message. We might link this to trace level, else I would leave the possibility to overwrite verbosity per destination. What do you think? @mitzkia It seems libcurl supports some way to provide of own debug log implementation. You can find an example here: |
debug is debug, and it emits a lots of details already. If it doesn't have
too much overhead on production (e.g. debug disabled, I'd let it flow :)
for example, we now emit a debug level message for every name-value pair
that is changed. THAT generates huge amounts of messages.
…--
Bazsi
On Tue, Jun 13, 2017 at 8:15 AM, furiel ***@***.***> wrote:
@bazsi <https://github.com/bazsi> I am a bit afraid that when verbose is
on, this would generate too much logs. Those large chunks are printed per
message. We might link this to trace level, else I would leave the
possibility to overwrite verbosity per destination. What do you think?
@mitzkia <https://github.com/mitzkia> It seems libcurl supports some way
to provide of own debug log implementation. You can find an example here:
https://curl.haxx.se/libcurl/c/http2-download.html
Though me seems very challenging to use. Maybe there is a hint in libcurl
implementation how to assemble the same verbose logs that we can see above.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1526 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AArldvuoz1vVkP21VNdqJgMqvnh26as9ks5sDij5gaJpZM4N2ZgX>
.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should not use destination specific options, as discused in the comments.
03d7c84
to
efc87b3
Compare
Build SUCCESS, the tests were executed on test branch: master and test suite: functions |
efc87b3
to
5a0e09b
Compare
Build SUCCESS, the tests were executed on test branch: master and test suite: functions |
modules/http/http.c
Outdated
if (!G_UNLIKELY(debug_flag)) | ||
return 0; | ||
|
||
if (type >= sizeof(curl_infotype_to_text)/sizeof(curl_infotype_to_text[0])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please change this to an assert.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the note. Fixed
modules/http/http.c
Outdated
sanitized[i] = g_ascii_isprint(data[i]) ? data[i] : '.'; | ||
} | ||
sanitized[i] = 0; | ||
msg_debug(text, evt_tag_str("data", sanitized)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please change the first parameter of msg_debug to something literal instead of a variable. Something like curl_debug.
The text should go into evt_tag_str.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the note. Fixed.
5a0e09b
to
764dc74
Compare
Build FAILURE, the tests were executed on test branch: master and test suite: functions |
764dc74
to
d932f1c
Compare
Build SUCCESS, the tests were executed on test branch: master and test suite: functions |
modules/http/http.c
Outdated
} | ||
sanitized[i] = 0; | ||
msg_debug("curl trace log", | ||
evt_tag_str("curl info type", text), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use underscores here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the note, I have fixed it.
d932f1c
to
f7305d2
Compare
Build SUCCESS, the tests were executed on test branch: master and test suite: functions |
* using --debug on sbin/syslog-ng or debug --set=on on sbin/syslog-ng-ctl libcurl will display verbose logs Signed-off-by: Antal Nemes <antal.nemes@balabit.com> Signed-off-by: Andras Mitzki <andras.mitzki@balabit.com>
f7305d2
to
2f8008d
Compare
Build SUCCESS, the tests were executed on test branch: master and test suite: functions |
verbose() option:
Without this option syslog-ng can not log verbose logs of libcurl module which can be very useful sometimes.
Let see some syslog-ng console examples