Class LogDaemonBase
Based class for implementing test and non-test logging services.
Destinations may fail and the message will be failed-over into another destination in the same logger
as specified by 'failover' attribute of destination. This attribute is also present on service level.
Cascading failover is not supported (failover of failovers). Another consideration is that messages
get sent into destinations synchronously by internal thread so specifying too many destinations may
limit overall LogService throughput. In complex scenarios consider using LogServiceDestination instead.
Inheritance
System.Object
LogDaemonBase
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
public abstract class LogDaemonBase : DaemonWithInstrumentation<IApplicationComponent>, IDaemon, IDaemonView, INamed, ILogImplementation, ILog, ILocalizedTimeProvider, IDisposable, IConfigurable, IInstrumentable, IExternallyParameterized, ISinkOwnerRegistration, ISinkOwner, IApplicationComponent
Constructors
LogDaemonBase(IApplicationComponent)
Creates a new logging daemon instance
Declaration
protected LogDaemonBase(IApplicationComponent director)
Parameters
LogDaemonBase(IApplication)
Creates a new logging daemon instance
Declaration
protected LogDaemonBase(IApplication app)
Parameters
Fields
m_InstrumentationEnabled
Declaration
protected bool m_InstrumentationEnabled
Field Value
Type |
Description |
System.Boolean |
|
m_Sinks
Declaration
protected OrderedRegistry<Sink> m_Sinks
Field Value
Properties
ComponentCommonName
Declaration
public override string ComponentCommonName { get; }
Property Value
Type |
Description |
System.String |
|
Overrides
ComponentLogTopic
Declaration
public override string ComponentLogTopic { get; }
Property Value
Type |
Description |
System.String |
|
Overrides
DefaultFailover
Sets destination name used for failover on the service-level
if particular failing destination did not specify its specific failover
Declaration
[Config("$default-failover")]
[ExternalParameter(new string[]{"log"})]
public string DefaultFailover { get; set; }
Property Value
Type |
Description |
System.String |
|
FailoverError
Returns last exception that happened during failover. This kind of exceptions is never propagated and always handled
Declaration
public Exception FailoverError { get; }
Property Value
Type |
Description |
System.Exception |
|
FailoverErrorSink
Returns a destination that threw last exception that happened during failover. This kind of exceptions is never propagated and always handled
Declaration
public Sink FailoverErrorSink { get; }
Property Value
InstrumentationBufferSize
Declaration
[Config]
[ExternalParameter(new string[]{"log", "instrumentation"})]
public int InstrumentationBufferSize { get; set; }
Property Value
Type |
Description |
System.Int32 |
|
InstrumentationEnabled
Implements IInstrumentable
Declaration
[Config(Default = false)]
[ExternalParameter(new string[]{"log", "instrumentation"})]
public override bool InstrumentationEnabled { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
Overrides
Azos.Apps.DaemonWithInstrumentation<Azos.Apps.IApplicationComponent>.InstrumentationEnabled
LastCatastrophe
Latches last problematic msg
Declaration
public Message LastCatastrophe { get; }
Property Value
LastError
Latches last problematic msg
Declaration
public Message LastError { get; }
Property Value
LastWarning
Latches last problematic msg
Declaration
public Message LastWarning { get; }
Property Value
Sinks
Returns sinks. This call is thread safe
Declaration
public IOrderedRegistry<Sink> Sinks { get; }
Property Value
SinksAreOptional
Indicates whether the service can operate without any sinks registered, i.e. some test loggers may not need
any destinations to operate as they synchronously write to some buffer without any extra sinks
Declaration
public virtual bool SinksAreOptional { get; }
Property Value
Type |
Description |
System.Boolean |
|
Methods
Destructor()
Declaration
protected override void Destructor()
Overrides
Declaration
protected override void DoConfigure(IConfigSectionNode node)
Parameters
Overrides
DoSignalStop()
Declaration
protected override void DoSignalStop()
Overrides
DoStart()
Declaration
protected override void DoStart()
Overrides
DoWaitForCompleteStop()
Declaration
protected override void DoWaitForCompleteStop()
Overrides
DoWrite(Message, Boolean)
Writes log message into log
Declaration
protected abstract void DoWrite(Message msg, bool urgent)
Parameters
Type |
Name |
Description |
Message |
msg |
Message to write
|
System.Boolean |
urgent |
Indicates that the logging service implementation must
make an effort to write the message to its destinations urgently
|
GetInstrumentationBuffer(Boolean)
Returns instrumentation buffer if instrumentation enabled
Declaration
public IEnumerable<Message> GetInstrumentationBuffer(bool asc)
Parameters
Type |
Name |
Description |
System.Boolean |
asc |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<Message> |
|
Pulse()
Declaration
Write(Message)
Writes log message into log
Declaration
public void Write(Message msg)
Parameters
Type |
Name |
Description |
Message |
msg |
Message to write
|
Write(Message, Boolean)
Writes log message into log
Declaration
public void Write(Message msg, bool urgent)
Parameters
Type |
Name |
Description |
Message |
msg |
Message to write
|
System.Boolean |
urgent |
Indicates that the logging service implementation must
make an effort to write the message to its destinations urgently
|
Write(MessageType, String, Boolean, String, String)
Writes log message into log
Declaration
public void Write(MessageType type, string text, bool urgent, string topic = null, string from = null)
Parameters
Type |
Name |
Description |
MessageType |
type |
|
System.String |
text |
|
System.Boolean |
urgent |
|
System.String |
topic |
|
System.String |
from |
|
Write(MessageType, String, String, String)
Writes log message into log
Declaration
public void Write(MessageType type, string text, string topic = null, string from = null)
Parameters
Type |
Name |
Description |
MessageType |
type |
|
System.String |
text |
|
System.String |
topic |
|
System.String |
from |
|
Explicit Interface Implementations
ISinkOwner.LogDaemon
Declaration
LogDaemonBase ISinkOwner.LogDaemon { get; }
Returns
Implements
System.IDisposable
Extension Methods