logger

package
v1.0.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 26, 2025 License: Apache-2.0 Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	LogReportCaller  = false            // LogReportCaller determines whether the logger includes caller information (file and line number) in log messages.
	LumberjackLogger *lumberjack.Logger // LumberjackLogger is initialized as the default rotating logger for log file management via DefaultLumberjackLogger.
	Formatter        log.Formatter      // Formatter defines the formatter used for structuring log messages.
)

Functions

func DefaultLumberjackLogger

func DefaultLumberjackLogger() *lumberjack.Logger

DefaultLumberjackLogger returns a configured Lumberjack logger instance. The logger is used for managing file-based log rotation. Configuration:

  • Filename: Path to the log file for writing logs.
  • MaxSize: Maximum size of a log file in MB before rotation occurs.
  • MaxBackups: Maximum number of old log files to retain.
  • MaxAge: Maximum number of days old log files are retained.
  • Compress: Specifies whether to compress old log files.

func LogSetup

func LogSetup()

LogSetup initializes the logging system by creating a log file and starting a monitoring routine for file rotation. Default:

  • LumberjackLogger used as default. You can also change it

func NestedLogFormatter

func NestedLogFormatter() *nested.Formatter

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL