Micronaut configure logger appenders based of the enviroment

为君一笑 提交于 2019-12-24 01:06:33

问题


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.


回答1:


To put the correct answer here from the above comment. According to this link, you can just add a logback-production.xml, where production is the name of your profile.




回答2:


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.



来源:https://stackoverflow.com/questions/57135912/micronaut-configure-logger-appenders-based-of-the-enviroment

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!