Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Daemonize ¶
func Daemonize() error
Daemonize detaches the process from the terminal and runs in the background This works on Unix-like systems (Linux, macOS)
func IsDaemonProcess ¶
func IsDaemonProcess() bool
IsDaemonProcess checks if the current process is running as a daemon
func NewLogger ¶
func NewLogger(cfg *LogRotationConfig) *lumberjack.Logger
NewLogger creates a new lumberjack logger with the given configuration
Types ¶
type LogRotationConfig ¶
type LogRotationConfig struct {
Filename string // Log file path
MaxSize int // Maximum size in megabytes
MaxBackups int // Maximum number of old log files to retain
MaxAge int // Maximum number of days to retain old log files
Compress bool // Compress old log files
}
LogRotationConfig holds configuration for log rotation
func DefaultLogRotationConfig ¶
func DefaultLogRotationConfig(logFile string) *LogRotationConfig
DefaultLogRotationConfig returns default log rotation settings
Click to show internal directories.
Click to hide internal directories.