引入lumberjack和fluentbit自动分发
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user