本文介绍了Micronaut根据环境配置记录器附加程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想根据环境 配置日志附加程序 ,例如,在生产环境中运行时,我想配置一个附加程序,它将日志发送给elasticsearch在测试或开发模式下,不会启用此附加程序.

I would like to configure logging appender based on the environment, for example while running in production I would like to configure an appender that would send log to elasticsearch but while on test or development mode this appender would not be enabled.

推荐答案

据我了解,Micronaut没有实现Spring boot()之类的类似功能.我认为logback-production.xml(其中生产是配置文件)也不起作用-仅支持logback.xml和logback-test.xml.

As far I understand, Micronaut doesn't have similar thing like Spring boot ( ) implemented.I think logback-production.xml (where production is profile) doesn't work too - only logback.xml and logback-test.xml is suported.

这篇关于Micronaut根据环境配置记录器附加程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-24 21:37