Question

I am working in Ektron 8.6

I am trying to use the helper functions in the EkException in my ektron website. I tried using the following code:

 Exception ex=new Exception("Test exception");
  EkException.LogException(ex,System.Diagnostics.EventLogEntryType.Information);


  LogEventEntry entry=new LogEventEntry();
  entry.EventName="Test event";
  entry.Timestamp=DateTime.Now;
  entry.UserID=22;
  entry.VisitorID="Test";
  EkException.AddEventEntry(entry);

  EkException.WriteToEventLog("Myapp",System.Diagnostics.EventLogEntryType.Information);

I tried executing the above code with administarator privilege,and it doesnt throw any error. But there is no change in the event viewer.

Can someone help in figuring out this issue?

Was it helpful?

Solution

You want to use the class: Ektron.Cms.Instrumentation;

Log.WriteMessage(“my message”, LogLevel.Verbose);


Keep in mind you must turn on the LogLevel in web.config.

Web.config, update LogLevel to “4”. Instrumentation.config, add “Trace” to “Verbose”

 <add switchValue="All" name="Verbose">
  <listeners>
    <add name="Event Log" />
   <add name="Trace" />
  </listeners>

You may also use the following, but to recap the reason why you most likely were't seeing any events is because of the log level

    Ektron.Cms.Instrumentation.Log.WriteError("error");
    Ektron.Cms.Instrumentation.Log.WriteWarning("warning");
    Ektron.Cms.Instrumentation.Log.WriteInfo("info");
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top