Documentation ¶
Overview ¶
Package logger provides logger for Easegress.
Index ¶
- Constants
- func APIAccess(method, remoteAddr, path string, code int, ...)
- func Debugf(template string, args ...interface{})
- func Errorf(template string, args ...interface{})
- func EtcdClientLoggerConfig(opt *option.Options, filename string) *zap.Config
- func GetLogLevel() string
- func GetLogPath() string
- func HTTPAccess(template string, args ...interface{})
- func Infof(template string, args ...interface{})
- func Init(opt *option.Options)
- func InitMock()
- func InitNop()
- func LazyDebug(fn func() string)
- func LazyHTTPAccess(fn func() string)
- func MustNewPlainLogger(opt *option.Options, filename string, maxCacheCount uint32) *zap.SugaredLogger
- func NginxHTTPAccess(remoteAddr, proto, method, path, referer, agent, realIP string, code int, ...)
- func SetLogLevel(level zapcore.Level)
- func SpanDebugf(context *model.SpanContext, template string, args ...interface{})
- func SpanErrorf(context *model.SpanContext, template string, args ...interface{})
- func Sync()
- func Warnf(template string, args ...interface{})
Constants ¶
const (
// EtcdClientFilename is the filename of etcd client log.
EtcdClientFilename = "etcd_client.log"
)
Variables ¶
This section is empty.
Functions ¶
func APIAccess ¶
func APIAccess( method, remoteAddr, path string, code int, bodyBytedReceived, bodyBytesSent int64, requestTime time.Time, processTime time.Duration)
APIAccess logs admin api log.
func Debugf ¶
func Debugf(template string, args ...interface{})
Debugf is the wrapper of default logger Debugf.
func Errorf ¶
func Errorf(template string, args ...interface{})
Errorf is the wrapper of default logger Errorf.
func EtcdClientLoggerConfig ¶
EtcdClientLoggerConfig generates the config of etcd client logger.
func GetLogPath ¶ added in v2.6.1
func GetLogPath() string
GetLogPath returns the path of stdout log.
func HTTPAccess ¶
func HTTPAccess(template string, args ...interface{})
HTTPAccess logs http access log.
func Infof ¶
func Infof(template string, args ...interface{})
Infof is the wrapper of default logger Infof.
func InitMock ¶
func InitMock()
InitMock initializes all logger to print stdout, mainly for unit testing
func LazyDebug ¶
func LazyDebug(fn func() string)
LazyDebug logs debug log in lazy mode. if debug log is disabled by configuration, it skips the the built of log message to improve performance
func LazyHTTPAccess ¶
func LazyHTTPAccess(fn func() string)
LazyHTTPAccess logs http access log in lazy mode, if http access log is disabled by configuration, it skips the the built of log message to improve performance
func MustNewPlainLogger ¶ added in v2.7.1
func MustNewPlainLogger(opt *option.Options, filename string, maxCacheCount uint32) *zap.SugaredLogger
MustNewPlainLogger creates a plain logger, it panics if any error occurs.
func NginxHTTPAccess ¶
func NginxHTTPAccess(remoteAddr, proto, method, path, referer, agent, realIP string, code int, bodyBytesSent int64, requestTime time.Duration, upstreamResponseTime time.Duration, upstreamAddr string, upstreamCode int, clientWriteBodyTime, clientReadBodyTime, routeTime time.Duration)
NginxHTTPAccess is DEPRECATED, replaced by HTTPAccess.
func SetLogLevel ¶ added in v2.6.3
SetLogLevel sets log level. Only support debug and info.
func SpanDebugf ¶
func SpanDebugf(context *model.SpanContext, template string, args ...interface{})
SpanDebugf is the wrapper of default logger Debugf to log tracing message
func SpanErrorf ¶
func SpanErrorf(context *model.SpanContext, template string, args ...interface{})
SpanErrorf is the wrapper of default logger Debugf to log tracing message
Types ¶
This section is empty.