We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
通过LoggingFactoryBeanCustomizers类内通过集合的形式来注入LoggingFactoryBeanCustomizer,并且针对LoggingFactoryBean实例进行修改。
LoggingFactoryBeanCustomizers
LoggingFactoryBeanCustomizer
LoggingFactoryBean
The text was updated successfully, but these errors were encountered:
/** * The {@link LoggingFactoryBeanCustomizer} collection processing class * * @author 恒宇少年 */ public class LoggingFactoryBeanCustomizers { private List<LoggingFactoryBeanCustomizer> customizers; public LoggingFactoryBeanCustomizers(List<LoggingFactoryBeanCustomizer> customizers) { this.customizers = (customizers != null) ? new ArrayList<>(customizers) : Collections.emptyList(); } /** * Customize the specified {@link LoggingFactoryBean}. Locates all * {@link LoggingFactoryBeanCustomizer} beans able to handle the specified instance and * invoke {@link LoggingFactoryBeanCustomizer#customize(LoggingFactoryBean)} on them. * * @param factoryBean the logging factory bean to customize * @return the factory bean */ public LoggingFactoryBean customize(LoggingFactoryBean factoryBean) { LambdaSafe.callbacks(LoggingFactoryBeanCustomizer.class, this.customizers, factoryBean) .withLogger(LoggingFactoryBeanCustomizer.class).invoke((customizer) -> customizer.customize(factoryBean)); return factoryBean; } }
/** * {@link LoggingFactoryBeanCustomizer}实现类 * 新增排除日志拦截输出的路径 * * @author 恒宇少年 */ @Component @Order(2) public class AppendIgnorePathCustomizer implements LoggingFactoryBeanCustomizer { @Override public void customize(LoggingFactoryBean factoryBean) { factoryBean.getIgnorePaths().add("/test"); } }
注意事项:如果存在多个LoggingFactoryBeanCustomizer,可以通过@Order注解来定义执行的顺序,值越小执行越靠前
@Order
Sorry, something went wrong.
hengboy
Successfully merging a pull request may close this issue.
通过
LoggingFactoryBeanCustomizers
类内通过集合的形式来注入LoggingFactoryBeanCustomizer
,并且针对LoggingFactoryBean
实例进行修改。The text was updated successfully, but these errors were encountered: