postlog

package
v2.0.18 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: MIT Imports: 22 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const MongoSinkName = "mongodb"

MongoSinkName 内置 MongoDB 落库 handler 的注册名。

Variables

This section is empty.

Functions

func Close added in v2.0.5

func Close()

Close 停止全部日志处理器并尽力排空队列,进程退出前调用(mgin.SafeExit 已内置调用)。

func RegisterHandler added in v2.0.5

func RegisterHandler(h logsink.Handler, opts ...logsink.Option) error

RegisterHandler 挂接一个接口日志处理器,等价于 logsink.Register。 外部插件(mgkafka、elasticsearch 插件等)或业务代码在应用启动时调用即可接收全量接口日志。

postlog.RegisterHandler(logsink.NewHandlerFunc("kafka", func(e *logsink.Entry) error {
    return mgkafka.Kafka.Send(topic, utils.ToJSON(e))
}))

func RequestLogger

func RequestLogger() gin.HandlerFunc

Types

This section is empty.

Jump to

Keyboard shortcuts

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