how to add/write event log from controller?

Muhammad Kaleem asked on May 15, 2019 10:15

i'm using kentico12 mvc, i want to ask about how can i write event log from controller, for example in my try block i write my all logic implementation and in catch block i want to write log of exception detail, please suggest thanks

Recent Answers


Dmitry Bastron answered on May 15, 2019 10:27

Hi Muhammad,

Here is the code example:

try
{
    // some logic
}
catch (Exception ex)
{
    EventLogProvider.LogException("AccountController", "Login", ex);
}

If the answer was helpful, please do not forget to mark it as a correct answer.

2 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.