The DevLog handles writing to the current application's log file.

Namespace: NetQuarry
Assembly: EAP.Core (in EAP.Core.dll) Version: 2.0.0.0 (4.5.2.0)

Syntax

C#
public sealed class DevLog : IDisposable
Visual Basic
Public NotInheritable Class DevLog
	Implements IDisposable

Remarks

The DevLog (developer log) is configured in the application's configuration file (typically web.config). You may specify in the config file various options that control the verbosity and handling of the log file.

Options for the log from the DevLogOptions enumeration. This value should be a decimal number that represents a bitmask of one or more of the DevLogOptions values.

For example, to turn off Debug level logs, set the value to 1.

  • NoDebug|NoSQL == 5
  • NoDebug|NoInfo == 3 (note that this turns off SQL and Timing entries as well)
  • NoDebug|AutoFlush = 33 (0x00000001 | 0x00000020)
  • AutoFlush == 32 (by default the file is buffered)
  • Synchronize == 64 (by default the file allows overlapping writes)
Note
If you are running in the context of IIS then the logfile is specified in the web.config file. If you are running in the context of the Scheduler, then the logfile is specified in the EAP.Scheduler.exe.config file.

Examples

The following snippet shows how to log an exception to the current log.
 Copy imageCopy
try
{
   //--- leave the From field empty, it will default to the value configured in the studio
   mail.Send(string.Empty, sendToList, subject, body, true);
}
catch (Exception ex)
{
   //--- log the error then re-throw
   DevLog.LogMessage("XIssue.Send", "sendMailError", ex);
   throw;
}
The next snippet shows how to log a Debug level message:
 Copy imageCopy
DevLog.LogMessage("AppContext.Hibernate", "applicationHibernate", 
    string.Format("Application database connections are being closed. InitStack = {0}", _initSemaphore), 
    LogMessageLevel.Debug);

Inheritance Hierarchy

System..::..Object
  NetQuarry..::..DevLog

See Also