public class LogbackLogging
extends com.loadcoder.result.Logs
| Constructor and Description |
|---|
LogbackLogging() |
| Modifier and Type | Method and Description |
|---|---|
static File |
getNewLogDir(String dirForAllLogs)
Helper method to get a unique directory for logs
|
static File |
getNewLogDir(String rootDirPathForAllLogs,
String nameOfTheTest)
Helper method to get a unique directory for logs
|
static void |
setDateTimeFormatter(DateTimeFormatter dateTimeFormatter)
Changes the static date and time format of the directory that the method
getNewLogDir creates |
static void |
setResultDestination(File sharedDirForLogs)
set the resultDir for your tests logs.
|
static void |
setResultDirectory(String sharedDirForLogsPath)
This method will be called from the test to set the result dir
|
public static void setDateTimeFormatter(DateTimeFormatter dateTimeFormatter)
getNewLogDir createsdateTimeFormatter - is the format to be changed topublic static void setResultDirectory(String sharedDirForLogsPath)
sharedDirForLogsPath - is the path to the new directorypublic static void setResultDestination(File sharedDirForLogs)
setResultDestination(new File("logs/mytest/"));
Also have a look at method getNewLogDir that helps out to create a
unique dir for the new execution.
setResultDestination(getNewLogDir("logs", "mytest"));
Note that in order for this method to work properly, an implementation of SharedDirFileAppender must be used and created through the used logging framework. A logback implementation is provided in loadcoder-logback module.
sharedDirForLogs - is the path to the new directorypublic static File getNewLogDir(String rootDirPathForAllLogs, String nameOfTheTest)
rootDirPathForAllLogs - is the base directory for all your logsnameOfTheTest - is the name of the directory where you want to store logs from all
executions for a particular test, which will be located inside
rootDirPathForAllLogsrootDirPathForAllLogs/nameOfTheTest/<date and time>(-<unique modifier>)Copyright © 2019. All rights reserved.