Stands for Logger for test methods.
Currently, this logger is hard-wired to be used only with log4j
- TestNG
7.4.0
- JDK8
- Always generates a log file on a per test method basis.
- The logger does not take into account a test method with multiple invocations and a test method powered by a data provider.
- Log file names are fully qualified class names along with the method name.
- All logs are by default available in the
logs
directory. - Captures log messages generated ONLY by a test method.
- Supports being invoked ONLY from within a
@Test
(or)@BeforeXXX|@AfterXXX
methods. - Does not capture logs generated by API calls that the current test method makes.
- The log file name of a test method is available as an attribute in its
ITestResult
object with a key namedlog4t.logs
Log4T.getLogger().info("testMethod1");
In-case, you would like to customize the directory or the pattern etc., following would need to be done
- Implement the interface
com.rationaleemotions.IAppenderInfo
- Create a folder
META-INF/services
in your resources directory. - Create a file named
com.rationaleemotions.IAppenderInfo
in the newly created directory. - Refer the fully qualified class name of your implementation from (1) into this file.