logback: how do I differentiate logging between test and main when using groovy configuration?
问题 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