Monday, 21 September 2015

How to use Acumatica Trace

Hi All,

What you need to check if you have any problem and you want to investigate it?
Lets discuss Acumatica traces and log files/tables.

The first place that you should check if you faced the issue in application is the standard Acumatica trace.
Acumatica Trace Button

Acumatica Trace Window

Do you interesting in using PX trace from the code? Them welcome to this article.

If you need you can write information to the trace direct from your code. For this task, you should use PXTrace static class. There are a lot of different auxiliary methods to write different types of events:
public static void WriteError(string message)
public static void WriteError(Exception e)
public static void WriteWarning(string message)
public static void WriteWarning(Exception e)
public static void WriteInformation(string message)
public static void WriteInformation(Exception e)
public static void WriteEvent(Event item)

Acumatica has 2 different type of providers (you can change them in web.config file):                
  • PXSessionTraceProvider – this provider stores all logs in the current session of user.
  • PXFileTraceProvider – this provider sores log in the file with ‘file’ name parameter.
If you need you can write you own trace provider to store logs in different location. For this task, you have to create new class derived from PXTraceProvider.
In case of report and generic inquire executing system will write the SQL statement in the Trace log. You are able to use it for SQL debugging purposes. 
Acumatica Trace Window


Other Acumatica Logs
Here you can find the list of other places where you can find different logs. 
  • Acumatica Configuration Wizard Logs - all events that happens during application maintenance. You can find it there - C:\Program Files (x86)\Acumatica ERP\log.txt
  • First chance exception log - you can enable it web.config and than you can find log file inside App_Data site folder ("<SiteFolder>\App_Data\firstchanceexceptions.log").
  • Windows logs - you can find all unhanded exceptions there.
  • Maintenance logs - some maintenance and license errors system also will keep in App_Data folder "<SiteFolder>\App_Data\maintlog.txt" 
  • IIS logs - all IIS related errors.
  • Sql Server logs - all SQL related errors.
  • Database Logs:
    • LoginTrace – all login, logout, screen opening, session expired, customization published events.
    • Snapshot History – all history of restoring snapshots.
    • UPHistory – all history of application update.
    • AUScheduleHistory – all history of scheduler execution
    • Audit History – all history if fields changes if enabled.
    • EMailSyncLog – all history of exchange synchronization.
    • AUNotificationHistory – all history of notification operations.
Have a nice day!

No comments: