port of p5 Apache::LogFormat
Switch branches/tags
Nothing to show
Clone or download
lestrrat Merge pull request #7 from samcv/SPDX-license
Use SPDX identifier in license field of META6.json
Latest commit 46b65c4 Apr 26, 2017
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib/Apache Enable experimental :pack pragma Dec 25, 2015
t kebab case it Dec 1, 2015
.gitignore initial commit Oct 13, 2015
.travis.yml Update for latest panda Dec 25, 2015
LICENSE initial commit Oct 13, 2015
META6.json Use SPDX identifier in license field of META6.json Apr 26, 2017
README.md Fix parameters passed to format() Oct 14, 2015

README.md

Build Status

NAME

Apache::LogFormat - Provide Apache-Style Log Generators

SYNOPSIS

# Use a predefined log format to generate string for logging
use Apache::LogFormat;
my $fmt = Apache::LogFormat.combined;
my $line = $fmt.format(%env, @res, $length, $reqtime, $time);
$*ERR.print($line);

# Compile your own log formatter
use Apache::LogFormat::Compiler;
my $c = Apache::LogFormat::Compiler.new;
my $fmt = $c.compile(' ... pattern ... ');
my $line = $fmt.format(%env, @res, $length, $reqtime, $time);
$*ERR.print($line);

DESCRIPTION

Apache::LogFormat provides Apache-style log generators.

PRE DEFINED FORMATTERS

common(): $fmt:Apache::LogFormat::Formatter

Creates a new Apache::LogFormat::Formatter that generates log lines in the following format:

%h %l %u %t "%r" %>s %b

combined(): $fmt:Apache::LogFormat::Formatter

Creates a new Apache::LogFormat::Formatter that generates log lines in the following format:

%h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-agent}i"

AUTHOR

Daisuke Maki lestrrat@gmail.com

COPYRIGHT AND LICENSE

Copyright 2015 Daisuke Maki

This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.