emeadaxsupport: AX for Retail 2012 R2: Run-down on Log Files
Logging and tracing has changed quite a bit between AX for Retail 2009 and 2012 R2 so an updated version of my AX for Retail: Run-down on Log Files article is somewhat overdue. Hopefully this will be a quick reference guide that you can use for all Retail components.
This is the component that has changed the most in 2012 R2. In previous versions you set the logging level in the Functionality Profile and messages were saved to a table in the POS database (POSISLOG or RETAILLOG). POS logging is now configured directly in the POS.exe.config file and is very similar to the logging we introduced for the Retail Transaction Service in 2012 R1.
Open the POS.exe.config file in your favorite text editor. The first thing you will notice is that this file has about twenty times more content in it than previous versions. Most of the new sections deal with calls to the Real-time Service (which is now a Web Service). The logging section we are interested is in the node. You will note that there are two trace listeners defined:
Retail POS now logs detailed error messages to the standard Windows Event Log which you can view using the familiar Windows Event Viewer. This is the first place that you should look when your POS users are reporting problems with the application. You can always leave this switchValue as “Error”; regardless of its setting we do not log Warning or Information messages to the event log.
In order to get those Warning and Information messages you need to change the values for the RetailNetTracer listener. There are two things you can change: logging level and log file location.
Line 11: Change the switchValue to “All” to get all messages (if you’re digging into a problem I wouldn’t bother with anything besides “All”). Note that this value is case-sensitive.
Line 27: Change the initializeData value to a location and filename where the trace information will be saved. If you use the “.svclog” extension you can load the file directly in the MICROSOFT Service Trace Viewer (noted in the logging section of the AX for Retail 2012 R2: Troubleshooting the Real-time Service article).
When you start the POS application you should then see your file (with a _00 appended) in your directory:
One additional note on the new POS logging: the file will re-created every time you launch the POS application. If you need to save traces from previous runs you will need to intercept the file and copy it to a new location before restarting POS.exe.
Commerce Data Exchange: Real-Time Service
Please see the Configuring Real-time Service Tracing and Logging section of the AX for Retail 2012 R2: Troubleshooting the Real-time Service article.
Commerce Data Exchange: Synch Service
With the exception of the name change, logging for the Synch Service (previously Retail Store Connect) hasn’t changed much since previous versions (so this section will be familiar to many).
Launch the Commerce Data Exchange Synch Service Settings application and select a service instance. Note: if you’re looking for this in your start menu, the icon is actually named “Service Settings” which makes it a bit hard to find.
Press “next” four times to get to the Server Debugging Properties form. Here you can set the Log Level by marking one or more of the checkboxes (Error, Main, Actions, Detail, Functions). We will usually have you set the level to 15 (all except Functions) sing logging at the Functions level will flood the log file and isn’t very helpful.
Monitoring your overall Synch Service ecosystem is also very important. There are a couple of tools to help with this:
Tracing has also been added to Headquarters in AX itself for Retail 2012 R1 and R2. This can be very useful in tracking down problems with statement calculation, statement post, running scheduler jobs, and debugging logic in calls to the Real-time Service (Transaction Service). If you look in the X++ code for any Retail process you will see these lines scattered through-out:
There are two ways to view this trace information:
Modify the AX32.exe.config file (CU1 only)
The RetailTracer in Headquarters can log messages to an XML file using the same methods as the Real-time Service and POS. To turn on this tracing, you need to modify the AX32.exe.config file for an AX client. By default this is located here: C:\Program Files (x86)\Microsoft Dynamics AX\60\Client\Bin\Ax32.exe.config
By default this file does not have a System.Diagnostics section so you will have to create one using the example below:
Note how the switchValue and initializeData values are similar to Real-time Service and POS.
If you would rather log directly to a text file that is very easy to do as well:
Note that you need to install 2012 R2 CU1 for this logging functionality to work properly. Also, you won’t get messages from X++ code consumed by the Real-time Service since that logic is running on the AOS via the Business Connector. In order to log those messages you will need to set up ETW tracing on you AOS as described below.
Windows Event Tracing (ETW) for AX
The RetailTracer will also log messages to the Windows Event Tracing (ETW) that was introduced in AX 2012 R1. You download a white paper with step-by-step instructions on setting up an ETW trace and reading the resulting logs here: http://technet.microsoft.com/en-us/l.../hh452630.aspx. If you are already using this method to log other events in your X++ code, you may want to use this instead.
Online Store (SharePoint)
One of the biggest pieces of AX for Retail 2012 R2) is the new Online Store functionality. Logging for this component is done in the standard SharePoint ULS (Unified Logging Service) and can be configured in SharePoint itself.
To turn on logging, go to SharePoint Central Administration > Monitoring > Configure Diagnostics Logging:
Find and expand the Dynamics AX Retail category in the list and then select what level of event tracing you want to send to either the Event Log or the Trace Log by using the dropdowns further down:
Finally, hit “OK” way in the lower-right hand corner to save your changes. This will now start logging any AX for Retail code running on the server: the storefront itself, service plug-ins, SharePoint scheduled jobs (such as the important RetailPublishingJob). By default these log files can be found here: %CommonProgramFiles%\Microsoft Shared\Web Server Extensions\15\LOGS\
The resulting files can be read in any text editor or the handful of SharePoint ULS Viewers that are in the community. There are also some SharePoint Powershell Cmdlets that you can use to extract information from the logs.
Logging and tracing is the primary tool that we use in Support to assist customers and partners with their deployments. We are always giving suggestions to the product team on areas that could use more tracing; feel free to leave a comment below if there are areas you feel could use better logging.
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
|amer-ax: It was a great day!||Blog bot||DAX Blogs||3||29.12.2012 01:02|
|emeadaxsupport: Final Microsoft Dynamics AX 2012 R2 Content Available!||Blog bot||DAX Blogs||0||04.12.2012 06:12|
|DAX: Official Dynamics AX 2012 R2 Content (update) - Where is it, and how can you find out about updates?||Blog bot||DAX Blogs||0||03.12.2012 11:11|
|emeadaxsupport: New Content for Microsoft Dynamics AX 2012 : October 2011||Blog bot||DAX Blogs||0||27.10.2011 17:11|
|daxdilip: Whats New in Dynamics AX 2012 (A brief extract from the recently held Tech Conf.)||Blog bot||DAX Blogs||7||31.01.2011 12:35|
|Опции темы||Поиск в этой теме|