public class TestsLogConfigurationHelper extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
CONFIG_DEFAULT_FILE_NAME |
static String |
CONFIG_TEST_FILE_NAME |
static String |
LOG4J_CONFIGURATION_FILE |
| Constructor and Description |
|---|
TestsLogConfigurationHelper() |
| Modifier and Type | Method and Description |
|---|---|
static void |
clearLoggingConfig()
Clears the configurations generated by
configureLoggingForTest(Class) |
static void |
configureLoggingForTest(Class<?> testClass)
Looks for a logging config file on the directory tree
where the binaries for
testClass resides. |
public static final String LOG4J_CONFIGURATION_FILE
public static final String CONFIG_DEFAULT_FILE_NAME
public static final String CONFIG_TEST_FILE_NAME
public static void configureLoggingForTest(Class<?> testClass)
testClass resides.
If found, that logging config file is used, otherwise
Log4j2 is allowed to search for the config file using
its own logic.
A file called log4j2-test.xml will be searched first.
If not found, will try with log4j2.xml.
In either case, this method ends by reconfiguring all
loggers in the current LoggerContexttestClass - the class holding the tests to be executedpublic static void clearLoggingConfig()
configureLoggingForTest(Class)Copyright © 2016. All rights reserved.