package
9.0.0-alpha+incompatible
Repository: https://github.com/pingcap/tidb.git
Documentation: pkg.go.dev
# Functions
BgLogger is alias of `logutil.BgLogger()`.
ErrVerboseLogger returns a logger that always output error verbose regardless of the log config.
Event records event in current tracing span.
Eventf records event in current tracing span with format support.
Hex defines a fmt.Stringer for proto.Message.
InitLogger initializes a logger with cfg.
LogEnvVariables logs related environment variables.
Logger gets a contextual logger from current context.
LoggerWithTraceInfo attaches fields from trace info to logger.
NewFileLogConfig creates a FileLogConfig.
NewLogConfig creates a LogConfig.
ReplaceLogger replace global logger instance with given log config.
SampleLoggerFactory returns a factory function that creates a sample logger.
SetLevel sets the zap logger's level.
SetTag sets tag kv-pair in current tracing span.
WithCategory attaches category to context.
WithConnID attaches connId to context.
WithFields attaches key/value to context.
WithKeyValue attaches key/value to context.
WithSessionAlias attaches session_alias to context.
WithTraceFields attaches trace fields to context.
WithTraceLogger attaches trace identifier to context.
# Constants
DefaultLogFormat is the default format of the log.
MB.
DefaultQueryLogMaxLen is the default max length of the query in the log.
DefaultRecordPlanInSlowLog is the default value for whether enable log query plan in the slow log.
DefaultSlowThreshold is the default slow log threshold in millisecond.
DefaultSlowTxnThreshold is the default slow txn log threshold in ms.
DefaultTiDBEnableSlowLog enables TiDB to log slow queries.
GRPCDebugEnvName is the environment variable name for GRPC_DEBUG.
LogFieldCategory is the field name for log category.
LogFieldConn is the field name for connection id in log.
LogFieldSessionAlias is the field name for session_alias in log.
OldSlowLogTimeFormat is the first version of the the time format for slow log, This is use for compatibility.
SlowLogTimeFormat is the time format for slow log.
TraceEventKey presents the TraceEventKey in span log.
# Variables
CtxLogKey indicates the context key for logger public for test usage.
EmptyFileLogConfig is an empty FileLogConfig.
GeneralLogger is used to log general log, InitLogger will modify it according to config file.
SlowQueryLogger is used to log slow query, InitLogger will modify it according to config file.
# Structs
FileLogConfig serializes file log related config in toml/json.
LogConfig serializes log related config in toml/json.