54 object M =
Arguments[0].AssociatedObjectValue;
55 string Object =
string.Empty;
56 string Actor =
string.Empty;
57 string EventId =
string.Empty;
58 string Facility =
string.Empty;
59 string Module =
string.Empty;
60 string StackTrace =
string.Empty;
63 bool Detailed =
false;
65 if (!(M is
string Message))
67 if (M is Exception ex)
72 Object = ex is
IEventObject Obj2 && !
string.IsNullOrEmpty(s = Obj2.Object) ? s : Object;
73 Actor = ex is
IEventActor Act && !
string.IsNullOrEmpty(s = Act.Actor) ? s : Actor;
74 EventId = ex is
IEventId EvId && !
string.IsNullOrEmpty(s = EvId.EventId) ? s : EventId;
75 Level = ex is
IEventLevel Lvl && Lvl.Level.HasValue ? Lvl.Level.Value : Level;
76 Facility = ex is
IEventFacility EvFa && !
string.IsNullOrEmpty(s = EvFa.Facility) ? s : Facility;
77 Module = ex is
IEventModule Mod && !
string.IsNullOrEmpty(s = Mod.Module) ? s : ex.Source;
82 KeyValuePair<string, object>[] Tags3 = Tags2.Tags;
93 Message = M?.ToString() ??
string.Empty;
97 Arguments[1].AssociatedObjectValue is IDictionary<string, IElement> Obj)
99 foreach (KeyValuePair<string, IElement> P
in Obj)
101 switch (P.Key.ToUpper())
104 Object =
ToString(P.Value) ??
string.Empty;
108 Actor =
ToString(P.Value) ??
string.Empty;
112 EventId =
ToString(P.Value) ??
string.Empty;
116 Facility =
ToString(P.Value) ??
string.Empty;
120 Module =
ToString(P.Value) ??
string.Empty;
124 StackTrace =
ToString(P.Value) ??
string.Empty;
128 if (P.Value.AssociatedObjectValue is
EventLevel L ||
129 Enum.TryParse(
ToString(P.Value) ??
string.Empty, out L))
138 Tags.
Add(
new KeyValuePair<string, object>(P.Key, P.Value.AssociatedObjectValue));
146 Tags.
Add(
new KeyValuePair<string, object>(P.Key, P.Value.AssociatedObjectValue));
156 this.
DoLog(Message, Object, Actor, EventId, Level, Facility, Module, StackTrace,
157 Tags?.ToArray() ?? Array.Empty<KeyValuePair<string, object>>());
169 public abstract void DoLog(
string Message);
183 public abstract void DoLog(
string Message,
string Object,
string Actor,
string EventId,
EventLevel Level,
184 string Facility,
string Module,
string StackTrace, params KeyValuePair<string, object>[] Tags);
Static class managing the application event log. Applications and services log events on this static ...
static string CleanStackTrace(string StackTrace)
Cleans a Stack Trace string, removing entries from the asynchronous execution model,...
A chunked list is a linked list of chunks of objects of type T .
void AddRange(IEnumerable< T > Collection)
Adds a range of elements (last) to the list.
void Add(T Item)
Adds an item to the collection.
Class managing a script expression.
Abstract base class for log functions
override IElement Evaluate(IElement[] Arguments, Variables Variables)
Evaluates the function.
LogFunction(ScriptNode Message, int Start, int Length, Expression Expression)
Abstract base class for log functions
LogFunction(ScriptNode Message, ScriptNode Tags, int Start, int Length, Expression Expression)
Abstract base class for log functions
override string[] DefaultArgumentNames
Default Argument names
abstract void DoLog(string Message)
Logs information to the event log.
abstract void DoLog(string Message, string Object, string Actor, string EventId, EventLevel Level, string Facility, string Module, string StackTrace, params KeyValuePair< string, object >[] Tags)
Logs information to the event log.
Base class for multivariate funcions.
ScriptNode[] Arguments
Function arguments.
Base class for all nodes in a parsed script tree.
int Length
Length of expression covered by node.
override string ToString()
Expression Expression
Expression of which the node is a part.
int Start
Start position in script expression.
Implement this interface on exception classes to allow the log to extract actor information in corres...
Implement this interface on exception classes to allow the log to extract facility information in cor...
Implement this interface on exception classes to allow the log to extract Event ID information in cor...
Implement this interface on exception classes to allow the log to extract Event Level information in ...
Implement this interface on exception classes to allow the log to extract module information in corre...
Implement this interface on exception classes to allow the log to extract object information in corre...
Basic interface for all types of elements.
ArgumentType
Type of parameter used in a function definition or a lambda definition.