如何解决无法使用application.properties修改前哨日志路径
我使用此配置在csp.sentinel.log.dir
中修改application.properties
:
spring:
cloud:
sentinel:
log:
dir: F:/abc
java代码:
package com.example.test_sen;
import com.alibaba.csp.sentinel.Entry;
import com.alibaba.csp.sentinel.SphU;
import com.alibaba.csp.sentinel.slots.block.BlockException;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import com.example.test_sen.wo.FlowQpsDemo;
@SpringBootApplication
public class TestSenApplication {
public static void main(String[] args) {
SpringApplication.run(TestSenApplication.class,args);
FlowQpsDemo.initFlowRules();
while (true) {
Entry entry = null;
try {
entry = SphU.entry("HelloWorld");
System.out.println("hello world");
} catch (BlockException e1) {
System.out.println("block!");
} finally {
if (entry != null) {
entry.exit();
}
}
}
}
}
但是日志路径始终为${user.home}/logs/csp/
,哪里出错了?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。