The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Log::Any::For::LWP - Add logging to LWP

VERSION

This document describes version 0.06 of Log::Any::For::LWP (from Perl distribution Log-Any-For-LWP), released on 2015-08-17.

SYNOPSIS

 use Log::Any::For::LWP
     -log_request_header   => 1, # optional, default 1 (turn on Net::HTTP::Methods::Patch::LogRequest)
     -log_request_body     => 1, # optional, default 0 (turn on LWP::UserAgent::Patch::LogRequestContent)
     -log_response_header  => 1, # optional, default 1 (turn on LWP::UserAgent::Patch::LogResponse)
     -log_response_body    => 1, # optional, default 0 (turn on LWP::UserAgent::Patch::LogResponse)
     -decode_response_body => 1, # optional, default 1 (passed to LWP::UserAgent::Patch::LogResponse)
 ;

Sample script and output:

 % TRACE=1 perl -MLog::Any::App -MLog::Any::For::LWP -MLWP::Simple \
   -e'get "http://www.google.com/"'
 [36] HTTP request (proto=http, len=134):
 GET / HTTP/1.1
 TE: deflate,gzip;q=0.3
 Connection: TE, close
 Host: www.google.com
 User-Agent: LWP::Simple/6.00 libwww-perl/6.04

 [79] HTTP response header:
 302 Moved Temporarily
 Cache-Control: private
 Connection: close
 Date: Tue, 17 Jul 2012 04:39:10 GMT
 ...

 [81] HTTP request (proto=http, len=136):
 GET / HTTP/1.1
 TE: deflate,gzip;q=0.3
 Connection: TE, close
 Host: www.google.co.id
 User-Agent: LWP::Simple/6.00 libwww-perl/6.04

 [190] HTTP response header:
 200 OK
 Cache-Control: private, max-age=0
 Connection: close
 Date: Tue, 17 Jul 2012 04:39:10 GMT
 ...

DESCRIPTION

This module just bundles Net::HTTP::Methods::Patch::LogRequest, LWP::UserAgent::Patch::LogRequestContent, and LWP::UserAgent::Patch::LogResponse together.

Response body is dumped to a separate category. It is recommended that you dump this to a directory, for convenience. See the documentation of LWP::UserAgent::Patch::LogResponse for more details.

SEE ALSO

Log::Any

HOMEPAGE

Please visit the project's homepage at https://metacpan.org/release/Log-Any-For-LWP.

SOURCE

Source repository is at https://github.com/sharyanto/perl-Log-Any-For-LWP.

BUGS

Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=Log-Any-For-LWP

When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.

AUTHOR

perlancar <perlancar@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2015 by perlancar@cpan.org.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.