logback: how do I differentiate logging between test and main when using groovy configuration?

若如初见. 提交于 2019-12-23 17:02:41

问题


I understand that, when using xml configuration, you can put a logback-test.xml under src/test/resources for test phase logging and logback.xml under src/main/resources for main logging.

However, how can I achieve the same thing for groovy configuration? Thank you very much.


回答1:


You should be able to put your logback.groovy log configuration for your tests under /src/test/resources. It'll take precedence over the logback.groovy under /src/main/resources



来源:https://stackoverflow.com/questions/23661171/logback-how-do-i-differentiate-logging-between-test-and-main-when-using-groovy

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