port of p5 Apache::LogFormat
Perl6
Switch branches/tags
Nothing to show
Latest commit 46b65c4 Apr 26, 2017 @lestrrat committed on GitHub Merge pull request #7 from samcv/SPDX-license
Use SPDX identifier in license field of META6.json

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.