Everything accomplished by an XAF application is written to a log file, which is very useful in debugging an application. For example, all the exceptions raised when using the applications are logged through the Error Handling mechanism. Generally, you can populate log files with any information manually, and customize the Error Handling mechanism. To learn more, use the following links.
This section contains links to MSDN Library documents which contain information on debugging in Visual Studio.