Class LogDaemon
Provides logging services by buffering messages and dispatching them into sinks.
This is an asynchronous daemon with its own thread, meaning that Write(msg) never blocks for long.
Inheritance
System.Object
LogDaemon
Implements
System.IDisposable
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Assembly: Azos.dll
Syntax
[ConfigMacroContext]
public class LogDaemon : LogDaemonBase, IDaemon, IDaemonView, INamed, ILogImplementation, ILog, ILocalizedTimeProvider, IDisposable, IConfigurable, IInstrumentable, IExternallyParameterized, ISinkOwnerRegistration, ISinkOwner, IApplicationComponent
Constructors
LogDaemon(Daemon)
Creates a new logging daemon instance
Declaration
public LogDaemon(Daemon director)
Parameters
Type |
Name |
Description |
Daemon |
director |
|
LogDaemon(IApplication)
Creates a new logging daemon instance
Declaration
public LogDaemon(IApplication app)
Parameters
Fields
CONFIG_FILEEXTENSION_ATTR
Declaration
public const string CONFIG_FILEEXTENSION_ATTR = "file-extension"
Field Value
Type |
Description |
System.String |
|
CONFIG_RELIABLE_ATTR
Declaration
public const string CONFIG_RELIABLE_ATTR = "reliable"
Field Value
Type |
Description |
System.String |
|
CONFIG_WRITEINTERVAL_ATTR
Declaration
public const string CONFIG_WRITEINTERVAL_ATTR = "write-interval-ms"
Field Value
Type |
Description |
System.String |
|
DEFAULT_INTERVAL_MSEC
Declaration
public const int DEFAULT_INTERVAL_MSEC = 250
Field Value
Type |
Description |
System.Int32 |
|
MAX_INTERVAL_MSEC
Declaration
public const int MAX_INTERVAL_MSEC = 10000
Field Value
Type |
Description |
System.Int32 |
|
MIN_INTERVAL_MSEC
Declaration
public const int MIN_INTERVAL_MSEC = 10
Field Value
Type |
Description |
System.Int32 |
|
Properties
FileExtension
Declaration
[Config("$file-extension")]
[ExternalParameter(new string[]{"log"})]
public string FileExtension { get; set; }
Property Value
Type |
Description |
System.String |
|
Reliable
Determines whether this service blocks on stop longer until all buffered messages have been tried to be dispatched into all destinations.
This property is true by default.
Certain destinations may take considerable time to fail per message (i.e. database connection timeout), consequently buffered messages
processing may delay service stop significantly if this property is true
Declaration
[Config("$reliable", true)]
[ExternalParameter(new string[]{"log"})]
public bool Reliable { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
WriteInterval
Determines how often a log should be written to storage.
The value of this property must be between 10 and 5000 (milliseconds)
Declaration
[Config("$write-interval-ms", 250)]
[ExternalParameter(new string[]{"log"})]
public int WriteInterval { get; set; }
Property Value
Type |
Description |
System.Int32 |
|
Methods
DoStart()
Declaration
protected override void DoStart()
Overrides
DoWaitForCompleteStop()
Declaration
protected override void DoWaitForCompleteStop()
Overrides
DoWrite(Message, Boolean)
Writes log message into log
Declaration
protected override void DoWrite(Message msg, bool urgent)
Parameters
Type |
Name |
Description |
Message |
msg |
|
System.Boolean |
urgent |
|
Overrides
Implements
System.IDisposable
Extension Methods