While running any transaction or test a debug log records database operation, systems processes and errors.
Setup > Logs > Debug Logs
Monitored Users > New (Filter Criteria to generate a debug log for a specific user)
Search the user for whom you want to generate the debug log.
User is selected to generate debug log.
Debug Logs > All the logs are generated for that user.
Click Download: Download debug log as an XML file.