Logging events

Logging events contain some constant numbers, which are used while logging information. When developing an enterprise application, it is a recommended approach to provide a specific action number, irrespective of whether it's an error, information, warning, and so on.

This helps the developer to trace out the exact action which was executed on that piece of code when the message was logged. And, in the event of an error, it immediately gives at a glance meaning about the error type, making it easy for the developer or support team to identity the root cause and resolve it.

Here are a few of the sample logging events we have defined in our project, which will be used through the layers where logging will be implemented:

    public static class LoggingEvents 
{
public const int GET_ITEM = 1001;
public const int GET_ITEMS = 1002;
public const int CREATE_ITEM = 1003;
public const int UPDATE_ITEM = 1004;
public const int DELETE_ITEM = 1005;
public const int DATABASE_ERROR = 2000;
public const int SERVICE_ERROR = 2001;
public const int ERROR = 2002;
public const int ACCESS_METHOD = 3000;
}
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.125.205