-
Notifications
You must be signed in to change notification settings - Fork 8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configuring csp.sentinel.log.dir through the configuration file does not work #812
Comments
Configuring csp.sentinel.log.dir through the configuration file does not workIssue DescriptionType: bug report or feature request Describe what happened (or what feature you want)When I am based on [wiki documentation] (https://github.com/alibaba/Sentinel/wiki/%E5%90%AF%E5%8A%A8%E9%85%8D%E7%BD%AE%E9%A1 %B9) When csp.sentinel.log.dir is configured using the Describe what you expected to happenFirst, you can see the source code of the SentinelConfig class. When the static code block is executed after the class is loaded, it will execute
Therefore, the configuration will not take effect, so calling LogBase.getLogBaseDir() directly in How to reproduce it (as minimally and precisely as possible)
Tell us your environmentThe latest master (2019-06-05) Anything else we need to know? |
Hi,目前 It's not supported to configure the log directory via |
👌,我看wiki文档可以update一下,上面描述只是project.name不支持。 |
Thanks for your suggestion. I've updated the wiki document :) |
[RIP-9]Add English docs of architecture
Issue Description
Type: bug report or feature request
Describe what happened (or what feature you want)
当我根据wiki文档使用
${user_home}/logs/csp/${project.name}.properties
配置文件的方式配置csp.sentinel.log.dir时,该配置不会生效。Describe what you expected to happen
首先,可以看到SentinelConfig这个class的源码,在类被加载后执行static代码块的时候,会执行
com/alibaba/csp/sentinel/config/SentinelConfig.java:65
处对,配置文件和jvm参数中的配置读取,并且设置进com.alibaba.csp.sentinel.config.SentinelConfig#props
中,但是注意com/alibaba/csp/sentinel/config/SentinelConfig.java:109
获取配置文件的fileName时,是调用com.alibaba.csp.sentinel.log.LogBase#getLogBaseDir
获取配置文件的目录,而查看类LogBase在执行static代码块的时候,会执行com.alibaba.csp.sentinel.log.LogBase#init
,其中com.alibaba.csp.sentinel.log.LogBase#logBaseDir
的值只会使用两种方式得到:所以,该配置必然不会生效,所以,在
com.alibaba.csp.sentinel.config.SentinelConfig#loadProps
中直接调用LogBase.getLogBaseDir()获取log dir必然是有问题的。How to reproduce it (as minimally and precisely as possible)
${user_home}/logs/csp/${project.name}.properties
配置文件的方式配置csp.sentinel.log.dirTell us your environment
最新master(2019-06-05)
Anything else we need to know?
The text was updated successfully, but these errors were encountered: