You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2021/09/01 06:14:44 UTC

[GitHub] [dubbo-go] 63isOK opened a new issue #1427: 环境变量优化

63isOK opened a new issue #1427:
URL: https://github.com/apache/dubbo-go/issues/1427


   <!-- Please only use this template for submitting enhancement requests -->
   
   **What would you like to be added**:
   
   1. 日志初始化不要放在init. 是否可以考虑放在初始化函数中.
   2. 在纯client场景,是否可以考虑不需要处理server配置.
   
   > "unmarshalYmlConfig error ioutil.ReadFile(file:../profiles/dev/server.yml) = error:open ../profiles/dev/server.yml: no such file or directory"
   
   **Why is this needed**:
   
   1. 在自定义配置路径的场景,且通过os.Setenv来设置环境变量的场景下,必须在dubbogo包导入之前的init()中设置环境变量,否在会有warn.
   
   ```go
   func init() {
   	// forbidden to executing twice.
   	if logger != nil {
   		return
   	}
   
   	fs := flag.NewFlagSet("log", flag.ContinueOnError)
   	logConfFile := fs.String("logConf", os.Getenv(constant.APP_LOG_CONF_FILE), "default log config path")
   	fs.Parse(os.Args[1:])
   	for len(fs.Args()) != 0 {
   		fs.Parse(fs.Args()[1:])
   	}
   	if *logConfFile == "" {
   		*logConfFile = constant.DEFAULT_LOG_CONF_FILE_PATH
   	}
   	err := InitLog(*logConfFile)
   	if err != nil {
   		logger.Warnf("InitLog with error %v", err)
   	}
   }
   ```
   
   2. 去掉无意义的warn.


-- 
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


[GitHub] [dubbo-go] LaurenceLiZhixin closed issue #1427: 环境变量优化

Posted by GitBox <gi...@apache.org>.
LaurenceLiZhixin closed issue #1427:
URL: https://github.com/apache/dubbo-go/issues/1427


   


-- 
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


[GitHub] [dubbo-go] LaurenceLiZhixin commented on issue #1427: 环境变量优化

Posted by GitBox <gi...@apache.org>.
LaurenceLiZhixin commented on issue #1427:
URL: https://github.com/apache/dubbo-go/issues/1427#issuecomment-951499672


   https://github.com/apache/dubbo-go-samples/tree/master/logger


-- 
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


[GitHub] [dubbo-go] Mulavar commented on issue #1427: 环境变量优化

Posted by GitBox <gi...@apache.org>.
Mulavar commented on issue #1427:
URL: https://github.com/apache/dubbo-go/issues/1427#issuecomment-912551581


   与 #1415 反应的问题相同,目前 3.0 这边已经在着手做配置优化,后续会解决这个问题。


-- 
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