3

I'm in the process of executing Maven commands to run tests in the console (MacOSX). Recently, development efforts have produced extraneous messages in the console (info, debug, warning, etc.) I'd like to know how to remove messages like this:

INFO c.c.m.s.c.p.ApplicationProperties - Loading application properties from: app-config/shiro.properties

I've used this code to remove messages from the dbunit tests:

ch.qos.logback.classic.Logger Logger = (ch.qos.logback.classic.Logger)LoggerFactory.getLogger("org.dbunit");
    Logger.setLevel(Level. ERROR);

However, I'm unsure how to disable these additional (often verbose and irritating) messages from showing up on the console so that I can see the output more easily. Additional messages appear as above and these:

DEBUG c.c.m.s.c.f.dao.AbstractDBDAO - Adding filters to the Main Search query.

WARN c.c.m.s.c.p.JNDIConfigurationProperties - Unable to find JNDI value for name: xxxxx

INFO c.c.m.a.t.d.DatabaseTestFixture - * executing sql: xxxxx

DeseoMar
  • 91
  • 1
  • 9
  • Are these messages printed when you execute tests? Do you want to remove them from console completely? – Andrew Logvinov Mar 28 '13 at 18:45
  • Please correct me, if I'm wrong. I understand that you're using logback. Please see http://logback.qos.ch/manual/configuration.html and http://logback.qos.ch/manual/filters.html for filtering configuration. – Charlee Chitsuk Mar 29 '13 at 01:07
  • @Andrew - Yes, would like to remove the INFO and WARN and DEBUG messages from the console completely. So far, efforts have been unsuccessful. Charlie - Yes, I'm using LogBack, but there is also LOG4J in the project as well. I've read the logback documentation without solution. Thanks. – DeseoMar Apr 02 '13 at 12:59
  • SOLUTION: Solution to issue IS adding a 'logback-test.xml' file to the root of my test folder. I used the default contents (as instructed by the documentation - thanks @Charlie). Once file exists there, FIXED! – DeseoMar Apr 02 '13 at 13:09
  • maybe this post can help you [link][1] [1]: http://stackoverflow.com/questions/4782089/how-to-change-maven-logging-level-to-display-only-warning-and-errors – El David Jul 28 '15 at 20:17

1 Answers1

1

The successful answer was:

SOLUTION: Solution to issue IS adding a 'logback-test.xml' file to the root of my test folder. I used the default contents (as instructed by the documentation - thanks @Charlie). Once file exists there, FIXED!

DeseoMar
  • 91
  • 1
  • 9