Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Writing to the Event Log? View modes: 
User avatar
Member
Member
Chanan - 3/16/2011 6:09:28 AM
   
Writing to the Event Log?
Hello,

What is the suggested way for custom code (Webparts, etc.) to log information? Is there API access to the Event Log? (If not, can you add that?)

User avatar
Kentico Consulting
Kentico Consulting
kentico_borisp - 3/16/2011 7:28:46 AM
   
RE:Writing to the Event Log?
Hello,

You can use EventLogProvider.LogEvent() method for logging custom exceptions.

Best regards,
Boris Pocatko

User avatar
Member
Member
DesignByOnyx - 5/29/2011 6:56:08 PM
   
RE:Writing to the Event Log?
I do not see this method on the EventLogProvider. I am wanting to log some simple information for future analysis. Is there a way to do this? I am using 5.5 R2.22. Thx.

User avatar
Kentico Consulting
Kentico Consulting
kentico_borisp - 5/30/2011 5:19:30 AM
   
RE:Writing to the Event Log?
Hello,

A similar issue is discussed in the following thread. There is also a bit of sample code, how to use the mentioned method. It is a bit outdated, but it should work nonetheless.

Best regards,
Boris Pocatko

User avatar
Member
Member
DesignByOnyx - 5/30/2011 1:45:03 PM
   
RE:Writing to the Event Log?
My problem was I was trying to call the method on the class itself:

EventLogProvider.LogEvent(...);

Which does not exist. I needed to create an instance first:

EventLogProvider elp = new EventLogProvider();
elp.LogEvent(...);

Thanks for your help.