引入lumberjack和fluentbit自动分发

This commit is contained in:
robin
2026-02-13 22:36:17 +08:00
parent c6da67db79
commit e9093baffb
47 changed files with 4589 additions and 317 deletions

View File

@@ -577,7 +577,7 @@ func (this *Node) listenSignals() {
goman.New(func() {
for sig := range queue {
if sig == syscall.SIGHUP {
// 供 logrotate 等旋转日志后重开句柄
// 兼容 SIGHUP重建本地日志 writer
if err := accesslogs.SharedFileWriter().Reopen(); err != nil {
remotelogs.Error("NODE", "access log file reopen: "+err.Error())
}
@@ -890,6 +890,7 @@ func (this *Node) onReload(config *nodeconfigs.NodeConfig, reloadAll bool) {
var accessLogFilePath string
if config != nil && config.GlobalServerConfig != nil {
accessLogFilePath = config.GlobalServerConfig.HTTPAccessLog.FilePath
accesslogs.SharedFileWriter().SetRotateConfig(config.GlobalServerConfig.HTTPAccessLog.Rotate)
}
accesslogs.SharedFileWriter().SetDirByPolicyPath(accessLogFilePath)