Show / Hide Table of Contents

Class LogServiceBase

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
DisposableObject
ApplicationComponent
Service
Service<System.Object>
ServiceWithInstrumentationBase<System.Object>
LogServiceBase
LogService
Implements
IService
INamed
ILogImplementation
ILog
IApplicationComponent
ILocalizedTimeProvider
System.IDisposable
IConfigurable
IInstrumentable
IExternallyParameterized
Inherited Members
ServiceWithInstrumentationBase<Object>.ExternalParameters
ServiceWithInstrumentationBase<Object>.ExternalParametersForGroups(String[])
ServiceWithInstrumentationBase<Object>.ExternalGetParameter(String, Object, String[])
ServiceWithInstrumentationBase<Object>.ExternalSetParameter(String, Object, String[])
Service<Object>.ComponentDirector
Service.CONFIG_NAME_ATTR
Service.ApplicationDontAutoStartService
Service.Status
Service.Running
Service.Name
Service.TimeLocation
Service.LocalizedTime
Service.Configure(IConfigSectionNode)
Service.Start()
Service.SignalStop()
Service.CheckForCompleteStop()
Service.WaitForCompleteStop()
Service.AcceptManagerVisit(Object, DateTime)
Service.UniversalTimeToLocalizedTime(DateTime)
Service.LocalizedTimeToUniversalTime(DateTime)
Service.AbortStart()
Service.DoSignalStop()
Service.DoCheckForCompleteStop()
Service.CheckServiceInactive()
Service.CheckServiceActive()
Service.CheckServiceActiveOrStarting()
Service.DoAcceptManagerVisit(Object, DateTime)
Service.____ObtainPrivateServiceStatusLockObject()
ApplicationComponent.AllComponents
ApplicationComponent.GetAppComponentBySID(UInt64)
ApplicationComponent.GetAppComponentByCommonName(String)
ApplicationComponent.ComponentSID
ApplicationComponent.ComponentStartTime
DisposableObject.DisposeAndNull<T>(T)
DisposableObject.DisposeStarted
DisposableObject.Disposed
DisposableObject.EnsureObjectNotDisposed()
DisposableObject.Dispose()
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)
System.Object.ToString()
Namespace: NFX.Log
Assembly: NFX.dll
Syntax
public abstract class LogServiceBase : ServiceWithInstrumentationBase<object>, IService, INamed, ILogImplementation, ILog, IApplicationComponent, ILocalizedTimeProvider, IDisposable, IConfigurable, IInstrumentable, IExternallyParameterized

Constructors

LogServiceBase()

Creates a new logging service instance

Declaration
protected LogServiceBase()

LogServiceBase(Service)

Creates a new logging service instance

Declaration
protected LogServiceBase(Service director = null)
Parameters
Type Name Description
Service director

Fields

m_Destinations

Declaration
protected LogServiceBase.DestinationList m_Destinations
Field Value
Type Description
LogServiceBase.DestinationList

m_InstrumentationEnabled

Declaration
protected bool m_InstrumentationEnabled
Field Value
Type Description
System.Boolean

Properties

ComponentCommonName

Declaration
public override string ComponentCommonName { get; }
Property Value
Type Description
System.String
Overrides
ApplicationComponent.ComponentCommonName

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

Destinations

Returns registered destinations. This call is thread safe

Declaration
public IEnumerable<Destination> Destinations { get; }
Property Value
Type Description
System.Collections.Generic.IEnumerable<Destination>

DestinationsAreOptional

Indicates whether the service can operate without any destinations registered, i.e. some test loggers may not need any destinations to operate as they synchronously write to some buffer without any extra destinations

Declaration
public virtual bool DestinationsAreOptional { get; }
Property Value
Type Description
System.Boolean

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

FailoverErrorDestination

Returns a destination that threw last exception that happened durng failover. This kind of exceptions is never propagated and always handled

Declaration
public Destination FailoverErrorDestination { get; }
Property Value
Type Description
Destination

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
NFX.ServiceModel.ServiceWithInstrumentationBase<System.Object>.InstrumentationEnabled

LastCatastrophy

Latches last problematic msg

Declaration
public Message LastCatastrophy { get; }
Property Value
Type Description
Message

LastError

Latches last problematic msg

Declaration
public Message LastError { get; }
Property Value
Type Description
Message

LastWarning

Latches last problematic msg

Declaration
public Message LastWarning { get; }
Property Value
Type Description
Message

Now

Returns localized log time

Declaration
public DateTime Now { get; }
Property Value
Type Description
System.DateTime

Methods

Destructor()

Declaration
protected override void Destructor()
Overrides
Service.Destructor()

DoConfigure(IConfigSectionNode)

Declaration
protected override void DoConfigure(IConfigSectionNode node)
Parameters
Type Name Description
IConfigSectionNode node
Overrides
Service.DoConfigure(IConfigSectionNode)

DoStart()

Declaration
protected override void DoStart()
Overrides
Service.DoStart()

DoWaitForCompleteStop()

Declaration
protected override void DoWaitForCompleteStop()
Overrides
Service.DoWaitForCompleteStop()

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
protected void Pulse()

RegisterDestination(Destination, Int32)

Adds a destination to this service active destinations. Negative index to append

Declaration
public void RegisterDestination(Destination dest, int atIdx = -1)
Parameters
Type Name Description
Destination dest
System.Int32 atIdx

UnRegisterDestination(Destination)

Removes a destiantion from this service active destinations, returns true if destination was found and removed

Declaration
public bool UnRegisterDestination(Destination dest)
Parameters
Type Name Description
Destination dest
Returns
Type Description
System.Boolean

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

Implements

IService
INamed
ILogImplementation
ILog
IApplicationComponent
ILocalizedTimeProvider
System.IDisposable
IConfigurable
IInstrumentable
IExternallyParameterized

Extension Methods

MiscUtils.NonNull<T>(T, Func<Exception>, String)
ObjectValueConversion.AsString(Object, String, ConvertErrorHandling)
ObjectValueConversion.AsNonNullOrEmptyString(Object)
ObjectValueConversion.AsLaconicConfig(Object, ConfigSectionNode, String, ConvertErrorHandling)
ObjectValueConversion.AsJSONConfig(Object, ConfigSectionNode, String, ConvertErrorHandling)
ObjectValueConversion.AsXMLConfig(Object, ConfigSectionNode, ConvertErrorHandling)
ObjectValueConversion.AsChar(Object, Char, ConvertErrorHandling)
ObjectValueConversion.AsNullableChar(Object, Nullable<Char>, ConvertErrorHandling)
ObjectValueConversion.AsByte(Object, Byte, ConvertErrorHandling)
ObjectValueConversion.AsNullableByte(Object, Nullable<Byte>, ConvertErrorHandling)
ObjectValueConversion.AsSByte(Object, SByte, ConvertErrorHandling)
ObjectValueConversion.AsNullableSByte(Object, Nullable<SByte>, ConvertErrorHandling)
ObjectValueConversion.AsShort(Object, Int16, ConvertErrorHandling)
ObjectValueConversion.AsNullableShort(Object, Nullable<Int16>, ConvertErrorHandling)
ObjectValueConversion.AsUShort(Object, UInt16, ConvertErrorHandling)
ObjectValueConversion.AsNullableUShort(Object, Nullable<UInt16>, ConvertErrorHandling)
ObjectValueConversion.AsInt(Object, Int32, ConvertErrorHandling)
ObjectValueConversion.AsNullableInt(Object, Nullable<Int32>, ConvertErrorHandling)
ObjectValueConversion.AsUInt(Object, UInt32, ConvertErrorHandling)
ObjectValueConversion.AsNullableUInt(Object, Nullable<UInt32>, ConvertErrorHandling)
ObjectValueConversion.AsLong(Object, Int64, ConvertErrorHandling)
ObjectValueConversion.AsNullableLong(Object, Nullable<Int64>, ConvertErrorHandling)
ObjectValueConversion.AsULong(Object, UInt64, ConvertErrorHandling)
ObjectValueConversion.AsNullableULong(Object, Nullable<UInt64>, ConvertErrorHandling)
ObjectValueConversion.AsDouble(Object, Double, ConvertErrorHandling)
ObjectValueConversion.AsNullableDouble(Object, Nullable<Double>, ConvertErrorHandling)
ObjectValueConversion.AsFloat(Object, Single, ConvertErrorHandling)
ObjectValueConversion.AsNullableFloat(Object, Nullable<Single>, ConvertErrorHandling)
ObjectValueConversion.AsDecimal(Object, Decimal, ConvertErrorHandling)
ObjectValueConversion.AsNullableDecimal(Object, Nullable<Decimal>, ConvertErrorHandling)
ObjectValueConversion.AsBool(Object, Boolean, ConvertErrorHandling)
ObjectValueConversion.AsNullableBool(Object, Nullable<Boolean>, ConvertErrorHandling)
ObjectValueConversion.AsGUID(Object, Guid, ConvertErrorHandling)
ObjectValueConversion.AsNullableGUID(Object, Nullable<Guid>, ConvertErrorHandling)
ObjectValueConversion.AsDateTime(Object)
ObjectValueConversion.AsDateTime(Object, DateTime, ConvertErrorHandling)
ObjectValueConversion.AsNullableDateTime(Object, Nullable<DateTime>, ConvertErrorHandling)
ObjectValueConversion.AsGDID(Object)
ObjectValueConversion.AsGDID(Object, GDID, ConvertErrorHandling)
ObjectValueConversion.AsNullableGDID(Object, Nullable<GDID>, ConvertErrorHandling)
ObjectValueConversion.AsGDIDSymbol(Object)
ObjectValueConversion.AsGDIDSymbol(Object, GDIDSymbol, ConvertErrorHandling)
ObjectValueConversion.AsNullableGDIDSymbol(Object, Nullable<GDIDSymbol>, ConvertErrorHandling)
ObjectValueConversion.AsTimeSpan(Object)
ObjectValueConversion.AsTimeSpan(Object, TimeSpan, ConvertErrorHandling)
ObjectValueConversion.AsNullableTimeSpan(Object, Nullable<TimeSpan>, ConvertErrorHandling)
ObjectValueConversion.AsEnum<TEnum>(Object, TEnum, ConvertErrorHandling)
ObjectValueConversion.AsNullableEnum<TEnum>(Object, Nullable<TEnum>, ConvertErrorHandling)
ObjectValueConversion.AsUri(Object, Uri, ConvertErrorHandling)
JSONExtensions.ToJSON(Object, JSONWritingOptions)
JSONExtensions.ToJSON(Object, TextWriter, JSONWritingOptions)
JSONExtensions.ToJSON(Object, Stream, JSONWritingOptions, Encoding)
ErlObject.ToErlObject(Object)
ErlObject.ToErlObject(Object, ErlTypeOrder, Boolean)
Back to top Copyright © 2006-2018 Agnicore Inc
Generated by DocFX