Microsoft .Net has a very nice feature like First Chance Exception Log. You can easily use it in your Acumatica to log specific exceptions.
About first chance exceptions you can read here.
Now i want to share with you my logger example:
To to enable this logger, you just need to put an additional file to <SitePath>\App_code\ folder and add this line to your global.asax file:
void Application_Start(object sender, EventArgs e)
Based on this idea i have a logger for caching "Session Expired" problems.
Code example is located here.