How do you use the logging extension?

Topics: Business Logic Layer
Sep 11, 2012 at 2:25 AM

I would like to use the logging extension to debug a problem I am having integrating BlogEngine with a blog tool using the MetaWebLog api.  How do I do that and how do I test that the logging is working?

Coordinator
Sep 11, 2012 at 3:24 AM

1. Enable error logging in admin/settings/advanced if it is not already, this will enable error logging itself.

2. Enable "logger" extension if disabled in admin/appearance/extensions.

3. Anywhere in the code when you catching exception, use:

catch (Exception ex)
{
    BlogEngine.Core.Utils.Log("Your custom message", ex);
}

All exception will be logged to /App_Data/logger.txt

 

Sep 12, 2012 at 1:30 AM

I have a fix now for MetaWebLogHandler.cs.  What are the steps for posting a fix?  Do I need to enter an issue in the Issue Tracker?

Ted

Coordinator
Sep 12, 2012 at 3:01 PM

If it is just few lines of code, you can open an issue and provide your code changes there. If it is more involved, you might need to fork the code and submit a request.

Sep 14, 2012 at 1:04 AM

rtur,

Thanks for your help.  I posted the single line change to the Issues Tracker.

BTW...what is the best way to get the latest source code for 2.6?  Or even better, the full updated download?

Ted