Documentation ¶
Index ¶
- Constants
- func CapitalLevelEncoder(l zapcore.Level, enc zapcore.PrimitiveArrayEncoder)
- func LogNameEncoder(loggerName string, enc zapcore.PrimitiveArrayEncoder)
- func NewLogger(opts ...slog.Option) (slog.BoxLogger, error)
- func ShortEncodeCaller(caller zapcore.EntryCaller, enc zapcore.PrimitiveArrayEncoder)
- type Options
- type SysLogConfig
- type SysLogOption
- type SysLogSyncer
Constants ¶
View Source
const (
MinSplitLogFileSize = 1024 * 1024
)
Variables ¶
This section is empty.
Functions ¶
func CapitalLevelEncoder ¶
func CapitalLevelEncoder(l zapcore.Level, enc zapcore.PrimitiveArrayEncoder)
func LogNameEncoder ¶
func LogNameEncoder(loggerName string, enc zapcore.PrimitiveArrayEncoder)
func ShortEncodeCaller ¶ added in v0.4.8
func ShortEncodeCaller(caller zapcore.EntryCaller, enc zapcore.PrimitiveArrayEncoder)
Types ¶
type SysLogConfig ¶ added in v0.5.17
type SysLogConfig struct {
// contains filtered or unexported fields
}
type SysLogOption ¶ added in v0.5.17
type SysLogOption func(*SysLogConfig)
func WithAddress ¶ added in v0.5.17
func WithAddress(addr string) SysLogOption
WithAddress 设置log server 地址,如/dev/log 或者 localhost:514 等
func WithNetwork ¶ added in v0.5.17
func WithNetwork(network string) SysLogOption
WithNetwork 设置连接类型 udp/tcp/unixgram/unix 等
func WithPriority ¶ added in v0.5.17
func WithPriority(priority syslog.Priority) SysLogOption
WithPriority 设置日志优先级
type SysLogSyncer ¶ added in v0.5.17
type SysLogSyncer struct {
// contains filtered or unexported fields
}
SysLogSyncer is a zapcore.WriteSyncer implementation that writes to syslog.
func NewSysLog ¶ added in v0.5.17
func NewSysLog(opts ...SysLogOption) (*SysLogSyncer, error)
func (*SysLogSyncer) Close ¶ added in v0.5.17
func (c *SysLogSyncer) Close() error
func (*SysLogSyncer) Sync ¶ added in v0.5.17
func (c *SysLogSyncer) Sync() error
Sync implements zap core.WriteSyncer interface.
Click to show internal directories.
Click to hide internal directories.