Skip to content

endecipher/ActivityLogger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

packageIcon

ActivityLogger

Simple, extensible activity/event logging implementation for .NET

NuGet version (ActivityLogger)

Documentation

Extend and register (as a Singleton) via DI the below interface for logging activities.

public interface IActivityLogger
{
    void Log(Activity e);
}

Create your custom Activities by inheriting from the below:

public abstract class Activity : IActivity
{
    
}

Basic properties would include

ActivityLogLevel Level // LogLevel enum
string EntitySubject 
string Event 
string Description 
DateTimeOffset EventTime 

Apart from the above, each Activity can hold an optional number of parameters/entities/objects

AddParam(ActivityParam param)

An Activity can be enhanced with Caller Information by using

WithCallerInfo()

An Activity can be also be enhanced with certain context related information, which would be certain common properties, specific to application usage (or) context

Example usage

ActivityLogger?.Log(new ConcreteActivity
{
    Description = $"",
    EntitySubject = "",
    Event = "",
    Level = ActivityLogLevel.Debug,

}
.With(ActivityParam.New(Id, ""))
.With(ActivityParam.New(State, ""))
.WithCallerInfo());

Contributing

Contributions are always welcome!

Authors

License

MIT

About

ActivityLogger is a simple, extensible activity/event logging implementation for .NET

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages