springbootadmin404问题
使⽤spring boot admin查看在线⽇志遇到的404问题
问题描述:项⽬中因为兼容问题 2.1.6版本启动不了。最终使⽤的2.3.0版本。发现配置了
logging:
file:
name: E:\\log\\system/info-system.log
之后,出现了⽇志⽂件菜单,但是显⽰404 not found。
⽹上处理⽅法(logging.path,logging.file,logging.file.name,logging.file.path)依旧⾏不通。最后还是翻源码靠谱啊。
答案:
public ConditionOutcome getMatchOutcome(ConditionContext context, AnnotatedTypeMetadata metadata){
Environment environment = Environment();
String config =LogFileConfig(environment,"logging.file.name","logging.file");
404页面网站源码Builder message = ConditionMessage.forCondition("Log File",new Object[0]);
if(StringUtils.hasText(config)){
return ConditionOutcome.match(message.found("logging.file.name").items(new Object[]{config}));
}else{
config =LogFileConfig(environment,"logging.file.path","logging.path");
if(StringUtils.hasText(config)){
return ConditionOutcome.match(message.found("logging.file.path").items(new Object[]{config}));
}else{
config = Property("al-file");
return StringUtils.hasText(config)? ConditionOutcome.match(message.found("al-file").items(new Object[]{ config})): Match(message.didNotFind("logging file").atAll());
}
}
}
最后:在配置了logging.file.name之后,再配置⼀下al-file就好了
附:配置类:org.springframework.boot.actuate.autoconfigure.logging.LogFileWebEndpointAutoConfiguration

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。