tags:

views:

26

answers:

1

I'd like to leverage the DotNetNuke logging system (both Event Logging and Exception Logging).

However, I'm concerned about potential performance issues if we begin logging too many Events.

Does the logging system write events to the database asynchronously? If not, is there an efficient way to make this happen? I'd hate to make an end-user wait on several database writes just to view a page.

Thanks

+2  A: 

Short answer: It depends on your DNN configuration. By default, logging is synchronous.

Detailed answer

Event Logging uses LoggingProvider set up in the web.config.

DotNetNuke is shipped with DBLoggingProvider and XMLLoggingProvider. By default, DotNetNuke uses DBLoggingProvider that writes into EventLog table.

How this is is done, depends on the Host settings and the site's Event Viewer settings. If "Enable Event Log Buffer" in checked the Host settings, logging should be asynchronous. Should be, since asynchronous logging uses the Scheduler, and if the scheduler is not enabled or is stopped, logging will be immediate.

Immediate logging can also be enforced with LogInfo.BypassBuffering property.

Event log settings determine what is going to be logged by Log Type basis. If you are using Event Logging in your modules, you have to pass the log type in the EventLogController.AddLog method. I usually use EventLogType.HOST_ALERT, since these are easily recognizable in the Event Log view and are logged by default (unlike ADMIN_ALERT).

For more details, check the AddLog implementation in the DNN source code:

DBLoggingProvider.AddLog(ByVal LogInfo As LogInfo)

See Also: DotNetNuke Host Settings Explained

mika
Great answer, thanks!
hamlin11