Wima.Log 1.8.2

dotnet add package Wima.Log --version 1.8.2
                    
NuGet\Install-Package Wima.Log -Version 1.8.2
                    
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="Wima.Log" Version="1.8.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Wima.Log" Version="1.8.2" />
                    
Directory.Packages.props
<PackageReference Include="Wima.Log" />
                    
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 Wima.Log --version 1.8.2
                    
#r "nuget: Wima.Log, 1.8.2"
                    
#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 Wima.Log@1.8.2
                    
#: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=Wima.Log&version=1.8.2
                    
Install as a Cake Addin
#tool nuget:?package=Wima.Log&version=1.8.2
                    
Install as a Cake Tool

Wima.Log

A lightweight, independent logger for .NET that provides multi-target logging with Common.Logging and Microsoft.Extensions.Logging compatibility, plus built-in ElasticSearch connectivity.

一款轻量级独立 .NET 日志库,兼容 Common.Logging 和 Microsoft.Extensions.Logging,内置 ElasticSearch 连接支持。

Features / 功能特性

  • Multi-target: net10.0 + netstandard2.0
  • Dual interface: Implements both Common.Logging.ILog and Microsoft.Extensions.Logging.ILogger
  • Log modes: Console, Native file, ElasticSearch, CommonLog bridge
  • Buffered ES indexing: Batch writes to ElasticSearch with configurable buffer
  • Log rotation: Auto-renew log files by hour with configurable retention
  • DI integration: builder.Services.AddWimaLogger() for ASP.NET / Generic Host
  • AOT compatible: Trim-safe, AOT-compatible on .NET 10

Installation / 安装

dotnet add package Wima.Log --version 1.8.2.0

Quick Start / 快速开始

using Wima.Log;

// Basic usage / 基本用法
var logger = new WimaLogger("MyApp", logMode: LogMode.Console | LogMode.Native);
logger.Info("Hello Wima.Log!");

// Log with exception / 带异常日志
try { /* ... */ }
catch (Exception ex) { logger.Error("Something failed", ex); }

Log Modes / 日志模式

LogMode.None          // No output / 无输出
LogMode.Console       // Console output / 控制台输出
LogMode.Native        // File output / 文件输出
LogMode.ElasticSearch // ES output / ES 输出
LogMode.CommonLog     // Bridge to Common.Logging / 桥接到 Common.Logging
LogMode.Verbose       // Verbose output / 详细输出
LogMode.StackTrace    // Stack trace on error / 错误时输出堆栈

// Combine modes / 组合模式
LogMode.Console | LogMode.Native | LogMode.ElasticSearch

DI Integration / 依赖注入

// ASP.NET Core / Generic Host
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddWimaLogger();

// With configuration / 带配置
builder.Services.AddWimaLogger(cfg =>
{
    cfg.LogLevel = Common.Logging.LogLevel.Info;
    cfg.LogMode = LogMode.Console | LogMode.Native;
});

ElasticSearch / ES 输出

// Initialize ES service / 初始化 ES 服务
WimaLogger.InitESService("http://localhost:9200", "my-index-prefix");

// Logs will auto-index to ES when ElasticSearch mode is enabled
// 启用 ElasticSearch 模式后日志将自动索引到 ES

Log Levels / 日志级别

Common.Logging Microsoft.Extensions.Logging
Trace Trace
Debug Debug
Info Information
Warn Warning
Error Error
Fatal Critical

License / 许可证

MIT License

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 was computed.  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 is compatible.  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 (3)

Showing the top 3 NuGet packages that depend on Wima.Log:

Package Downloads
Wima.WinForm

Wima通用Winform可复用控件和窗体库

Wima.Opc

Wima通用Opc基础库,提供两个底层Opc框架:hOpc和LibUA的支持,和客户端抽象接口。

Wima.Web.Engine

Wima通用Web引擎库,支持Kestrel和超轻量级Nhttp(1.1+SSL)

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.8.2 129 8/31/2026
1.8.1.1 149 8/30/2026