Documentation ¶
Overview ¶
Package a5glogs by chi example <https://github.com/pressly/chi/blob/master/_examples/logging/main.go>
Index ¶
- func DirectoryAndLogName(logPath string, fileExcludeRegexp *regexp.Regexp) (string, string, error)
- func LogEntrySetField(r *http.Request, key string, value fmt.Stringer)
- func LogEntrySetFields(r *http.Request, a ...a5gfields.Field)
- func NewChiLogger(l Logger) func(next http.Handler) http.Handler
- func NewMGOOutputer(l Logger) (*mgoOutputer, error)
- func PartitionedPathByUserID(i int64) (string, error)
- type DummyHealth
- func (l *DummyHealth) Event(eventName string)
- func (l *DummyHealth) EventErr(eventName string, err error) error
- func (l *DummyHealth) EventErrKv(eventName string, err error, m map[string]string) error
- func (l *DummyHealth) EventKv(eventName string, m map[string]string)
- func (l *DummyHealth) Timing(eventName string, nanoSeconds int64)
- func (l *DummyHealth) TimingKv(eventName string, nanoSeconds int64, m map[string]string)
- type Logger
- type MGOOutputer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DirectoryAndLogName ¶
func NewMGOOutputer ¶
func PartitionedPathByUserID ¶
PartitionedPathByUserID produces path "000/000/001" for id 1. You may use this to generate path like: "/var/log/appname/123/456/789/123456789/your.log". <https://gist.github.com/xlab/6e204ef96b4433a697b3>
Types ¶
type DummyHealth ¶
type DummyHealth struct{ Logger Logger }
func NewDummyHealth ¶
func NewDummyHealth(l Logger) (*DummyHealth, error)
func (*DummyHealth) Event ¶
func (l *DummyHealth) Event(eventName string)
func (*DummyHealth) EventErrKv ¶
func (*DummyHealth) Timing ¶
func (l *DummyHealth) Timing(eventName string, nanoSeconds int64)
type Logger ¶
type Logger interface { With(...a5gfields.Field) Logger Debug(string, ...a5gfields.Field) Info(string, ...a5gfields.Field) Warn(string, ...a5gfields.Field) Error(string, ...a5gfields.Field) Panic(string, ...a5gfields.Field) Fatal(string, ...a5gfields.Field) }
func GetLogEntry ¶
func NewLogrusWrapper ¶
type MGOOutputer ¶
Click to show internal directories.
Click to hide internal directories.