Skip to content

Commit

Permalink
refine log stdout (#498)
Browse files Browse the repository at this point in the history
binbin0325 authored Aug 6, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent dec3976 commit 56bbfcf
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion clients/config_client/config_client.go
Original file line number Diff line number Diff line change
@@ -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 {
2 changes: 1 addition & 1 deletion clients/naming_client/naming_client.go
Original file line number Diff line number Diff line change
@@ -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 {
2 changes: 1 addition & 1 deletion common/constant/client_config_options.go
Original file line number Diff line number Diff line change
@@ -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
@@ -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
@@ -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(
2 changes: 1 addition & 1 deletion example/service/main.go
Original file line number Diff line number Diff line change
@@ -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(

0 comments on commit 56bbfcf

Please sign in to comment.