TCIS.Logging.Autofac 1.0.1-rc.7

This is a prerelease version of TCIS.Logging.Autofac.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package TCIS.Logging.Autofac --version 1.0.1-rc.7
                    
NuGet\Install-Package TCIS.Logging.Autofac -Version 1.0.1-rc.7
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="TCIS.Logging.Autofac" Version="1.0.1-rc.7" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="TCIS.Logging.Autofac" Version="1.0.1-rc.7" />
                    
Directory.Packages.props
<PackageReference Include="TCIS.Logging.Autofac" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add TCIS.Logging.Autofac --version 1.0.1-rc.7
                    
#r "nuget: TCIS.Logging.Autofac, 1.0.1-rc.7"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package TCIS.Logging.Autofac@1.0.1-rc.7
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=TCIS.Logging.Autofac&version=1.0.1-rc.7&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=TCIS.Logging.Autofac&version=1.0.1-rc.7&prerelease
                    
Install as a Cake Tool

TCIS.Logging.Autofac

A module supporting AOP (Aspect-Oriented Programming) for the logging system in TCIS, utilizing the Autofac library.

🌟 Overview

TCIS.Logging.Autofac replaces the default .NET DI Container with Autofac. Specifically, it provides:

  • Assembly Scanning: Automatically scans and registers Services by Suffixes.
  • AOP Interception: Automatically intercepts function calls to consistently log input parameters, execution time, and exceptions, without requiring repetitive logging code in the Business Logic.

📦 Installation

Install the package via .NET CLI:

dotnet add package TCIS.Logging.Autofac

⚙️ Configuration (appsettings.json)

You can customize AOP configurations (e.g., the list of suffixes to auto-register) in the TLogSettings:AopSettings section (default):

{
  "TLogSettings": {
    "AopSettings": {
      "DiRegistrationSuffixes": [ "Service", "Repository", "Manager" ]
    }
  }
}

🚀 Usage

In Program.cs, configure the IHostBuilder to use UseTAutofacLogging:

using Microsoft.Extensions.Hosting;
using System.Reflection;

var builder = WebApplication.CreateBuilder(args);

// Configure Autofac as the main DI Container and configure AOP Logging
builder.Host.UseTAutofacLogging(
    scanAssemblies: new[] { Assembly.GetExecutingAssembly() }, // Scan the current Assembly
    configSection: "TLogSettings:AopSettings",                 // Configuration section
    configureOptions: options => 
    {
        // Can be configured via code instead of appsettings
        options.DiRegistrationSuffixes.Add("Facade");
    }
);

var app = builder.Build();
app.Run();

💡 Basic Example

When you have an Interface and an implementation Class with a name ending in Service (e.g., IUserService and UserService):

public interface IUserService 
{
    Task<User> GetUserAsync(int id);
}

// This class will be automatically registered by Autofac (due to the 'Service' suffix)
// and automatically intercepted to log Input, Output, and Exceptions.
public class UserService : IUserService
{
    public async Task<User> GetUserAsync(int id)
    {
        return await _db.Users.FindAsync(id);
    }
}

By simply configuring UseTAutofacLogging(), you no longer need to manually register builder.Services.AddScoped<IUserService, UserService>().

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on TCIS.Logging.Autofac:

Package Downloads
TCIS.Pluggable.Engine.Autofac

TCIS Core Framework is an application framework for building modular, multi-tenant applications on ASP.NET Core. Autofac integration for TCIS.Pluggable.Engine

TCIS.Logging.Hosting

One-call TCIS application logging composition, startup lifecycle and downstream failure attribution.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.1-rc.10 52 10/8/2026
1.0.1-rc.9 41 10/8/2026
1.0.1-rc.8 55 10/8/2026
1.0.1-rc.7 48 10/8/2026
1.0.1-rc.6 54 10/8/2026
1.0.1-rc.4 49 10/7/2026
1.0.1-rc.3 47 10/7/2026
1.0.1-rc.2 66 10/5/2026
1.0.1-rc.1 55 10/5/2026
1.0.0 115 10/1/2026
1.0.0-rc.52 66 9/29/2026
1.0.0-rc.51 82 9/23/2026
1.0.0-rc.50 70 9/21/2026
1.0.0-rc.49 80 9/18/2026
1.0.0-rc.47 73 9/17/2026
1.0.0-rc.46 73 9/17/2026
1.0.0-rc.45 132 9/11/2026
1.0.0-rc.44 83 9/10/2026
1.0.0-rc.43 73 9/10/2026
1.0.0-rc.42 91 9/9/2026
Loading failed