diff --git a/config_center/nacos/client.go b/config_center/nacos/client.go index 7110a7c63342ee468cb8cc78ff1a219d3d30e9fb..0458e148917be1fbfe5d397f7f5d604756af836f 100644 --- a/config_center/nacos/client.go +++ b/config_center/nacos/client.go @@ -19,6 +19,8 @@ import ( "github.com/apache/dubbo-go/common/logger" ) +const logDir = "logs/nacos/log" + // NacosClient Nacos client type NacosClient struct { name string @@ -111,7 +113,7 @@ func ValidateNacosClient(container nacosClientFacade, opts ...option) error { TimeoutMs: uint64(int32(container.NacosClient().Timeout / time.Millisecond)), ListenInterval: 10000, NotLoadCacheAtStart: true, - LogDir: "logs/nacos/log", + LogDir: logDir, }, }) @@ -159,7 +161,7 @@ func newNacosClient(name string, nacosAddrs []string, timeout time.Duration) (*N TimeoutMs: uint64(timeout / time.Millisecond), ListenInterval: 20000, NotLoadCacheAtStart: true, - LogDir: "logs/nacos/log", + LogDir: logDir, }, }) n.SetClient(&client) diff --git a/config_center/nacos/client_test.go b/config_center/nacos/client_test.go index d661c49ceb20e3d34930840483c746020ea2faab..6408b244d6d4f3bb945a67e95dc187b367608740 100644 --- a/config_center/nacos/client_test.go +++ b/config_center/nacos/client_test.go @@ -22,7 +22,7 @@ func Test_newNacosClient(t *testing.T) { url: ®istryUrl, done: make(chan struct{}), } - err := ValidateNacosClient(c, WithNacosName(NacosClientName)) + err := ValidateNacosClient(c, WithNacosName(nacosClientName)) if err != nil { fmt.Println("nacos client start error ,error message is", err) }