I will try to make a brief description of my Selenium structure so that I can explain my problem.
I am using Selenium 2 (current version 2.3.1) + testNG 5.14
I installed the testng.xml file to run tests in the test suite in parallel, only 2 instances
For logging purposes, I use logback (I read this next best in the world of journals)
My problem is that when checking that the application logs, I get something like this:
18: 48: 58.551 [TestNG] INFO daastsetup.TestConfiguration - Retrieve a random user from the user pool
18: 48: 58.551 [TestNG] INFO daastsetup.TestConfiguration - Retrieve a random user from the user pool
18: 48: 58.551 [TestNG] DEBUG daastset.TestConfiguration - Creating a DataSource to access the DataBase
18: 48: 58.551 [TestNG] DEBUG daastset.TestConfiguration - Creating a DataSource to access the DataBase
18: 48: 58.552 [TestNG] DEBUG daastsetup.TestConfiguration - Running SQL Query
18: 48: 58.552 [TestNG] DEBUG daastsetup.TestConfiguration - Running SQL Query
18: 48: 59.613 [TestNG] TRACE daastsetup.TestConfiguration - Request successful
18: 48: 59.613 [TestNG] TRACE daastsetup.TestConfiguration - Request successful
As you can see, it is not possible to see the difference between two threads that work simultaneously. My question is: is there a way to configure the log settings so that they also add a number or identifier to identify each thread running?
PD Just in case, this can help, my logback.xml file looks like this:
<?xml version="1.0" encoding="UTF-8"?> <configuration> <appender name="FILE" class="ch.qos.logback.core.FileAppender"> <file>logs/selenium.log</file> <encoder> <pattern>%date %level [%thread] %logger{10} [%file:%line] %msg%n</pattern> </encoder> </appender> <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> <encoder> <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern> </encoder> </appender> <root level="trace"> <appender-ref ref="FILE" /> <appender-ref ref="STDOUT" /> </root> </configuration>
Thanks for the help =)
} {Panacea
multithreading testng webdriver logback
Panacea
source share