LogFaast 1.4.0
LogFaast is deprecated, use Loggergine instead.
dotnet add package LogFaast --version 1.4.0
NuGet\Install-Package LogFaast -Version 1.4.0
<PackageReference Include="LogFaast" Version="1.4.0" />
<PackageVersion Include="LogFaast" Version="1.4.0" />
<PackageReference Include="LogFaast" />
paket add LogFaast --version 1.4.0
#r "nuget: LogFaast, 1.4.0"
#:package LogFaast@1.4.0
#addin nuget:?package=LogFaast&version=1.4.0
#tool nuget:?package=LogFaast&version=1.4.0
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.xmlfile, withLogPathxml element.LoggerConfig.xmlcontent:- 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.txtplaced 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);, orLog.Dbg(json);, or evenLog.Dbg(logMessageWithJson);
- string interpolation:
- When the log message already contains JSON string, the only way how to write such a message with embeded JSON is this way:
| Product | Versions 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. |
-
.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.
1) Added support for netstandard2.1.