Skip to content
Snippets Groups Projects
Commit c6982843 authored by Albumen's avatar Albumen
Browse files

feat(config_center/nacos): make logDir can be changed by config file

parent 2f1c2194
No related branches found
No related tags found
No related merge requests found
......@@ -119,6 +119,7 @@ const (
CONFIG_CLUSTER_KEY = "config.cluster"
CONFIG_CHECK_KEY = "config.check"
CONFIG_TIMEOUT_KET = "config.timeout"
CONFIG_LOG_DIR_KEY = "config.logDir"
CONFIG_VERSION_KEY = "configVersion"
COMPATIBLE_CONFIG_KEY = "compatible_config"
)
......
......@@ -46,6 +46,7 @@ type ConfigCenterConfig struct {
Group string `default:"dubbo" yaml:"group" json:"group,omitempty"`
Username string `yaml:"username" json:"username,omitempty"`
Password string `yaml:"password" json:"password,omitempty"`
LogDir string `yaml:"log_dir" json:"log_dir,omitempty"`
ConfigFile string `default:"dubbo.properties" yaml:"config_file" json:"config_file,omitempty"`
Namespace string `default:"dubbo" yaml:"namespace" json:"namespace,omitempty"`
AppConfigFile string `default:"dubbo.properties" yaml:"app_config_file" json:"app_config_file,omitempty"`
......@@ -73,5 +74,6 @@ func (c *ConfigCenterConfig) GetUrlMap() url.Values {
urlMap.Set(constant.CONFIG_GROUP_KEY, c.Group)
urlMap.Set(constant.CONFIG_CLUSTER_KEY, c.Cluster)
urlMap.Set(constant.CONFIG_APP_ID_KEY, c.AppId)
urlMap.Set(constant.CONFIG_LOG_DIR_KEY, c.LogDir)
return urlMap
}
......@@ -51,6 +51,7 @@ type NacosClient struct {
onceClose func()
}
// init default Nacos Log dir, it can be override when create client
func init() {
switch runtime.GOOS {
case "windows":
......@@ -97,6 +98,7 @@ func ValidateNacosClient(container nacosClientFacade, opts ...option) error {
}
url := container.GetUrl()
logDir = url.GetParam(constant.CONFIG_LOG_DIR_KEY, logDir)
if container.NacosClient() == nil {
//in dubbo ,every registry only connect one node ,so this is []string{r.Address}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment