[Koha-bugs] [Bug 19652] REST API: Log request and response content

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed Nov 22 09:35:36 CET 2017


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19652

Lari Taskula <lari.taskula at jns.fi> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #69265|0                           |1
        is obsolete|                            |

--- Comment #5 from Lari Taskula <lari.taskula at 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.


More information about the Koha-bugs mailing list