Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func Rotate ¶
func Rotate(options RotateOptions) io.WriteCloser
Types ¶
type Logger ¶
type Logger struct {
*RotateOptions `json:",inline" yaml:",inline"`
Stderr *RotateOptions `json:"stderr,omitempty" yaml:"stderr,omitempty"`
Stdout *RotateOptions `json:"stdout,omitempty" yaml:"stdout,omitempty"`
}
type LoggerFactory ¶
type LoggerFactory struct {
// contains filtered or unexported fields
}
func (LoggerFactory) Close ¶
func (f LoggerFactory) Close() error
func (LoggerFactory) Create ¶
func (f LoggerFactory) Create(options ...*RotateOptions) io.Writer
type Options ¶
type Options struct {
Execute string `json:"execute,omitempty" yaml:"execute,omitempty"`
Args []string `json:"args,omitempty" yaml:"args,omitempty"`
Dir string `json:"dir,omitempty" yaml:"dir,omitempty"`
Env []string `json:"env,omitempty" yaml:"env,omitempty"`
RestartDelay time.Duration `json:"restart_delay,omitempty" yaml:"restart_delay,omitempty"`
Logger *Logger `json:"logger,omitempty" yaml:"logger,omitempty"`
PreStart []func(c *exec.Cmd) error `json:"-" yaml:"-"`
}
type Result ¶
type RotateOptions ¶
type RotateOptions struct {
Path string `json:"path,omitempty" yaml:"path,omitempty"` // 文件路径
Std string `json:"std,omitempty" yaml:"std,omitempty"` // 标准输出
MaxSize int64 `json:"max_size,omitempty" yaml:"max_size,omitempty"` // 单文件最大大小
MaxBackups int `json:"max_backups,omitempty" yaml:"max_backups,omitempty"` // 最大备份文件数量
}
Click to show internal directories.
Click to hide internal directories.