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

refine log stdout #498

Merged
merged 1 commit into from
Aug 6, 2022
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
2 changes: 1 addition & 1 deletion clients/config_client/config_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func NewConfigClient(nc nacos_client.INacosClient) (*ConfigClient, error) {
LogRollingConfig: clientConfig.LogRollingConfig,
LogDir: clientConfig.LogDir,
CustomLogger: clientConfig.CustomLogger,
LogStdout: clientConfig.LogStdout,
LogStdout: clientConfig.AppendToStdout,
}
err = logger.InitLogger(loggerConfig)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion clients/naming_client/naming_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func NewNamingClient(nc nacos_client.INacosClient) (NamingClient, error) {
LogRollingConfig: clientConfig.LogRollingConfig,
LogDir: clientConfig.LogDir,
CustomLogger: clientConfig.CustomLogger,
LogStdout: clientConfig.LogStdout,
LogStdout: clientConfig.AppendToStdout,
}
err = logger.InitLogger(loggerConfig)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion common/constant/client_config_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,6 @@ func WithLogRollingConfig(rollingConfig *lumberjack.Logger) ClientOption {
// WithLogStdout ...
func WithLogStdout(logStdout bool) ClientOption {
return func(config *ClientConfig) {
config.LogStdout = logStdout
config.AppendToStdout = logStdout
}
}
2 changes: 1 addition & 1 deletion common/constant/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,5 @@ type ClientConfig struct {
ContextPath string // the nacos server contextpath
LogRollingConfig *lumberjack.Logger // the log rolling config
CustomLogger logger.Logger // the custom log interface ,With a custom Logger (nacos sdk will not provide log cutting and archiving capabilities)
LogStdout bool // the stdout redirect for log, default is false
AppendToStdout bool // append log to stdout
}
2 changes: 1 addition & 1 deletion example/config/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func main() {
LogDir: "/tmp/nacos/log",
CacheDir: "/tmp/nacos/cache",
LogLevel: "debug",
LogStdout: true,
AppendToStdout: true,
}
//or a more graceful way to create ClientConfig
_ = *constant.NewClientConfig(
Expand Down
2 changes: 1 addition & 1 deletion example/service/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func main() {
CacheDir: "/tmp/nacos/cache",
LogRollingConfig: &lumberjack.Logger{MaxSize: 10},
LogLevel: "debug",
LogStdout: true,
AppendToStdout: true,
}
//or a more graceful way to create ClientConfig
_ = *constant.NewClientConfig(
Expand Down