The DevLog handles writing to the current application's log file. This class cannot be inherited.


Namespace: NetQuarry
Assembly: EAP.Core (in EAP.Core.dll)

Syntax

Visual Basic (Declaration)
Public NotInheritable Class DevLog
    Implements IDisposable
C#
public sealed class DevLog : IDisposable
C++
ref class DevLog sealed  : IDisposable
J#
public final class DevLog implements IDisposable
JScript
public final class DevLog extends 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.
The following snippet shows how to log an exception to the current log.
 Copy Code
            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 Code
            DevLog.LogMessage("AppContext.Hibernate", "applicationHibernate", 
                string.Format("Application database connections are being closed. InitStack = {0}", _initSemaphore), 
                LogMessageLevel.Debug);
            

Inheritance Hierarchy

System.Object
   NetQuarry.DevLog

Thread Safety

Public static (Shared in Visual Basic)staticShared members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

See Also