Show / Hide Table of Contents

Class Message

Represents a Log message

Inheritance
System.Object
Message
Implements
IArchiveLoggable
IBSONSerializable
IBSONDeserializable
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)
Namespace: NFX.Log
Assembly: NFX.dll
Syntax
[Serializable]
[BSONSerializable("A05AEE0F-A33C-4B1D-AA45-CDEAF894A095")]
public sealed class Message : IArchiveLoggable, IBSONSerializable, IBSONDeserializable

Constructors

Message()

Declaration
[SlimDeserializationCtorSkip]
public Message()

Message(Object, String, Int32)

Creates message with Parameters supplanted with caller file name and line #

Declaration
public Message(object pars, string file = null, int line = 0)
Parameters
Type Name Description
System.Object pars
System.String file
System.Int32 line

Fields

BSON_FLD_ARCHIVE_DIMENSIONS

Declaration
public const string BSON_FLD_ARCHIVE_DIMENSIONS = "arc"
Field Value
Type Description
System.String

BSON_FLD_CHANNEL

Declaration
public const string BSON_FLD_CHANNEL = "chan"
Field Value
Type Description
System.String

BSON_FLD_EXCEPTION

Declaration
public const string BSON_FLD_EXCEPTION = "exc"
Field Value
Type Description
System.String

BSON_FLD_FROM

Declaration
public const string BSON_FLD_FROM = "from"
Field Value
Type Description
System.String

BSON_FLD_HOST

Declaration
public const string BSON_FLD_HOST = "host"
Field Value
Type Description
System.String

BSON_FLD_PARAMETERS

Declaration
public const string BSON_FLD_PARAMETERS = "prms"
Field Value
Type Description
System.String

BSON_FLD_RELATED_TO

Declaration
public const string BSON_FLD_RELATED_TO = "rel"
Field Value
Type Description
System.String

BSON_FLD_SOURCE

Declaration
public const string BSON_FLD_SOURCE = "src"
Field Value
Type Description
System.String

BSON_FLD_TEXT

Declaration
public const string BSON_FLD_TEXT = "text"
Field Value
Type Description
System.String

BSON_FLD_TIMESTAMP

Declaration
public const string BSON_FLD_TIMESTAMP = "time"
Field Value
Type Description
System.String

BSON_FLD_TOPIC

Declaration
public const string BSON_FLD_TOPIC = "top"
Field Value
Type Description
System.String

BSON_FLD_TYPE

Declaration
public const string BSON_FLD_TYPE = "tp"
Field Value
Type Description
System.String

DefaultHostName

Declaration
public static string DefaultHostName
Field Value
Type Description
System.String

Properties

ArchiveDimensions

Gets/Sets archive dimension content for later retrieval of messages by key, i.e. a user ID may be used. In most cases JSON or Laconic content is stored, the format depends on a concrete system

Declaration
public string ArchiveDimensions { get; set; }
Property Value
Type Description
System.String

Channel

Gets/Sets logical partition for messages. This property is usually used in Archive for splitting destinations

Declaration
public string Channel { get; set; }
Property Value
Type Description
System.String

Exception

Gets/Sets exception associated with message. Set this property EVEN IF the name/text of exception is already included in Text as log destinations may elect to dump the whole stack trace

Declaration
public Exception Exception { get; set; }
Property Value
Type Description
System.Exception

From

Gets/Sets logical component ID, such as: class name, method name, process instance, that generated the message. This field is used in the scope of Topic

Declaration
public string From { get; set; }
Property Value
Type Description
System.String

Guid

Returns global unique identifier for this particular message

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

Host

Gets/Sets host name that generated the message

Declaration
public string Host { get; set; }
Property Value
Type Description
System.String

Parameters

Gets/Sets a structured parameter bag, this may be used for additional debug info like source file name, additional context etc.

Declaration
public string Parameters { get; set; }
Property Value
Type Description
System.String

RelatedTo

Gets/Sets global unique identifier of a message that this message is related to. No referential integrity check is performed

Declaration
public Guid RelatedTo { get; set; }
Property Value
Type Description
System.Guid

Source

Gets/Sets message source line number/tracepoint#, this is used in conjunction with From

Declaration
public int Source { get; set; }
Property Value
Type Description
System.Int32

Text

Gets/Sets an unstructured message text, the emitting component name must be in From field, not in text. Note about logging errors. Use caught exception.ToMessageWithType() method, then attach the caught exception as Exception property

Declaration
public string Text { get; set; }
Property Value
Type Description
System.String

TimeStamp

Gets/Sets timestamp when message was generated

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

Topic

Gets/Sets a message topic/relation - the name of software concern within the big app, i.e. "Database" or "Security"

Declaration
public string Topic { get; set; }
Property Value
Type Description
System.String

Type

Gets/Sets message type, such as: Info/Warning/Error etc...

Declaration
public MessageType Type { get; set; }
Property Value
Type Description
MessageType

Methods

Clone()

Declaration
public Message Clone()
Returns
Type Description
Message

DeserializeFromBSON(BSONSerializer, BSONDocument, ref Object)

Declaration
public void DeserializeFromBSON(BSONSerializer serializer, BSONDocument doc, ref object context)
Parameters
Type Name Description
BSONSerializer serializer
BSONDocument doc
System.Object context

FormatCallerParams(Object, String, Int32)

Supplants the from string with caller as JSON string

Declaration
public static object FormatCallerParams(object pars, string file = null, int line = 0)
Parameters
Type Name Description
System.Object pars
System.String file
System.Int32 line
Returns
Type Description
System.Object

IsKnownTypeForBSONDeserialization(Type)

Declaration
public bool IsKnownTypeForBSONDeserialization(Type type)
Parameters
Type Name Description
System.Type type
Returns
Type Description
System.Boolean

SerializeToBSON(BSONSerializer, BSONDocument, IBSONSerializable, ref Object)

Declaration
public void SerializeToBSON(BSONSerializer serializer, BSONDocument doc, IBSONSerializable parent, ref object context)
Parameters
Type Name Description
BSONSerializer serializer
BSONDocument doc
IBSONSerializable parent
System.Object context

SetParamsAsObject(Object)

Declaration
public Message SetParamsAsObject(object p)
Parameters
Type Name Description
System.Object p
Returns
Type Description
Message

ToString()

Declaration
public override string ToString()
Returns
Type Description
System.String
Overrides
System.Object.ToString()

Implements

IArchiveLoggable
IBSONSerializable
IBSONDeserializable

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)
MessageExtensions.ThisOrNewSafeWrappedException(Message, Boolean)
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