Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid printing logs to console when both the log levels of observability are set to none #316

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
- Allow the collector run in the non-Kubernetes environment by setting the option `enable` `false` under the `k8smetadataprocessor` section. ([#285](https://github.com/CloudDectective-Harmonycloud/kindling/pull/285))
- Add a new environment variable: IS_PRINT_EVENT. When the value is true, sinsp events can be printed to the stdout. ([#283](https://github.com/CloudDectective-Harmonycloud/kindling/pull/283))
- Declare the 9500 port in the agent's deployment file ([#282](https://github.com/CloudDectective-Harmonycloud/kindling/pull/282))
### Bug fixes
### Bug fixes
- Avoid printing logs to console when both `observability.logger.file_level` and `observability.logger.console_level` are set to none([#316](https://github.com/CloudDectective-Harmonycloud/kindling/pull/316))
- Fix the userAttributes array out of range error caused by userAttNumber exceeding 8
- Fix the bug where no HTTP headers were got. ([#301](https://github.com/CloudDectective-Harmonycloud/kindling/pull/301))
- Fix the bug that need_trace_as_span options cannot take effect ([#292](https://github.com/CloudDectective-Harmonycloud/kindling/pull/292))
Expand Down
4 changes: 2 additions & 2 deletions collector/pkg/observability/logger/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ func InitLogger(config Config) *zap.Logger {
logger.Sugar().Infof("Log Initialize Success! ConsoleLevel: %s,FileRotationLevel: %s", consoleLogLevel.String(), "none")
return logger
} else {
// By default, the console at the Info level is used to record logs
consoleLogLevel = zapcore.InfoLevel
// Both none, only record the panic log to console
consoleLogLevel = zapcore.DPanicLevel
logger := CreateConsoleLogger()
logger.Sugar().Infof("Log Initialize Success! ConsoleLevel: %s,FileRotationLevel: %s", consoleLogLevel.String(), "none")
return logger
Expand Down
22 changes: 0 additions & 22 deletions collector/pkg/observability/logger/logger_test.go

This file was deleted.