How to create a debug log file for troubleshooting