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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 04.11.2011, 10:14   #1  
Blog bot is offline
Blog bot
Участник
 
25,459 / 846 (79) +++++++
Регистрация: 28.10.2006
Axilicious:Propagate infolog messages to the windows event log
Источник: http://www.ksaelen.be/wordpress/2011...ows-event-log/
==============

The windows event viewer can be a nice tool to check for messages dispatched by the system. You can save the logs in there, reopen them, different kinds of information is available so you can actually trace lots of things in there. But wouldn’t it be nice to also be able to log the messages thrown by Ax 2012 in the windows event log?

That way you do not lose user messages and they are nicely logged into the event viewer. It can also help to log messages received on a client that you cannot seem to reproduce, …

Well, it is possible and here is how to do it in a couple of steps:

  • Add a windows event log and source to put our specific infolog messages in
  • Edit the Ax32 config file to add an event log listener to the configuration
Create event log and source

So first things first, let’s create a windows event log by using the following powershell command

new-eventlog -logname "RealDolmen Ax Solutions" -source "Ax 2012 Infolog"

The result should be like in the figure below



Configure the listener

To add a listener, first open the ax32.exe.config file located in the client\bin directory. You should see a configuration similar to this:

</span span style="color: #000066;"version/span=span style="color: #ff0000;""1.0"/span span style="color: #000066;"encoding/span=span style="color: #ff0000;""utf-8"/span span style="color: #000000; font-weight: bold;"?> </span> </span> </span> </span> </span> </span>

Modify the configuration so that it looks like this: (It is absolutely important to keep the source name !! The initializeData must be filled with the source you created in the event log)

</span span style="color: #000066;"version/span=span style="color: #ff0000;""1.0"/span span style="color: #000066;"encoding/span=span style="color: #ff0000;""utf-8"/span span style="color: #000000; font-weight: bold;"?> </span> </span> </span> </span> </span> </span> </span> </span> </span> </span> </span> </span> </span>

Now we are all set up and when firing up the client, any messages to the infolog should be redirected to the event log. So let’s send some error lines to the infolog.



Now check if the same messages appear in the infolog. Normally this is what it should look like:



So there you have it. The messages are nicely logged in the event viewer. As a last remark, you can also adjust the logging level by modifying the switchvalue of the source. Off will not log anything at all, verbose will fill your event log with everything.




Источник: http://www.ksaelen.be/wordpress/2011...ows-event-log/
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
sumitax: AX – Event Ids for common Event Log errors Blog bot DAX Blogs 0 01.09.2011 01:11
axinthefield: Dynamics AX Event IDs Blog bot DAX Blogs 0 01.03.2011 22:11
Preston.Larimer: Workflow setup error on Event Log name Blog bot DAX Blogs 0 14.11.2010 10:18
gatesasbait: How to temporarily suppress infolog messages in Dynamics Ax (deux) Blog bot DAX Blogs 7 28.01.2009 17:45
gatesasbait: How to temporarily suppress infolog messages in Dynamics Ax Blog bot DAX Blogs 0 10.12.2008 00:06
Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск
Опции просмотра

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

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

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 21:40.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.