-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #67 from scality/improvement/COSI-35-update-loggin…
…g-mechanism COSI-35: Improve Logging Clarity and Accuracy for Object Storage and IAM Operations
- Loading branch information
Showing
13 changed files
with
225 additions
and
174 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,9 @@ | ||
# Log levels define the verbosity of logs for various parts of the system. | ||
# Use these levels to control the detail included in the logs: | ||
# 1 - General configuration, routine logs | ||
# 2 - Steady-state operations, HTTP requests, system state changes (default) | ||
# 3 - Extended changes, additional system details | ||
# 4 - Debug-level logs, tricky logic areas | ||
# 5 - Trace-level logs, context for troubleshooting | ||
COSI_DRIVER_LOG_LEVEL=5 | ||
OBJECTSTORAGE_PROVISIONER_SIDECAR_LOG_LEVEL=5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,9 @@ | ||
# Log levels define the verbosity of logs for various parts of the system. | ||
# Use these levels to control the detail included in the logs: | ||
# 1 - General configuration, routine logs | ||
# 2 - Steady-state operations, HTTP requests, system state changes (default) | ||
# 3 - Extended changes, additional system details | ||
# 4 - Debug-level logs, tricky logic areas | ||
# 5 - Trace-level logs, context for troubleshooting | ||
COSI_DRIVER_LOG_LEVEL=5 | ||
OBJECTSTORAGE_PROVISIONER_SIDECAR_LOG_LEVEL=5 |
11 changes: 9 additions & 2 deletions
11
kustomize/overlays/production/scality-cosi-driver.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,9 @@ | ||
COSI_DRIVER_LOG_LEVEL=5 | ||
OBJECTSTORAGE_PROVISIONER_SIDECAR_LOG_LEVEL=5 | ||
# Log levels define the verbosity of logs for various parts of the system. | ||
# Use these levels to control the detail included in the logs: | ||
# 1 - General configuration, routine logs | ||
# 2 - Steady-state operations, HTTP requests, system state changes (default) | ||
# 3 - Extended changes, additional system details | ||
# 4 - Debug-level logs, tricky logic areas | ||
# 5 - Trace-level logs, context for troubleshooting | ||
COSI_DRIVER_LOG_LEVEL=2 | ||
OBJECTSTORAGE_PROVISIONER_SIDECAR_LOG_LEVEL=2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package constants | ||
|
||
// Log level constants for structured logging, starting from 1 | ||
// 0 is default if no level is provided | ||
// Guidelines: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-instrumentation/logging.md#what-method-to-use | ||
const ( | ||
LvlDefault = iota + 1 // 1 - General configuration, routine logs | ||
LvlInfo // 2 - Steady-state operations, HTTP requests, system state changes | ||
LvlEvent // 3 - Extended changes, additional system details | ||
LvlDebug // 4 - Debug-level logs, tricky logic areas | ||
LvlTrace // 5 - Trace-level logs, detailed troubleshooting context | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package constants_test | ||
|
||
import ( | ||
"testing" | ||
|
||
. "github.com/onsi/ginkgo/v2" // Ginkgo for test descriptions | ||
. "github.com/onsi/gomega" // Gomega for assertions | ||
"github.com/scality/cosi-driver/pkg/constants" // Import the constants package | ||
) | ||
|
||
func TestConstants(t *testing.T) { | ||
RegisterFailHandler(Fail) | ||
RunSpecs(t, "Constants Suite") | ||
} | ||
|
||
var _ = Describe("Constants", func() { | ||
Context("Log level constants", func() { | ||
It("should have the correct values for log levels", func() { | ||
Expect(constants.LvlDefault).To(Equal(1), "LvlDefault should start at 1") | ||
Expect(constants.LvlInfo).To(Equal(2), "LvlInfo should have the value 2") | ||
Expect(constants.LvlEvent).To(Equal(3), "LvlEvent should have the value 3") | ||
Expect(constants.LvlDebug).To(Equal(4), "LvlDebug should have the value 4") | ||
Expect(constants.LvlTrace).To(Equal(5), "LvlTrace should have the value 5") | ||
}) | ||
}) | ||
}) |
Oops, something went wrong.