Menu

How to use infiltrate_lwp ?

Help
2005-12-01
2013-06-04
  • Michaël Houzé

    Michaël Houzé - 2005-12-01

    Hi,

    I try something like:
      use Log::Log4perl;
      use LWP::Debug qw(+)

      ...

      Log::Log4perl::init( "test.conf" );
      my $logger = Log::Log4perl::get_logger("code");

      Log::Log4perl::infiltrate_lwp();

      $logger->debug ("Create UserAgent");
      # UserAgent init
      my $UserAgent = LWP::UserAgent->new (agent => ... );

    and so on, and instead of seeing all LWP debug message in logfile/screen, there is just Log4perl messages.

    Is there any thing more needed to show LWP logs ?

    Regards.

     
    • Mike Schilli

      Mike Schilli - 2006-02-12

      Try this:

      use Log::Log4perl qw(:easy);
      use LWP::UserAgent;
      use HTTP::Request::Common;

      Log::Log4perl->easy_init($DEBUG);

      Log::Log4perl::infiltrate_lwp();

      my $ua = LWP::UserAgent->new();
      $ua->request(GET "http://www.yahoo.com");

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.