From 16cd84c56644163f44d3e98c57a1028892dec923 Mon Sep 17 00:00:00 2001 From: Pingping Lin Date: Fri, 20 Aug 2021 10:51:13 -0500 Subject: [PATCH] disable logs to unwanted file --- logger/logger.go | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/logger/logger.go b/logger/logger.go index a641bd5..4fcc6a6 100644 --- a/logger/logger.go +++ b/logger/logger.go @@ -1,14 +1,16 @@ +// SPDX-FileCopyrightText: 2021 Open Networking Foundation +// +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0 + package logger import ( - "os" "time" formatter "github.com/antonfisher/nested-logrus-formatter" "github.com/sirupsen/logrus" - "github.com/free5gc/logger_conf" - "github.com/free5gc/logger_util" ) var ( @@ -38,15 +40,6 @@ func init() { FieldsOrder: []string{"component", "category"}, } - free5gcLogHook, err := logger_util.NewFileHook(logger_conf.Free5gcLogFile, os.O_CREATE|os.O_APPEND|os.O_RDWR, 0o666) - if err == nil { - log.Hooks.Add(free5gcLogHook) - } - - selfLogHook, err := logger_util.NewFileHook(logger_conf.NfLogDir+"nssf.log", os.O_CREATE|os.O_APPEND|os.O_RDWR, 0o666) - if err == nil { - log.Hooks.Add(selfLogHook) - } AppLog = log.WithFields(logrus.Fields{"component": "NSSF", "category": "App"}) ContextLog = log.WithFields(logrus.Fields{"component": "NSSF", "category": "CTX"})