-
Notifications
You must be signed in to change notification settings - Fork 351
/
doc.go
49 lines (36 loc) · 1.77 KB
/
doc.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
Package logging implements application log instrumentation and Apache
combined access log.
Application Log
The application log uses the logrus package:
https://github.com/sirupsen/logrus
To send messages to the application log, import this package and use its
methods. Example:
import log "github.com/sirupsen/logrus"
func doSomething() {
log.Errorf("nothing to do")
}
During startup initialization, it is possible to redirect the log output
from the default /dev/stderr to another file, and to set a common
prefix for each log entry. Setting the prefix may be a good idea when
the access log is enabled and its output is the same as the one of the
application log, to make it easier to split the output for diagnostics.
Access Log
The access log prints HTTP access information in the Apache combined
access log format. To output entries, use the logging.Access method.
Note that by default, skipper uses the loggingHandler to wrap the
central proxy handler, and automatically provides access logging.
During initialization, it is possible to redirect the access log output
from the default /dev/stderr to another file, or completely disable the
access log.
A special key in the StateBag (accessLog.AccessLogAdditionalDataKey) is exposed
so filters can add more data to the access log files. When using the feature, any data
contained in a map[string]interface{} in the StateBag's key will be passed to the logger.
This is specially useful when more request/response information is needed when logging.
Output Files
To set a custom file output for the application log or the access log is
currently not recommended in production environment, because neither the
proper handling of system errors, or a log rolling mechanism is
implemented at the current stage.
*/
package logging