Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67a
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Perl Modules

    Apache2::Log 2.0.3

    Download button

    No screenshots available
    Downloads: 458  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    Good (3.0/5)
    8 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    mod_perl Team | More programs
    The Apache License 2.0 / FREE
    February 6th, 2008, 22:58 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    Apache2::Log description

    A Perl API for Apache Logging Methods.

    Apache2::Log is a Perl API for Apache logging methods.

    Synopsis

    # in startup.pl
    #--------------
    use Apache2::Log;

    use Apache2::Const -compile => qw(OK :log);
    use APR::Const -compile => qw(:error SUCCESS);

    my $s = Apache2::ServerUtil->server;

    $s->log_error("server: log_error");
    $s->log_serror(__FILE__, __LINE__, Apache2::Const::LOG_ERR,
    APR::Const::SUCCESS, "log_serror logging at err level");
    $s->log_serror(Apache2::Log::LOG_MARK, Apache2::Const::LOG_DEBUG,
    APR::Const::ENOTIME, "debug print");
    Apache2::ServerRec->log_error("routine warning");

    Apache2::ServerRec::warn("routine warning");

    # in a handler
    #-------------
    package Foo;

    use strict;
    use warnings FATAL => 'all';

    use Apache2::Log;

    use Apache2::Const -compile => qw(OK :log);
    use APR::Const -compile => qw(:error SUCCESS);

    sub handler {
    my $r = shift;
    $r->log_error("request: log_error");

    my $rlog = $r->log;
    for my $level qw(emerg alert crit error warn notice info debug) {
    no strict 'refs';
    $rlog->$level($package, "request: $level log level");
    }

    # can use server methods as well
    my $s = $r->server;
    $s->log_error("server: log_error");

    $r->log_rerror(Apache2::Log::LOG_MARK, Apache2::Const::LOG_DEBUG,
    APR::Const::ENOTIME, "in debug");

    $s->log_serror(Apache2::Log::LOG_MARK, Apache2::Const::LOG_INFO,
    APR::Const::SUCCESS, "server info");

    $s->log_serror(Apache2::Log::LOG_MARK, Apache2::Const::LOG_ERR,
    APR::Const::ENOTIME, "fatal error");

    $r->log_reason("fatal error");
    $r->warn('routine request warning');
    $s->warn('routine server warning');

    return Apache2::Const::OK;
    }
    1;

    # in a registry script
    # httpd.conf: PerlOptions +GlobalRequest
    use Apache2::ServerRec qw(warn); # override warn locally
    print "Content-type: text/plainnn";
    warn "my warning"



    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    Apache logging | logging methods | Perl module | Apache | logging | Perl

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM