static void EventViewer(Args _args)
{
System.Diagnostics.EventLog eventlog;
#Define.LogSource("Dynamics AX")
#Define.LogName("Dynamics AX Log")
;
// check if the log already exists
if(!System.Diagnostics.EventLog::SourceExists(#LogSource))
{
// create new log
System.Diagnostics.EventLog::CreateEventSource(#LogSource, #LogName);
}
eventlog = new System.Diagnostics.EventLog();
eventlog.set_Source(#LogSource);
// write info entry
eventlog.WriteEntry("Just writing in the event viewer.");
// write error entry
eventlog.WriteEntry("Error! Please check the stack trace below. \n\n" +
con2str(xSession::xppCallStack()), System.Diagnostics.EventLogEntryType::Error);
// write warning entry
eventlog.WriteEntry("Job finished." , System.Diagnostics.EventLogEntryType::Warning);
info("Check the event viewer!");
}
{
System.Diagnostics.EventLog eventlog;
#Define.LogSource("Dynamics AX")
#Define.LogName("Dynamics AX Log")
;
// check if the log already exists
if(!System.Diagnostics.EventLog::SourceExists(#LogSource))
{
// create new log
System.Diagnostics.EventLog::CreateEventSource(#LogSource, #LogName);
}
eventlog = new System.Diagnostics.EventLog();
eventlog.set_Source(#LogSource);
// write info entry
eventlog.WriteEntry("Just writing in the event viewer.");
// write error entry
eventlog.WriteEntry("Error! Please check the stack trace below. \n\n" +
con2str(xSession::xppCallStack()), System.Diagnostics.EventLogEntryType::Error);
// write warning entry
eventlog.WriteEntry("Job finished." , System.Diagnostics.EventLogEntryType::Warning);
info("Check the event viewer!");
}