Util.Filter.LogSerilog 1.1.0

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

Esta lib irá permitir a geração de dois tipos de arquivos txt de log, um com os logs de todos os níveis mínimos e outro apenas com os logs de níveis: Erro, Warning e Fatal. Permitindo mais facilidade ao identificar problemas na aplicação por meio de logs, utilizando Serilog.

OBS.: Nesta configuração foi adicionada uma restrição para ocultar informações de IP caso seja fornecida no log, afim de exemplificar a exclusão de alguma string específica, como nesse caso foi definido que caso na string do log contenha "IP" será excluída por completo (apenas nos logs filtrados).

Para conseguir utilizar precisa seguir os seguintes passos:

    *Baixar o pacote nuget: NuGet\Install-Package Util.Filter.LogSerilog -Version 1.0.0
    
    *Adicionar a referência da lib baixada na classe de startup da aplicação;
    
    *Adicionar no AppSettings da api a configuração do Serilog que irá permitir ou não a geração dos logs completos da aplicação
    e também que irá permitir mudar o caminho do arquivo por meio do AppSettings.
            "Serilog": {
              "Enabled": true,
              "FilePath": "../logs/"
            }
    *Adicionar na classe de startup da aplicação a nova configuração do Serilog:
            builder.Services.AddSerilog(ConfigurationSerilog.ConfigureSerilog(builder.Configuration));
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  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.1.0 236 7/11/2023
1.0.0 235 7/9/2023 1.0.0 is deprecated because it is no longer maintained.

Modificado forma de salvar os logs em um caminho dinâmico podendo ser escolhido por meio do AppSettings