HSS Core Logging
The Logging library includes a .NET Service that writes entries to either the local machine event log or a database table.When you install the HSS Core Framework, the Logging Service is installed for you and defaults to logging to the local machine event log.
If you want to log to a database, you can run the HSS Log Database Wizard which will create the HSSLOG database for you. It supports
installing into an existing database, or creating a new database. Also supports SqlExpress or Sql Server.
Once configured, you add a reference to the HSS.Core.dll and then call...
HSS.Logging.Log.WriteEntry("message", EventLogEntryType.Information);
support for adding attachments to the entry when logging to the database.
Additionally, from your application initialization, you can designate the default application name, user name and entry formatter.
// Configure Logging Log.DefaultApplicationName = "Your App"; Log.DefaultUserName = "System"; Log.Formatter = new CustomFormatter(); ///<summary>/// Custom Log Entry Formatter///</summary>publicclass CustomFormatter { // Format exception entriespublicvoid FormatException(Exception ex, HSS.Logging.LogEntry entry, HSS.Logging.ILog log) // Format non exception entriespublicvoid Format(HSS.Logging.LogEntry entry, HSS.Logging.ILog log) }