LogInformant.Serilog.DotNetFramework
1.0.0
dotnet add package LogInformant.Serilog.DotNetFramework --version 1.0.0
NuGet\Install-Package LogInformant.Serilog.DotNetFramework -Version 1.0.0
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="LogInformant.Serilog.DotNetFramework" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="LogInformant.Serilog.DotNetFramework" Version="1.0.0" />
<PackageReference Include="LogInformant.Serilog.DotNetFramework" />
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 LogInformant.Serilog.DotNetFramework --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: LogInformant.Serilog.DotNetFramework, 1.0.0"
#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 LogInformant.Serilog.DotNetFramework@1.0.0
#: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=LogInformant.Serilog.DotNetFramework&version=1.0.0
#tool nuget:?package=LogInformant.Serilog.DotNetFramework&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
LogInformant.Serilog.DotNetFramework
Send logs to LogInformant from .NET Framework 4.8 applications using Serilog.
Using .NET 6+? Use LogInformant.Serilog.DotNetCore instead.
Install
Install-Package LogInformant.Serilog.DotNetFramework
Quick Start — Global.asax.cs (one line)
using Serilog;
using LogInformant.Serilog.DotNetFramework;
public class MvcApplication : System.Web.HttpApplication
{
protected void Application_Start()
{
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Debug()
.WriteTo.LogInformant(
apiUrl: "https://app.loginformant.com",
apiKey: System.Configuration.ConfigurationManager.AppSettings["LogInformant:ApiKey"])
.CreateLogger();
// rest of your startup...
AreaRegistration.RegisterAllAreas();
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
}
protected void Application_End()
{
Log.CloseAndFlush(); // flush remaining logs before shutdown
}
}
Web.config — store your API key here:
<configuration>
<appSettings>
<add key="LogInformant:ApiKey" value="YOUR-API-KEY-HERE" />
</appSettings>
</configuration>
Configure via Web.config (Serilog.Settings.AppSettings)
Install the additional package:
Install-Package Serilog.Settings.AppSettings
Global.asax.cs — single line:
Log.Logger = new LoggerConfiguration()
.ReadFrom.AppSettings()
.CreateLogger();
Web.config:
<appSettings>
<add key="serilog:using:LogInformant" value="LogInformant.Serilog.DotNetFramework" />
<add key="serilog:write-to:LogInformant.apiUrl" value="https://app.loginformant.com" />
<add key="serilog:write-to:LogInformant.apiKey" value="YOUR-API-KEY-HERE" />
</appSettings>
Usage
Static logger (simplest)
using Serilog;
Log.Information("User {UserId} logged in", userId);
Log.Warning("Slow query detected: {QueryMs}ms", elapsed);
Log.Error(ex, "Payment failed for order {OrderId}", orderId);
ILogger via dependency injection
If your app uses a DI container (Unity, Autofac, etc.) you can wire up ILogger<T>:
// With Autofac
builder.Register(c => new SerilogLoggerFactory(Log.Logger))
.As<Microsoft.Extensions.Logging.ILoggerFactory>();
builder.RegisterGeneric(typeof(Logger<>))
.As(typeof(Microsoft.Extensions.Logging.ILogger<>));
Then inject normally:
public class PaymentService
{
private readonly ILogger<PaymentService> _logger;
public PaymentService(ILogger<PaymentService> logger) => _logger = logger;
}
Log Level Mapping
| Serilog | LogInformant |
|---|---|
| Verbose | Debug |
| Debug | Debug |
| Information | Information |
| Warning | Warning |
| Error | Error |
| Fatal | Fatal |
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET Framework | net48 is compatible. net481 was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETFramework 4.8
- Serilog (>= 4.3.0)
- Serilog.Sinks.PeriodicBatching (>= 5.0.0)
- System.Net.Http (>= 4.3.4)
- System.Text.Json (>= 9.0.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 146 | 2/21/2026 |