logger

package
v0.0.0-...-61b9b26 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(level, env, driver string, brokers []string, topic, rabbitURL, rabbitQueue, filePath string) *logrus.Logger

New creates a JSON structured logger at the specified level. Logs are sent to Kafka only when env is "production" and brokers are configured. New creates a JSON structured logger at the specified level. MQ driver can be "kafka" or "rabbitmq". File logging is enabled when env is not "production" and filePath is provided (or defaulted).

Types

type KafkaHook

type KafkaHook struct {
	// contains filtered or unexported fields
}

New creates a JSON structured logger at the specified level.

func (*KafkaHook) Fire

func (h *KafkaHook) Fire(e *logrus.Entry) error

Fire writes the log entry to Kafka.

func (*KafkaHook) Levels

func (h *KafkaHook) Levels() []logrus.Level

type RabbitMQHook

type RabbitMQHook struct {
	// contains filtered or unexported fields
}

func (*RabbitMQHook) Fire

func (h *RabbitMQHook) Fire(e *logrus.Entry) error

func (*RabbitMQHook) Levels

func (h *RabbitMQHook) Levels() []logrus.Level

Jump to

Keyboard shortcuts

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