SOAP::Transport::HTTP::Log4perl - SOAP::Lite plugin that adds Log4perl traces
use Log::Log4perl qw(:easy); # Load this module and request to send all log messages through the logger 'mysoap.soap' use SOAP::Transport::HTTP::Log4perl logger => 'myapp.soap'; # Load SOAP lite *AFTER* this module use SOAP::Lite uri => 'http://www.soaplite.com/Server', proxy => 'http://localhost:8080/', ; # Initialize log4perl Log::Log4perl->easy_init($TRACE); my $LOG = Log::Log4perl->get_logger("myapp.client"); $LOG->info("Program start"); # Make a SOAP::Lite call and watch for the logs my $value = SOAP::Lite->new->test(1)->result;
This module logs all SOAP::Lite's messages (requests and responses) through Log::Log4perl. The module works by changing SOAP::Lite's default HTTP client, which means that the module has to be loaded before SOAP::Lite is first loaded.
It's a simple debugging tool that provides a good overview of what's been sent and received by SOAP::Lite that can be quite handy when dealing with services over secure channels (HTTPS) or when going through corporate a proxy.
This module is more of a proof of concept that can be used by anyone that wants to have a closer understanding of what's being passed through the network.
This module takes no approach regarding privacy and simply dumps everything that's sent and received. If you need to remove sensitive data (passwords, personal information) make sure that you modify the module or don't log the data into a persistent appender.
This module was developed for debugging purposes where privacy is not a concern.
This module can be configured through the import mechanism.
To change the name of the logger (soap) used simply provide a name through the parameter logger:
use SOAP::Transport::HTTP::Log4perl logger => 'app.soap';
Emmanuel Rodriguez <firstname.lastname@example.org>
(C) 2010 Emmanuel Rodriguez