How to configure log4j.properties for SpringJUnit4ClassRunner?

后端 未结 7 642
深忆病人
深忆病人 2021-01-30 04:06

Suddenly this keeps happening during a JUnit test. Everything was working, I wrote some new tests and this error occured. If I revert it, it won\'t go away. Why is that?

7条回答
  •  走了就别回头了
    2021-01-30 04:26

    If you don't want to bother with a file, you can do something like this in your code:

    static
    {
        Logger rootLogger = Logger.getRootLogger();
        rootLogger.setLevel(Level.INFO);
        rootLogger.addAppender(new ConsoleAppender(
                   new PatternLayout("%-6r [%p] %c - %m%n")));
    }
    

提交回复
热议问题