LoggingAspect NuGet Package

Assembly to allow logging via Attributes

Logging for a class is enabled by decorating it with the [Loggable] attribute and deriving from ContextBoundObject.
Another option is to derive from LoggableObject.

The [Log] attribute will enable logging with de Default logger.

The DefaultMessageLogger and DefaultExceptionLogger in Loggers can be replaced with custom implementations.
The [LogWith(Type)] allowes to specify a logger type that should be used for logging the method. A Custom Logger specified by this attribute must have a parameterless constructor.

Both Attributes can be used as class / method attributes. When used as class attributes loggers will be called for every external call to the object. It is possible to combine both variants.

If the logger implements MethodLogger method entry and leaving will be logged.
If the logger implements ExceptionLogger than all exception will be logged.
It is possible to implement both interfaces and enable standard and exception logging with just 1 attribute.
It is possible to specify multiple loggers
In order to create complex Loggers (with parameters / Properties to be provided) you can provide an own ObjectResolver (Loggers.LoggerResolver).

e.g. for using a Dependency-Injection container or service locator.




Got any LoggingAspect Question?





Info

Version: 1.0.1
Author(s): Lars Baldes
Last Update: Monday, January 19, 2015
.NET Fiddle: Create the first Fiddle
Project Url: https://www.nuget.org/packages/LoggingAspect
NuGet Url: https://www.nuget.org/packages/LoggingAspect


Install
Install-Package LoggingAspect
dotnet add package LoggingAspect
paket add LoggingAspect
LoggingAspect Download (Unzip the "nupkg" after downloading)



Tags



STATS

must-have-score

.5

avg-downloads-per-day

0

days-since-last-release

3594