Probas.log4net.LogService 1.0.0

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

Probas.log4net.LogService

介绍

log4net 基于阿里云日志服务组件

软件架构

软件架构说明

安装Nuget包
dotnet add package Probas.log4net.LogService
使用说明(配置)
  1. Program.cs 进行如下配置
        public static void Main(string[] args)
        {
            CreateHostBuilder(args).Build().Run();
        }

        public static IHostBuilder CreateHostBuilder(string[] args) =>
            Host.CreateDefaultBuilder(args)
                .ConfigureLogging((context, builder) =>
                {
                    // 添加 Log4Net 日志扩展
                    builder.AddLog4Net();
                })
                .ConfigureWebHostDefaults(webBuilder =>
                {
                    webBuilder.UseStartup<Startup>();
                });
  1. 添加配置文件 log4net.config
<?xml version="1.0" encoding="utf-8" ?>
<log4net>
  <appender name="AliSlsApiAppender" type="Probas.log4net.LogService.AliSlsApiAppender, Probas.log4net.LogService">
    <Settings>
      <endpoint value="*.log.aliyuncs.com" />
      <topic value="*" />
      <accesskey value="*" />
      <secretkey value="*" />
      <project value="*" />
      <logstore value="*" />
    </Settings>
    <layout type="Probas.log4net.LogService.LogServiceLayout, Probas.log4net.LogService" >
      <appkey value="CoreAppSamlpeTests" />
    </layout>
  </appender>
  <appender name="AliSlsKafkaAppender" type="Probas.log4net.LogService.AliSlsKafkaAppender, Probas.log4net.LogService">
    <Settings>
      <endpoint value="*.*.log.aliyuncs.com:10012" />
      <accesskey value="*" />
      <secretkey value="*" />
      <project value="*" />
      <logstore value="*" />
    </Settings>
    <layout type="Probas.log4net.LogService.LogServiceLayout, Probas.log4net.LogService" >
      <appkey value="CoreAppSamlpeTests" />
    </layout>
  </appender>
  <root>
    <level value="ALL"/>
    
    <appender-ref ref="AliSlsApiAppender" />
    
    <appender-ref ref="AliSlsKafkaAppender" />
  </root>
</log4net>

  1. 使用,参考Sample
       // 自动注入直接使用
       private readonly ILogger<WeatherForecastController> _logger;

       public WeatherForecastController(ILogger<WeatherForecastController> logger)
       {
           _logger = logger;
       }
Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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 493 4/25/2021
1.0.0-alpha 290 3/30/2021
0.0.1-alpha 280 3/30/2021

log4net 基于阿里云日志服务组件