LogFaast 1.4.0

Suggested Alternatives

Loggergine

Additional Details

LogFaast is deprecated, use Loggergine instead.

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

Developreh.LogFaast

The packgage contains RELEASE version of the dlls.

Blazing fast and simple application logger with:

  • tens of thousands processed log entries per seccond
  • minimal configuration,
  • no instantiation needed,
  • logs important informations to ease debugging,
  • no dependencies,
  • thread safe, log from multiple threads independently,
  • log files split after approximately 24000 log entries in the log file (depends of the log queue load),
  • zipping closed log files to save disk space,
  • works on Windows and Linux as well (Mac is not tested).

Supported log levels:

  • Debug (dbg)
  • Info (inf)
  • Warining (war)
  • Error (err)
  • Fatal (fatal)
  • Exception (exc)

How to:

  • LoggerConfig.xml, this configuration file needs to be placed in the directory of the executable.

  • The only configuration there is, it is to provide directory for log files in LoggerConfig.xml file, with LogPath xml element.

  • LoggerConfig.xml content:

    • On Windows:
    <?xml version="1.0" encoding="utf-8" ?>
    <LogConfig>
          <LogPath value="c:\ProgramData\OrganizationName\_Logfiles" type="string" />
    </LogConfig>
    
    • On Linux:
    <?xml version="1.0" encoding="utf-8" ?>
    <LogConfig>
          <LogPath value="/tmp/OrganizationName/_Logfiles" type="string" />
    </LogConfig>
    
  • The last folder in the directory structure for log files is created by the logger itself.

    • It is the assembly name of the programm which utilizes this blazing fast logger.
  • New log files are created when there is at least 1GB (1024 * 1024 * 1024 bytes) free space on the hard drive.

    • When there is less then 1GB of space, new log files will not be created and logs will be lost.
  • And remember, the logger needs to have permission to write to the configured folder to log.

    • When there is an error creating configured directory structure, or other when initializing the logger (missong configuration file LoggerConfig.xml for instance), then the logger will throw an according exception.
  • When there is an error within the logger itself, this error is sent to Console.Error output as well as into the txt file AssemblyName-ProcessId-InternalLoggerError.txt -> AwesomeSw-8795-InternalLoggerError.txt placed into the currently logged in user home directory, for instance:

    • On Windows:
    c:\Users\LoggedInUser\AwesomeSw-8795-InternalLoggerError.txt
    
    • On Linux:
    /home/loggedinuser/AwesomeSw-8795-InternalLoggerError.txt
    

Log Interfaces to Use:

Log.Exc(Exception e, string? message = null)
Log.Exc(Exception e, string format, params object[] logMsgs)
Log.Fatal(string? message, Exception? e = null)
Log.Fatal(string format, params object[] logMsgs)
Log.Err(string? message, Exception? e = null)
Log.Err(string format, params object[] logMsgs)
Log.War(string? message, Exception? e = null)
Log.War(string format, params object[] logMsgs)
Log.Inf(string? message)
Log.Inf(string format, params object[] logMsgs)
Log.Dbg(string? message)
Log.Dbg(string format, params object[] logMsgs)
  • For instance:
public static void Main(string[] args)
{
    Log.Err($"An unpleasant error has occured. p1: {param1}, p2: {param2}");
    Log.Err("An unpleasant error has occured. p1: {0}, p2: {1}", param1, param2);
}

Log File Content:

Content of the log file is as follows:

time in format yyyy.MM.dd HH:mm:ss.fff, File Name  , line number,   Method Name , Thread Id, Thread Name, log level,And a message which was logged.

2024.02.01 18:01:46.343,                FileName.cs,          22,   MethodName(),         3,  ThreadName,       war,Logged message.

IMPORTANT note when logging the JSON strings with Log method that contains params parameter:

  • When using Log methods with params parameter (eg. Log.Dbg(string format, params object[] logMsgs)) and one of the parameter is JSON string, than the method needs to be structured as follows, otherwise FormatException will be thrown:

    Log.Dbg("Message: {0}", json);

    • When the log message already contains JSON string, the only way how to write such a message with embeded JSON is this way: Log.Dbg("{0}", logMessageWithJson);
    • Other ways to write JSON strings with methods utilizing params interface result in the FormatException, like:
      • string interpolation: Log.Dbg($"{json}");
      • string concatenation: Log.Dbg("Received JSON: " + json); , or Log.Dbg(json); , or even Log.Dbg(logMessageWithJson);
Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  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 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.  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. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen 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.
  • .NETStandard 2.1

    • No dependencies.
  • net5.0

    • No dependencies.
  • net6.0

    • No dependencies.
  • net8.0

    • No dependencies.

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.4.0 212 7/12/2024 1.4.0 is deprecated because it is no longer maintained.
Loading failed

1) Added support for netstandard2.1.