AXForum  
Вернуться   AXForum > Microsoft Dynamics AX > DAX Blogs
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 21.06.2013, 08:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,617 / 848 (80) +++++++
Регистрация: 28.10.2006
emeadaxsupport: AX for Retail 2012 R2: Run-down on Log Files
Источник: http://blogs.msdn.com/b/axsupport/ar...log-files.aspx
==============

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.

Retail POS

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:


and


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.

   

Notes:

  • Make sure you mark the Log Mode checkbox.  This is the “master switch” for logging – if you do not have this marked, you will not get any logging at all. 
 

  • You can write log messages to the Windows Event Log, but this is not a very efficient way to view the messages, so don’t bother with this.
 

  • By default, the log files are stored to the %s\Microsoft Dynamics AX\50\Retail Store Connect\[INSTANCE]\logs folder.  %s is not a Windows standard – in Retail Store Connect it resolves to the service user’s Appdata folder.  Since I have my service running as my own domain account, this is where that directory would be:  C:\Users\serstad\AppData\Local\Microsoft Dynamics AX\50\Retail Store Connect\ST9CONNECT\logs
 

  • The log files are automatically recycled based on the number you enter in the “Max Lines / Logile” field.  There are six files:  1.log, 2.log, 3.log, 1.old, 2.old, and 3.old.  All six files are relevant and it is pretty random to determine which one is the “current” file.
 

  • It can sometimes be useful to see the contents of the package files that are being sent through Retail Store Connect.  By marking the “Keep Package Files” checkbox, those XML files will be stored in the “work” directory as defined in the “Working Directory” field (two screens previous).  It is recommended to only do this for a limited period of time, as they can fill up a hard drive if left on permanently.
 

Monitoring your overall Synch Service  ecosystem is also very important.  There are a couple of tools to help with this:

  • The Messaging database for Synch Service usually gives a quick glance at the health of a particular instance.  Here are two queries that I like to use:
    select Servermsg, Status, * from outgoingmessages order by packageno desc

    select RemotePkg, Servermsg, * from incomingmessages order by packageno desc

  • In Retail Headquarters you can set up Synch Service instances to “call home” with status of each message that gets sent.  You can use the Commerce Data Exchange:  Synch Service Messages inquiry to get a view of all the jobs you have run and see which ones have had errors.   Please see the “Monitoring Synch Service” section in the Implementation guide for Commerce Data Exchange for details on setting up this functionality.
 

Headquarters

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:


   
       
           
               
                   
           
       
   
< /system.diagnostics>


 

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:


 
 
   
     
       
     
   
 
< /system.diagnostics>
 


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.




Источник: http://blogs.msdn.com/b/axsupport/ar...log-files.aspx
__________________
Расскажите о новых и интересных блогах по 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

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 02:41.