Skip to content

01214ac9 780c 726a 561d 26c0959cf4b3

Axel Kesseler edited this page Mar 1, 2023 · 18 revisions

EmptyLogger(TContext).Write(TScope) Method (TScope, LogLevel, Exception, ValueTuple(String, Object)[])

This method writes the exception for provided scope into the logging target using provided logging level.

Namespace: Plexdata.LogWriter.Logging
Assembly: Plexdata.LogWriter.Abstraction (in Plexdata.LogWriter.Abstraction.dll) Version: 1.0.7.1

Syntax

C#

public void Write<TScope>(
	TScope scope,
	LogLevel level,
	Exception exception,
	params (string , Object )[] details
)

Parameters

 

scope
Type: TScope
The instance of the type to get the logging scope from.
level
Type: Plexdata.LogWriter.Definitions.LogLevel
The logging level to be used to tag the written logging data.
exception
Type: System.Exception
The exception to be written.
details
Type: System.ValueTuple(String, Object)[]
An optional list of label-value-pair combinations containing additional information.

Type Parameters

 

TScope
The type to get the logging scope from.

Implements

ILogger.Write(TScope)(TScope, LogLevel, Exception, ValueTuple(String, Object)[])

Remarks

This method performs the actual writing of logging data into the logging target using a particular logging level. Be aware, nothing will happen if exception is null.

The logging scope is intended to be more than just the type name.  

  • If parameter scope is for example of type String then this string is used.
  • If parameter scope is for example of type Guid then the guid's string representation is taken by calling ToString(). Using a Guid as scope type can be seen as some kind of correlation ID, especially if this Guid is the same for multiple calls.
  • If parameter scope is for example of type MemberInfo then the referenced member's Name is taken instead.
  • In all other cases the scope text is either taken from the type's FullName or it is just the Name of type TScope. The usage of full or short name is determined from current settings.

See Also

Reference

EmptyLogger(TContext) Class
Write Overload
Plexdata.LogWriter.Logging Namespace

Clone this wiki locally