Table of Contents

Class DefaultLoggingProperties

Namespace
Arc4u.Diagnostics
Assembly
Arc4u.dll

The default IAddPropertiesToLog: it adds the user of the current IApplicationContext to the log entries, as the email of its profile (a claim every identity provider can give), or its identity name when there is no email. It is registered as a scoped service under the key Scoped.

[Export("Scoped", typeof(IAddPropertiesToLog))]
[Scoped]
public class DefaultLoggingProperties : IAddPropertiesToLog
Inheritance
DefaultLoggingProperties
Implements
Inherited Members

Constructors

DefaultLoggingProperties(IApplicationContext)

Initializes a new instance of the DefaultLoggingProperties class.

public DefaultLoggingProperties(IApplicationContext applicationContext)

Parameters

applicationContext IApplicationContext

The application context that provides the current principal.

Methods

GetProperties()

Gets the properties to add to the log entries.

public IDictionary<string, object> GetProperties()

Returns

IDictionary<string, object>

A dictionary containing the identity (the email of the profile, or the identity name of the principal when the identity provider gave no email) when the application context has a principal; otherwise an empty dictionary.