From 4b98b87af109c09392bc0f7d75815a7e654372e5 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Wed, 10 Apr 2024 11:25:51 +0300 Subject: [PATCH 1/2] [#41] log: Log storage operations in only in Debug They are mostly useless unless we need to _debug_ a specific issue. The amount of logs we produce is too big. Signed-off-by: Evgenii Stratonikov --- pkg/local_object_storage/internal/log/log.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/local_object_storage/internal/log/log.go b/pkg/local_object_storage/internal/log/log.go index 82024ffa7..6272067d3 100644 --- a/pkg/local_object_storage/internal/log/log.go +++ b/pkg/local_object_storage/internal/log/log.go @@ -10,7 +10,7 @@ const headMsg = "local object storage operation" // Write writes message about storage engine's operation to logger. func Write(logger *logger.Logger, fields ...zap.Field) { - logger.Info(headMsg, fields...) + logger.Debug(headMsg, fields...) } // AddressField returns logger's field for object address. -- 2.45.2 From 245575bee9e2e19664900c794b14b3039ddf3569 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Wed, 10 Apr 2024 11:32:35 +0300 Subject: [PATCH 2/2] [#1085] log: Move storage log message to constants package Signed-off-by: Evgenii Stratonikov --- internal/logs/logs.go | 1 + pkg/local_object_storage/internal/log/log.go | 6 ++---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/internal/logs/logs.go b/internal/logs/logs.go index d56d425ce..bd67217c4 100644 --- a/internal/logs/logs.go +++ b/internal/logs/logs.go @@ -201,6 +201,7 @@ const ( SubscriberCantCastBlockEventValueToBlock = "can't cast block event value to block" SubscriberCantCastNotifyEventValueToTheNotaryRequestStruct = "can't cast notify event value to the notary request struct" SubscriberUnsupportedNotificationFromTheChain = "unsupported notification from the chain" + StorageOperation = "local object storage operation" BlobovniczaCreatingDirectoryForBoltDB = "creating directory for BoltDB" BlobovniczaOpeningBoltDB = "opening BoltDB" BlobovniczaInitializing = "initializing..." diff --git a/pkg/local_object_storage/internal/log/log.go b/pkg/local_object_storage/internal/log/log.go index 6272067d3..23740868d 100644 --- a/pkg/local_object_storage/internal/log/log.go +++ b/pkg/local_object_storage/internal/log/log.go @@ -1,16 +1,14 @@ package storagelog import ( + "git.frostfs.info/TrueCloudLab/frostfs-node/internal/logs" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/util/logger" "go.uber.org/zap" ) -// headMsg is a distinctive part of all messages. -const headMsg = "local object storage operation" - // Write writes message about storage engine's operation to logger. func Write(logger *logger.Logger, fields ...zap.Field) { - logger.Debug(headMsg, fields...) + logger.Debug(logs.StorageOperation, fields...) } // AddressField returns logger's field for object address. -- 2.45.2