Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

location of Log files

Posted on by 5,901

Dear All,

Could you please let me know where i am getting log files in AX 2012 R3.
If i am getting any error in Database and Application level. Please advice me what are the best approach to resolve those issue.

Please give me more shed on this.

Thanks!

Arpan Sen

*This post is locked for comments

  • Suggested answer
    guk1964 Profile Picture
    guk1964 10,877 on at
    RE: location of Log files

    P.S. it would have saved time if I had remembered this post with code from  two experts: which sheds some more light.

    daxmusings.codecrib.com/.../get-infolog-details-from-code.ht

  • Suggested answer
    guk1964 Profile Picture
    guk1964 10,877 on at
    RE: location of Log files

    This I don't Is the purpose of the form- I,e guidance on a speciifc issue is different from online training and consulting,  and you probably should speak to a  consulting company Ax developer because any answer ahs to start with some assumptions e,.g that you know how to write and compile code etc. You also have to consider which messages to capture and for how long and with what other details e.g date and employee id.  Running as a batch also gives you the option of looking at batch history - SysOperation framework).

    First consider how to manually save a message:.

    Right-click on the heading of the Infolog and you get a pop-up context menu that lets you copy the Infolog messages to the clipboard – then go into Notepad or Word (or Excel if there are lots of messages, because that makes it slightly easier to filter the rows), and paste.

    The other  drop down menu option 'Copy as list to Clipboard’ collapses the message parent-child structure into single lines

    So automate that process is an approach. Anyway here are two options.,(

    To capture infolog messages for a particular record and show those logs on click of a log button on a form.
    1) Create a job which inserts records into a table, prints some info messages and capture those messages.

    logTable contains three fields EmpId, name and info. info is a field created with EDT infologData and visible property is set to NO.

    info is a container which stores the infolog messages for the particular record.

    static void logs(Args _args)
    {
         logTable       insertLog;
     
         NumberSeq  numberSeq;
         InfologData  msg;

         ttsbegin;
         insertLog.initValue();

         numberSeq                          =   NumberSeq::newGetNum(InventParameters::numRefEmpID());
         insertLog.EmpId           =   numberSeq.num();
         insertLog.Name                  =   'ABC';

         info(strFmt("%1", insertLog.EmpId));
         info(strFmt("%1", insertLog.Name));
         info(strFmt("Employee with %1 & name %2 created successfully", insertLog.EmpId,insertLog.Name));
         msg        =    infolog.infologData();
         insertLog.Info = msg;

         insertlog.insert();
         infolog.clear();

         ttscommit;
    }

    NOTEWS :
    i) Save compile and run this job. EmpId is generated through number sequence and name is hard coded. These two values are inserted into table.
    ii) The info stored for this record are :
    EMPID-0001
    New
    Employee with EMPID-0001 & name ABC created successfully

    2)  Now create a form with grid showing the logTable datasource fields and button named log.
    Write the following code in clicked method of the button
    void clicked()
    {
        InfologData  msg;

        msg = logTable.info;
        infolog.import(msg);
    }

    Now when you select this particular record and press the log button the infolog messages stored for this record are displayed in info.

    You can otherwise  save the infolog content to the Windows Event Log or to a file on disk. This can be done in 2012 with the help of listeners. read more on this, at https://msdn.microsoft.com/en-us/library/system.diagnostics.tracelistener%28v=vs.110%29.aspx.
    Edit your Ax32.exe.config file (or if this file doesn't exist near the Ax32.exe app file, then create it) and append this code snippet:

    <configuration>
    
      <system.diagnostics>
        <trace autoflush="true"/>
        <sources>
          <source name="Microsoft.Dynamics.Kernel.Client.DiagnosticLog-Infolog"
                  switchValue="Information">
            <listeners>
              <add name="EventLog" 
                   type="System.Diagnostics.EventLogTraceListener" 
                   initializeData="Dynamics Trace Infolog"/>
              <add name="TextFile" 
                   type="System.Diagnostics.TextWriterTraceListener" 
                   initializeData="DynamicsTraceInfologTrace.log" 
                   traceOutputOptions="DateTime"/>
            </listeners>
          </source>
        </sources>
      </system.diagnostics>
    
    </configuration>

    I'm done.


  • @rp@n Profile Picture
    @rp@n 5,901 on at
    RE: location of Log files

    Thanks Magic,

    Sorry, i didn't get properly.

    Could you please explain me again.

    Thanks!

    Arpan Sen

  • Suggested answer
    guk1964 Profile Picture
    guk1964 10,877 on at
    RE: location of Log files

    The infolog class has a "copy" and a "cut" method that return the contents of the infolog, in container form.

    The elements in the container are containers themselves, each one corresponding to a line in the infolog.

    So  get the container, loop over it, and for each iteration grab the sub-container and extract the details like the exception type, action class, helptext, etc.

  • @rp@n Profile Picture
    @rp@n 5,901 on at
    RE: location of Log files

    Thanks Vilmos

  • Suggested answer
    Vilmos Kintera Profile Picture
    Vilmos Kintera 46,149 on at
    RE: location of Log files

    Here are some links on what and how could be set up for this:

    msdn.microsoft.com/.../gg845722.aspx

    dev.goshoom.net/.../ax2012-service-configuration-editor

    stackoverflow.com/.../enable-find-logging-for-dynamics-ax-odata-service

    Classes could run client, or server-side.

    If you want to capture client infolog messages, that is typically done on a Terminal Server / Citrix host / Windows Remote Desktop Services host, since it would be a challenge to collect such event logs from individual fat clients on users' computers.

  • @rp@n Profile Picture
    @rp@n 5,901 on at
    RE: location of Log files

    Thanks Vilmos,

    1. How to set Ax32.exe.config (Client) or Ax32serve.exe (Server) to make event handler to capture info/warning/error messages occurring in the InfoLog window ?

    Note : For example all Forms are executed in Client side. That means it will captured by Ax32.exe.config.

    Classes are captured by Ax32Serve.exe (Server).

    Is't correct?

    Please confirm.

    Thanks!

    Arpan Sen

  • Suggested answer
    Vilmos Kintera Profile Picture
    Vilmos Kintera 46,149 on at
    RE: location of Log files

    AX does not produce log files, unless you have changed the Ax32.exe.config or Ax32serve.exe.config to make event handler subscriptions to capture info/warning/error messages occurring in the InfoLog window.

    If an internal error happens in the AX kernel, you may typically find error entries in the Event Log on the Windows environments where individual AX components are sitting on (like permission and authorization issues, SQL connection problems, AIF/Business Connector failures). Also SQL Server and the SSRS instances are keeping logs in case something happens that those application thinks are worth capturing. You may find the location of those in the respective products' documentation, typically within their binary program files' folders.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans