EkException class in Ektron

I work in Ektron 8.6

I am trying to use helper functions in EkException on 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 to execute the above code with administrator privilege and it does not throw any errors. But there are no changes in the event viewer.

Can someone help in solving this problem?

+4
source share
1 answer

Do you want to use the class: Ektron.Cms.Instrumentation;

Log.WriteMessage ("my message", LogLevel.Verbose);


Remember that you must include LogLevel in web.config.

Web.config, upgrade LogLevel to "4". Instrumentation.config, add "Trace" to "Verbose"

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

You can also use the following, but to understand the reason why you most likely did not see any events, due to the log level

  Ektron.Cms.Instrumentation.Log.WriteError("error"); Ektron.Cms.Instrumentation.Log.WriteWarning("warning"); Ektron.Cms.Instrumentation.Log.WriteInfo("info"); 
+2
source

All Articles