Documentation
¶
Index ¶
- Constants
- type Flog
- func (f *Flog) LogLine(format string, t time.Time) string
- func (f *Flog) NewApacheCombinedLog(t time.Time) string
- func (f *Flog) NewApacheCommonLog(t time.Time) string
- func (f *Flog) NewApacheErrorLog(t time.Time) string
- func (f *Flog) NewCommonLogFormat(t time.Time) string
- func (f *Flog) NewJSONLogFormat(t time.Time) string
- func (f *Flog) NewLogFmtLogFormat(t time.Time) string
- func (f *Flog) NewRFC3164Log(t time.Time) string
- func (f *Flog) NewRFC5424Log(t time.Time) string
- func (f *Flog) RandAuthUserID() string
- func (f *Flog) RandHTTPVersion() string
- func (f *Flog) RandResourceURI() string
Constants ¶
const ( // ApacheCommonLog : {host} {user-identifier} {auth-user-id} [{datetime}] "{method} {request} {protocol}" {response-code} {bytes} ApacheCommonLog = "%s - %s [%s] \"%s %s %s\" %d %d" // ApacheCombinedLog : {host} {user-identifier} {auth-user-id} [{datetime}] "{method} {request} {protocol}" {response-code} {bytes} "{referrer}" "{agent}" ApacheCombinedLog = "%s - %s [%s] \"%s %s %s\" %d %d \"%s\" \"%s\"" // ApacheErrorLog : [{timestamp}] [{module}:{severity}] [pid {pid}:tid {thread-id}] [client %{client}:{port}] %{message} ApacheErrorLog = "[%s] [%s:%s] [pid %d:tid %d] [client %s:%d] %s" // RFC3164Log : <priority>{timestamp} {hostname} {application}[{pid}]: {message} RFC3164Log = "<%d>%s %s %s[%d]: %s" // RFC5424Log : <priority>{version} {iso-timestamp} {hostname} {application} {pid} {message-id} {structured-data} {message} RFC5424Log = "<%d>%d %s %s %s %d ID%d %s %s" // CommonLogFormat : {host} {user-identifier} {auth-user-id} [{datetime}] "{method} {request} {protocol}" {response-code} {bytes} CommonLogFormat = "%s - %s [%s] \"%s %s %s\" %d %d" // JSONLogFormat : {"host": "{host}", "user-identifier": "{user-identifier}", "datetime": "{datetime}", "method": "{method}", "request": "{request}", "protocol": "{protocol}", "status", {status}, "bytes": {bytes}, "referer": "{referer}"} JSONLogFormat = `` /* 146-byte string literal not displayed */ // LogFmtLogFormat : host={host} user={user-identifier} timestamp={datetime} method={method} request="{request}" protocol={protocol} status={status} bytes={bytes} referer="{referer}" LogFmtLogFormat = `host="%s" user=%s timestamp=%s method=%s request="%s" protocol=%s status=%d bytes=%d referer="%s"` )
const ( Apache = "02/Jan/2006:15:04:05 -0700" ApacheError = "Mon Jan 02 15:04:05 2006" RFC3164 = "Jan 02 15:04:05" RFC5424 = "2006-01-02T15:04:05.000Z" CommonLog = "02/Jan/2006:15:04:05 -0700" )
Custom predefined layouts
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Flog ¶
type Flog struct {
// contains filtered or unexported fields
}
func (*Flog) NewApacheCombinedLog ¶
NewApacheCombinedLog creates a log string with apache combined log format
func (*Flog) NewApacheCommonLog ¶
NewApacheCommonLog creates a log string with apache common log format
func (*Flog) NewApacheErrorLog ¶
NewApacheErrorLog creates a log string with apache error log format
func (*Flog) NewCommonLogFormat ¶
NewCommonLogFormat creates a log string with common log format
func (*Flog) NewJSONLogFormat ¶
NewJSONLogFormat creates a log string with json log format
func (*Flog) NewLogFmtLogFormat ¶
NewLogFmtLogFormat creates a log string with logfmt log format
func (*Flog) NewRFC3164Log ¶
NewRFC3164Log creates a log string with syslog (RFC3164) format
func (*Flog) NewRFC5424Log ¶
NewRFC5424Log creates a log string with syslog (RFC5424) format
func (*Flog) RandAuthUserID ¶
RandAuthUserID generates a random auth user id
func (*Flog) RandHTTPVersion ¶
RandHTTPVersion returns a random http version
func (*Flog) RandResourceURI ¶
RandResourceURI generates a random resource URI