Table of Contents

Namespace Arc4u.Diagnostics

Classes

DefaultActivitySourceFactory

Default Arc4u implementation of the IActivitySourceFactory. Thread Safe implementation.

DefaultLogger

Marker type used as the category of the non-generic ILogger resolved from the container (see AddILogger(IServiceCollection)).

DefaultLoggingProperties

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.

Helper

Helper methods to read the Arc4u properties of a Serilog Serilog.Events.LogEvent.

ILoggerExtensions

Extension methods on ILogger and ILogger<TCategoryName> that select the Arc4u message category (MessageCategory) and return an ILoggerWrapper<T> on which properties can be added fluently before the message is written.

LoggerBaseWrapper<T>

Base implementation of ILoggerWrapper<T>. It enriches every log entry with the Arc4u properties (see LoggingConstants) and the properties supplied by IAddPropertiesToLog before forwarding it to the underlying logger.

LoggerDefaults

Default logging helpers shared by Arc4u components.

LoggerWrapperExtensions

Fluent extension methods that add properties to the additional fields of an ILoggerWrapper<T>; they are written with the next log entry of that logger.

LoggerWrapper<T>

Transient implementation of ILoggerWrapper<T> that decorates the ILogger<TCategoryName> created by the ILoggerFactory. The IAddPropertiesToLog it uses depends on where it is resolved: in a scope (an HTTP or gRPC request, a CreateScope()), the provider registered under the key "Scoped", which may depend on scoped services; from the root (a singleton and its dependencies), the provider registered under the key "Transient", which must not.

LoggingConstants

Reserved names of the properties used by the Arc4u logger. They cannot be used as custom property keys. Most are added by the logger to each entry; ActivityId is only present when there is a current Activity, Identity only when an IAddPropertiesToLog provider supplies it and Stacktrace only when requested.

MessageCategoryRegistry

Gives a name to the categories invented by the application. A category is a short flag: the predefined ones are Technical (1), Business (2) and Monitoring (4); an application can use the other bits (8, 16, ...) for its own categories. Once a name is registered, the logger writes the Category property with that name and the Arc4u sinks, formatter and log stores read it back as the flag.

MessagePropertyEx

Extension methods to add entries to a dictionary of log properties.

NullLoggerProperties

The NullLoggerProperties is used when no properties are added to the log. It is a good practice to use this class when no properties are added to the log like in unit testing.

NullLoggerWrapper<T>

Helper class to unit test the Arc4u logging.

OpenTelemetrySettings

Class used to bind settings from the configuration file. This type is not consumed by any other Arc4u package.

ReservedLoggingKeyException

The exception thrown when a custom log property uses a key reserved by LoggingConstants.

Interfaces

IActivitySourceFactory

Interface defining the method to obtain a singleton instance of a ActivitySource to add Telemetry in a .net core project.

IAddPropertiesToLog

Provides additional properties that the Arc4u logger adds to every log entry (for example the identity of the current user or a correlation id). Implementations are registered as keyed services with the keys "Scoped" and "Transient".

ILogWriter

Represents a component that writes the log entries to a destination (for example a file or a database) and must be initialized before use.

ILoggerCallerMember

Allows a logger to receive the name of the member that is emitting a log entry.

ILoggerWrapper<T>

An ILogger<TCategoryName> that lets callers attach extra properties (see LoggerWrapperExtensions) and a message category to the log entry before it is written.

Enums

MessageCategory

Specifies the different categories.

PropertyFilter

Specifies which properties of a log entry are selected. This enumeration is not referenced elsewhere in the Arc4u packages.