Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Daemonize ¶
Daemonize detaches the process from the terminal and runs it in the background by re-executing the current command as a detached child (session leader on Unix, detached process on Windows) and exiting the parent.
overrideArgs pins flags the parent resolved (e.g. "--port", "9000") so the detached child binds exactly what the parent decided instead of re-resolving its own command line. See buildDaemonArgs.
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