You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "zhaoyunxing92 (via GitHub)" <gi...@apache.org> on 2023/04/09 14:48:05 UTC
[GitHub] [dubbo-go] zhaoyunxing92 commented on a diff in pull request #2282: Enhance logger
zhaoyunxing92 commented on code in PR #2282:
URL: https://github.com/apache/dubbo-go/pull/2282#discussion_r1161297588
##########
config/logger_config.go:
##########
@@ -18,163 +18,159 @@
package config
import (
- "net/url"
-)
+ "fmt"
+ "strconv"
-import (
getty "github.com/apache/dubbo-getty"
-
"github.com/creasty/defaults"
-
- "github.com/dubbogo/gost/encoding/yaml"
"github.com/dubbogo/gost/log/logger"
- "github.com/natefinch/lumberjack"
-
- "go.uber.org/zap"
- "go.uber.org/zap/zapcore"
-)
-
-import (
+ "dubbo.apache.org/dubbo-go/v3/common"
"dubbo.apache.org/dubbo-go/v3/common/constant"
+ "dubbo.apache.org/dubbo-go/v3/common/extension"
)
-type ZapConfig struct {
- Level string `default:"info" json:"level,omitempty" yaml:"level" property:"level"`
- Development bool `default:"false" json:"development,omitempty" yaml:"development" property:"development"`
- DisableCaller bool `default:"false" json:"disable-caller,omitempty" yaml:"disable-caller" property:"disable-caller"`
- DisableStacktrace bool `default:"false" json:"disable-stacktrace,omitempty" yaml:"disable-stacktrace" property:"disable-stacktrace"`
- Encoding string `default:"console" json:"encoding,omitempty" yaml:"encoding" property:"encoding"`
- EncoderConfig EncoderConfig `default:"" json:"encoder-config,omitempty" yaml:"encoder-config" property:"encoder-config"`
- OutputPaths []string `default:"[\"stderr\"]" json:"output-paths,omitempty" yaml:"output-paths" property:"output-paths"`
- ErrorOutputPaths []string `default:"[\"stderr\"]" json:"error-output-paths,omitempty" yaml:"error-output-paths" property:"error-output-paths"`
- InitialFields map[string]interface{} `default:"" json:"initial-fields,omitempty" yaml:"initial-fields" property:"initial-fields"`
-}
-
type LoggerConfig struct {
- LumberjackConfig *lumberjack.Logger `yaml:"lumberjack-config" json:"lumberjack-config,omitempty" property:"lumberjack-config"`
- ZapConfig ZapConfig `yaml:"zap-config" json:"zap-config,omitempty" property:"zap-config"`
+ // logger driver default zap
+ Driver string `default:"zap" yaml:"driver"`
Review Comment:
I don't think it should be stated here,because it is not a certain ,can be customized.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org