[Bug 19652] New: Debug-level logging for response JSON
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19652 Bug ID: 19652 Summary: Debug-level logging for response JSON Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: REST api Assignee: koha-bugs@lists.koha-community.org Reporter: lari.taskula@jns.fi Log response JSON in REST API log. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19652 --- Comment #1 from Lari Taskula <lari.taskula@jns.fi> --- Created attachment 69225 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=69225&action=edit Bug 19652: Debug-level logging for response JSON This patch adds debug-level logging for response JSON. This is useful for viewing responses via REST API log file. To test: 1. prove t/db_dependent/api/v1.t 2. Configure log4perl configuration file for REST API and set log level to DEBUG 3. Make any request to existing REST API endpoint 4. Observe response JSON in your log file -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19652 Lari Taskula <lari.taskula@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |lari.taskula@jns.fi |ity.org | -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19652 Lari Taskula <lari.taskula@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |18206 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18206 [Bug 18206] REST API: Default exception handling -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19652 Lari Taskula <lari.taskula@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19652 Lari Taskula <lari.taskula@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #69225|0 |1 is obsolete| | --- Comment #2 from Lari Taskula <lari.taskula@jns.fi> --- Created attachment 69233 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=69233&action=edit Bug 19652: Debug-level logging for response JSON This patch adds debug-level logging for response JSON. This is useful for viewing responses via REST API log file. To test: 1. prove t/db_dependent/api/v1.t 2. Configure log4perl configuration file for REST API and set log level to DEBUG 3. Make any request to existing REST API endpoint 4. Observe response JSON in your log file -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19652 --- Comment #3 from Lari Taskula <lari.taskula@jns.fi> --- Test plan step 2 example conf (in your log4perl.conf file): log4perl.logger.rest = DEBUG, REST log4perl.appender.REST=Log::Log4perl::Appender::File log4perl.appender.REST.filename=/home/koha/koha-dev/var/log/rest.log log4perl.appender.REST.create_at_logtime=true log4perl.appender.REST.syswrite=true log4perl.appender.REST.recreate=true log4perl.appender.REST.mode=append log4perl.appender.REST.layout=PatternLayout log4perl.appender.REST.layout.ConversionPattern=[%d] [%p] %m %l %n log4perl.appender.REST.utf8=1 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19652 Lari Taskula <lari.taskula@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #69233|0 |1 is obsolete| | --- Comment #4 from Lari Taskula <lari.taskula@jns.fi> --- Created attachment 69265 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=69265&action=edit Bug 19652: REST API: Log request and response content This patch adds request and response logger to REST API. It is useful for viewing parameters that came within the request, and the content that is about to be rendered back. To test: 1. prove t/db_dependent/api/v1.t 2. Configure log4perl configuration file for REST API and set log level to DEBUG 3. Make any request to existing REST API endpoint 4. Observe response JSON in your log file Example configuration: log4perl.logger.rest = DEBUG, REST log4perl.appender.REST=Log::Log4perl::Appender::File log4perl.appender.REST.filename=/home/koha/koha-dev/var/log/rest.log log4perl.appender.REST.create_at_logtime=true log4perl.appender.REST.syswrite=true log4perl.appender.REST.recreate=true log4perl.appender.REST.mode=append log4perl.appender.REST.layout=PatternLayout log4perl.appender.REST.layout.ConversionPattern=[%d] [%p] %m %l %n log4perl.appender.REST.utf8=1 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19652 Lari Taskula <lari.taskula@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Debug-level logging for |REST API: Log request and |response JSON |response content -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19652 Lari Taskula <lari.taskula@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #69265|0 |1 is obsolete| | --- Comment #5 from Lari Taskula <lari.taskula@jns.fi> --- Created attachment 69267 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=69267&action=edit Bug 19652: REST API: Log request and response content This patch adds request and response logger to REST API. It is useful for viewing parameters that came within the request, and the content that is about to be rendered back. To test: 1. prove t/db_dependent/api/v1.t 2. Configure log4perl configuration file for REST API and set log level to DEBUG 3. Make any request to existing REST API endpoint 4. Observe response JSON in your log file Example configuration: log4perl.logger.rest = DEBUG, REST log4perl.appender.REST=Log::Log4perl::Appender::File log4perl.appender.REST.filename=/home/koha/koha-dev/var/log/rest.log log4perl.appender.REST.create_at_logtime=true log4perl.appender.REST.syswrite=true log4perl.appender.REST.recreate=true log4perl.appender.REST.mode=append log4perl.appender.REST.layout=PatternLayout log4perl.appender.REST.layout.ConversionPattern=[%d] [%p] %m %l %n log4perl.appender.REST.utf8=1 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19652 Josef Moravec <josef.moravec@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #69267|0 |1 is obsolete| | --- Comment #6 from Josef Moravec <josef.moravec@gmail.com> --- Created attachment 85718 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=85718&action=edit Bug 19652: REST API: Log request and response content This patch adds request and response logger to REST API. It is useful for viewing parameters that came within the request, and the content that is about to be rendered back. To test: 1. prove t/db_dependent/api/v1.t 2. Configure log4perl configuration file for REST API and set log level to DEBUG 3. Make any request to existing REST API endpoint 4. Observe response JSON in your log file Example configuration: log4perl.logger.rest = DEBUG, REST log4perl.appender.REST=Log::Log4perl::Appender::File log4perl.appender.REST.filename=/home/koha/koha-dev/var/log/rest.log log4perl.appender.REST.create_at_logtime=true log4perl.appender.REST.syswrite=true log4perl.appender.REST.recreate=true log4perl.appender.REST.mode=append log4perl.appender.REST.layout=PatternLayout log4perl.appender.REST.layout.ConversionPattern=[%d] [%p] %m %l %n log4perl.appender.REST.utf8=1 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19652 Josef Moravec <josef.moravec@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |josef.moravec@gmail.com --- Comment #7 from Josef Moravec <josef.moravec@gmail.com> --- Just rebased on top of dependency tree -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19652 Johanna Räisä <johanna.raisa@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |johanna.raisa@koha-suomi.fi --- Comment #8 from Johanna Räisä <johanna.raisa@koha-suomi.fi> --- This patch doesn't apply. Tested on master. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19652 --- Comment #9 from Johanna Räisä <johanna.raisa@koha-suomi.fi> --- Here is the fail message. Applying: Bug 19652: REST API: Log request and response content error: sha1 information is lacking or useless (Koha/REST/V1.pm). error: could not build fake ancestor Patch failed at 0001 Bug 19652: REST API: Log request and response content -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19652 --- Comment #10 from Johanna Räisä <johanna.raisa@koha-suomi.fi> --- Missed the depedency, will try again. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19652 Johanna Räisä <johanna.raisa@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA --- Comment #11 from Johanna Räisä <johanna.raisa@koha-suomi.fi> --- This patch fails to the first point. # Subtest: default_exception_handling() tests 1..5 # Subtest: Mojo::Exception 1..4 ok 1 - GET /default_exception_handling/mojo ok 2 - 500 Internal Server Error ok 3 - exact match for JSON Pointer "/error" # Looks like you planned 4 tests but ran 3. not ok 1 - Mojo::Exception # Failed test 'Mojo::Exception' Tried to continue anyhow but the rest.log file wasn't created. Not sure if the logging suppose to write individual files, seemed that all warnings went to koha-error_log file. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19652 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |BLOCKED CC| |katrin.fischer@bsz-bw.de -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19652 Bug 19652 depends on bug 18206, which changed state. Bug 18206 Summary: REST API: Default exception handling https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18206 What |Removed |Added ---------------------------------------------------------------------------- Status|BLOCKED |RESOLVED Resolution|--- |DUPLICATE -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org