Sctt.Common 1.4.3-alpha

This is a prerelease version of Sctt.Common.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Sctt.Common --version 1.4.3-alpha                
NuGet\Install-Package Sctt.Common -Version 1.4.3-alpha                
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="Sctt.Common" Version="1.4.3-alpha" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Sctt.Common --version 1.4.3-alpha                
#r "nuget: Sctt.Common, 1.4.3-alpha"                
#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.
// Install Sctt.Common as a Cake Addin
#addin nuget:?package=Sctt.Common&version=1.4.3-alpha&prerelease

// Install Sctt.Common as a Cake Tool
#tool nuget:?package=Sctt.Common&version=1.4.3-alpha&prerelease                

版本记录

v1.4.3-alpha

  • 增加了 Sctt.Common.Logging 日志Attribute

使用方式

  • // 日志注册 program.cs 中添加
  • builder.Services.AddLoggingSetup(builder.Configuration);

跳过日志监视

方法上加 [SuppressMonitor] 特性

appsetting.json 在Logging内添加
完整Logging配置
"Logging": {
    "LogLevel": {
      "Default": "Information",
      "Microsoft.AspNetCore": "Warning"
    },
    "Console": {
      "FormatterName": "simple",
      "FormatterOptions": {
        "IncludeScopes": false,
        "TimestampFormat": "yyyy-MM-dd HH:mm:ss.fff ",
        "UseUtcTimestamp": true
      }
    },


    "File": {
      "Enabled": false, // 启用文件日志
      "FileName": "logs/{0:yyyyMMdd}_{1}.log", // 日志文件
      "Append": true, // 追加覆盖
      // "MinimumLevel": "Information", // 日志级别
      "FileSizeLimitBytes": 10485760, // 10M=10*1024*1024
      "MaxRollingFiles": 30 // 只保留30个文件
    },
    "Database": {
      "Enabled": false, // 启用数据库日志
      "MinimumLevel": "Information"
    },
    "ElasticSearch": {
      "Enabled": false, // 启用ES日志
      "DefaultLogIndex": "sctt-log"
    },

    "Monitor": {
      "GlobalEnabled": true, // 启用全局拦截日志
      "IncludeOfMethods": [], // 拦截特定方法,当GlobalEnabled=false有效
      "ExcludeOfMethods": [], // 排除特定方法,当GlobalEnabled=true有效
      "BahLogLevel": "Information", // Oops.Oh 和 Oops.Bah 业务日志输出级别
      "WithReturnValue": true, // 是否包含返回值,默认true
      "ReturnValueThreshold": 500, // 返回值字符串阈值,默认0全量输出
      "JsonBehavior": "None", // 是否输出Json,默认None(OnlyJson、All)
      "JsonIndented": false, // 是否格式化Json
      "UseUtcTimestamp": false, // 时间格式UTC、LOCAL
      "ConsoleLog": true // 是否显示控制台日志
    }

}
Product Compatible and additional computed target framework versions.
.NET 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. 
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.5.6-alpha 42 11/15/2024
1.5.5-alpha 64 11/4/2024
1.5.4-alpha 111 10/28/2024
1.5.3-alpha 38 10/28/2024
1.5.2-alpha 40 10/28/2024
1.5.1-alpha 52 10/25/2024
1.5.0-alpha 54 10/25/2024
1.4.8-alpha 55 10/24/2024
1.4.7-alpha 43 10/22/2024
1.4.4-alpha 163 9/9/2024
1.4.3-alpha 62 9/6/2024
1.4.2-alpha 131 8/29/2024
1.4.1-alpha 76 8/29/2024
1.4.0-alpha 93 7/29/2024
1.3.9-alpha 70 7/29/2024
1.3.8-alpha 112 7/29/2024
1.3.7-alpha 200 7/18/2024
1.3.6-alpha 114 7/17/2024
1.3.5-alpha 106 7/12/2024
1.3.4-alpha 104 7/5/2024
1.3.3-alpha 151 7/4/2024
1.3.2-alpha 116 6/21/2024
1.3.1-alpha 100 6/20/2024
1.3.0-alpha 170 5/27/2024
1.2.10-alpha 115 5/23/2024
1.2.9-alpha 118 5/14/2024
1.2.8-alpha 156 5/6/2024
1.2.7-alpha 105 4/25/2024
1.2.6-alpha 101 4/23/2024
1.2.5-alpha 155 4/2/2024
1.2.4-alpha 155 3/19/2024
1.2.3-alpha 97 3/8/2024
1.2.2-alpha 147 1/4/2024
1.2.1-alpha 123 12/28/2023
1.2.0-alpha 121 12/15/2023
1.1.9-alpha 111 12/15/2023
1.1.8-alpha 108 12/14/2023
1.1.7-alpha 78 12/13/2023
1.1.6-alpha 137 11/24/2023
1.1.5-alpha 95 11/22/2023
1.1.4-alpha 95 11/22/2023
1.1.3-alpha 118 10/18/2023
1.1.2-alpha 108 10/16/2023
1.1.1-alpha 117 10/9/2023
1.1.0-alpha 118 9/25/2023
1.0.9-alpha 104 9/19/2023
1.0.8-alpha 101 9/18/2023
1.0.7-alpha 110 9/14/2023
1.0.6-alpha 110 9/14/2023
1.0.5-alpha 112 9/9/2023
1.0.4-alpha 104 9/9/2023
1.0.3-alpha 110 9/9/2023
1.0.2-alpha 168 8/3/2023
1.0.1 195 8/3/2023