README
¶
go-apache-logformat
SYNOPSYS
import (
"net/http"
"os"
"github.com/lestrrat/go-apache-logformat"
)
func main() {
var s http.ServeMux
s.HandleFunc("/", handleIndex)
s.HandleFunc("/foo", handleFoo)
http.ListenAndServe(":8080", apachelog.CombinedLog.Wrap(s, os.Stderr))
}
DESCRIPTION
This is a port of Perl5's Apache::LogFormat::Compiler to golang
Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidRuneSequence = errors.New("invalid rune sequence found in format") ErrUnimplemented = errors.New("pattern unimplemented") )
View Source
var CombinedLog, _ = New(`%h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-agent}i"`)
Combined is a pre-defined ApacheLog struct to log "combined" log format
View Source
var CommonLog, _ = New(`%h %l %u %t "%r" %>s %b`)
Combined is a pre-defined ApacheLog struct to log "common" log format
Functions ¶
This section is empty.
Types ¶
type ApacheLog ¶
type ApacheLog struct {
// contains filtered or unexported fields
}
func New ¶
New creates a new ApacheLog instance from the given format. It will return an error if the format fails to compile.
type Format ¶
type Format struct {
// contains filtered or unexported fields
}
Format describes an Apache log format. Given a logging context, it can create a log line.
type FormatWriteFunc ¶
Click to show internal directories.
Click to hide internal directories.