port of p5 Apache::LogFormat
Perl6
Latest commit a7eb951 Jan 14, 2016 @lestrrat Merge pull request #6 from syohex/leading-v
Remove leading 'v' for suppressing panda warning
Permalink
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
LICENSE initial commit Oct 13, 2015
META6.json Remove leading 'v' for suppressing panda warning Jan 14, 2016
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.