Skip to content

Extension for Autofac dependency injection container that helps to configure and add TacitusLogger as a singleton.

License

Notifications You must be signed in to change notification settings

hanlarmammadov/TacitusLogger.DI.Autofac

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TacitusLogger.DI.Autofac

Extension for Autofac dependency injection container that helps to configure and add TacitusLogger as a singleton.

Dependencies:

  • NET Standard >= 1.3
  • Autofac >= 4.0.0
  • TacitusLogger >= 0.3.0

Attention: TacitusLogger.DI.Autofac is currently in Alpha phase. This means you should not use it in any production code.

Installation

The NuGet package:

PM> Install-Package TacitusLogger.DI.Autofac

Examples

Registering logger with Autofac

ContainerBuilder containerBuilder = new ContainerBuilder();
// Configuring and registering TacitusLogger with Autofac as a singleton
containerBuilder.TacitusLogger("logger1").ForAllLogs()
                                         .Console()
                                         .Add()
                                         .BuildLogger();
var container = containerBuilder.Build();

// Using
ILogger logger = container.Resolve<ILogger>();

Or:

ContainerBuilder containerBuilder = new ContainerBuilder();
// Configuring and registering TacitusLogger with Autofac as a singleton
var loggerBuilder = containerBuilder.TacitusLogger("logger1");
loggerBuilder.ForAllLogs()
             .Console()
             .Add()
             .BuildLogger();

var container = containerBuilder.Build();

// Using
ILogger logger = container.Resolve<ILogger>();

License

APACHE LICENSE 2.0

See also

TacitusLogger:

Destinations:

Dependency injection:

  • TacitusLogger.DI.Ninject - Extension for Ninject dependency injection container that helps to configure and add TacitusLogger as a singleton.
  • TacitusLogger.DI.MicrosoftDI - Extension for Microsoft dependency injection container that helps to configure and add TacitusLogger as a singleton.

Log contributors:

About

Extension for Autofac dependency injection container that helps to configure and add TacitusLogger as a singleton.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages