ZayniFramework.Logging
2.3.2
See the version list below for details.
dotnet add package ZayniFramework.Logging --version 2.3.2
NuGet\Install-Package ZayniFramework.Logging -Version 2.3.2
<PackageReference Include="ZayniFramework.Logging" Version="2.3.2" />
paket add ZayniFramework.Logging --version 2.3.2
#r "nuget: ZayniFramework.Logging, 2.3.2"
// Install ZayniFramework.Logging as a Cake Addin #addin nuget:?package=ZayniFramework.Logging&version=2.3.2 // Install ZayniFramework.Logging as a Cake Tool #tool nuget:?package=ZayniFramework.Logging&version=2.3.2
Logging module example.
Add LoggingSettings section in your app.config or web.config file.
<LoggingSettings eventLogEnable="false" logEnable="true">
<DefaultTextLogger>
<add name="_DefaultLog" enable="true" maxSize="8" consoleOutput="true">
<LogFile path="D:\Logs\Zayni\Logging.TestLog.log"/>
</add>
<add name="TextLogWithoutEmail" enable="true" maxSize="5">
<LogFile path="D:\Logs\Zayni\Zayni.UnitTest.log"/>
</add>
<add name="TextLogWithEmail" enable="true" maxSize="5" consoleOutput="true" emailNotifyLoggerName="EMailSmtpNotify1" dbLoggerName="ZayniLogging" dbLoggerType="MySQL">
<LogFile path="D:\Logs\Zayni\Zayni.UnitTest.log"/>
</add>
</DefaultTextLogger>
<EmailNotifyLogger>
<add name="EMailSmtpNotify1" smtpPort="587" smtpHost="smtp.gmail.com" enableSsl="true" smtpDomain="" smtpAccount="test@gmail.com" smtpPassword="XXX" fromEmailAddress="system@gmail.com" fromDisplayName="Some Title" toEmailAddress="test@gmail.com"/>
<add name="EMailSmtpNotify2" smtpPort="25" smtpHost="XXX.XXX.XXX.XXX" enableSsl="false" smtpDomain="" smtpAccount="tester" smtpPassword="Admin123" fromEmailAddress="system@gmail.com" fromDisplayName="Email Logger Test" toEmailAddress="test@gmail.com"/>
</EmailNotifyLogger>
</LoggingSettings>
Then, you can use the Logging module.
using ZayniFramework.Logging;
static void Main( string[] args )
{
// Register the error log event handler.
// When an error log event is fired, your error log event handler will be trigger.
Logger.Instance.WriteErrorLogEvent += ( sender, message, title ) =>
{
Console.WriteLine( $"Ho Ho Ho, this is a error event fired..." );
Console.WriteLine( $"Error Title: {title}" );
Console.WriteLine( $"Error Message: {message}" );
};
// ===========
// Use Logger to write a log.
Logger.WriteInformationLog( nameof ( Program ), "Start console.", Logger.GetTraceLogTitle( nameof ( Program ), nameof ( Main ) ), "TextLogWithEmail" );
Logger.WriteErrorLog( nameof ( Program ), "Something error!!", "MyTest" );
Logger.WriteInformationLog( nameof ( Program ), "End console.", Logger.GetTraceLogTitle( nameof ( Program ), nameof ( Main ) ), "TextLogWithEmail" );
// Use ConsoleLogger to output a log to console.
ConsoleLogger.Log( "This is a console log message", ConsoleColor.DarkGreen );
ConsoleLogger.LogError( "This is a console log error message" );
// Write a log to windows event log.
EventLogger.WriteLog( "ZayniFramework", "Testing", EventLogEntryType.Information, true );
Console.ReadLine();
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. 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. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. 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.0
- MySql.Data (>= 8.0.15)
- System.Data.SqlClient (>= 4.6.0)
- System.Diagnostics.EventLog (>= 4.5.0)
- ZayniFramework.Common (>= 2.3.2)
NuGet packages (18)
Showing the top 5 NuGet packages that depend on ZayniFramework.Logging:
Package | Downloads |
---|---|
ZayniFramework.Validation
The Validation module provide many kinds of validation attributes and Validator for .NET applications. GitLab Repository: https://gitlab.com/ponylin1985/zayniframework |
|
ZayniFramework.Middle.Service.Entity
The Middle.ServiceHost.Entity define the entities and DTOs for Middle.ServiceHost and Middle.ServiceHost.Client module. GitLab Repository: https://gitlab.com/ponylin1985/zayniframework |
|
ZayniFramework.DataAccess
This is a lightweight ORM framework like Dapper but also provider DbCommand SQL log. Support Microsoft SQL Server, MySQL, PostgreSQL and Oracle database. Also support dynamic ORM. GitLab Repository: https://gitlab.com/ponylin1985/zayniframework |
|
ZayniFramework.Middle.Service
The Middle.Service module provide a self-hosted .NET middleware framework to separate the communication protocol detail with your business logic code. You can use it to build the backend microservices easier. Support TCPSocket, WebSocket and RabbitMQ protocol. You can also implement the IRemoteHost interface and register it into the Middle.Service module as an extension module for this middleware framework. Have a nice day... :) GitLab Repository: https://gitlab.com/ponylin1985/zayniframework |
|
ZayniFramework.Middle.Service.Client
The Middle.Service.Client is the client SDK for Middle.Service module. You can use it to connect, send RPC request or publish message to the server side's service host very easy. Support TCPSocket, WebSocket and RabbitMQ protocol. GitLab Repository: https://gitlab.com/ponylin1985/zayniframework |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
8.0.142 | 367 | 3/19/2024 |
8.0.141 | 641 | 1/4/2024 |
8.0.140 | 766 | 12/17/2023 |
6.0.138 | 496 | 3/19/2024 |
6.0.137 | 1,297 | 9/20/2023 |
6.0.136 | 1,214 | 9/14/2023 |
6.0.135 | 1,291 | 9/10/2023 |
6.0.134 | 1,508 | 7/12/2023 |
6.0.133 | 1,502 | 7/10/2023 |
6.0.132 | 1,495 | 7/7/2023 |
6.0.131 | 1,532 | 6/19/2023 |
6.0.130 | 1,545 | 6/19/2023 |
6.0.129 | 13,934 | 7/2/2022 |
6.0.128 | 3,868 | 1/16/2022 |
6.0.127 | 3,848 | 1/15/2022 |
6.0.126 | 3,750 | 1/15/2022 |
6.0.125 | 2,435 | 1/8/2022 |
6.0.125-hotfix1 | 1,418 | 1/8/2022 |
6.0.124 | 2,445 | 1/7/2022 |
6.0.123 | 2,836 | 11/14/2021 |
5.0.129 | 5,153 | 7/2/2022 |
5.0.128 | 5,242 | 1/16/2022 |
5.0.125 | 2,986 | 1/8/2022 |
5.0.124 | 2,913 | 1/7/2022 |
5.0.123 | 3,499 | 11/14/2021 |
5.0.122 | 3,859 | 10/11/2021 |
5.0.121 | 3,974 | 5/1/2021 |
3.1.137 | 1,960 | 9/20/2023 |
3.1.136 | 1,781 | 9/14/2023 |
3.1.135 | 1,984 | 9/10/2023 |
3.1.134 | 2,360 | 7/12/2023 |
3.1.133 | 2,340 | 7/11/2023 |
3.1.132 | 2,281 | 7/8/2023 |
3.1.131 | 2,438 | 6/19/2023 |
3.1.130 | 4,201 | 2/1/2023 |
3.1.129 | 7,509 | 7/2/2022 |
3.1.128 | 7,407 | 1/16/2022 |
3.1.125 | 4,149 | 1/8/2022 |
3.1.124 | 4,130 | 1/7/2022 |
3.1.123 | 5,006 | 11/14/2021 |
3.1.122 | 5,760 | 10/11/2021 |
3.1.121 | 5,892 | 5/1/2021 |
2.31.120 | 3,940 | 3/14/2021 |
2.30.115 | 7,494 | 3/6/2021 |
2.30.114 | 3,821 | 3/6/2021 |
2.20.101 | 4,357 | 3/1/2021 |
2.19.3 | 3,946 | 2/11/2021 |
2.19.2 | 16,526 | 2/6/2021 |
2.19.1 | 4,419 | 1/6/2021 |
2.19.0 | 4,466 | 1/1/2021 |
2.18.3 | 7,289 | 12/27/2020 |
2.18.2 | 8,361 | 8/29/2020 |
2.18.1 | 11,516 | 8/26/2020 |
2.18.0 | 7,659 | 8/20/2020 |
2.17.135 | 7,528 | 8/19/2020 |
2.17.134 | 9,299 | 7/28/2020 |
2.17.133 | 7,508 | 7/27/2020 |
2.17.132 | 7,554 | 7/18/2020 |
2.17.131 | 7,657 | 7/11/2020 |
2.16.130 | 7,391 | 6/13/2020 |
2.15.128 | 7,529 | 6/3/2020 |
2.15.127 | 7,585 | 5/31/2020 |
2.15.126 | 8,681 | 4/30/2020 |
2.14.122 | 7,236 | 4/13/2020 |
2.13.100 | 7,417 | 3/12/2020 |
2.12.51 | 7,294 | 2/18/2020 |
2.11.50 | 14,353 | 2/10/2020 |
2.10.44 | 16,095 | 1/30/2020 |
2.9.43 | 15,709 | 1/11/2020 |
2.8.42 | 15,991 | 1/10/2020 |
2.8.41 | 15,810 | 1/5/2020 |
2.7.40 | 15,736 | 1/2/2020 |
2.7.39 | 15,755 | 1/2/2020 |
2.7.38 | 16,351 | 1/1/2020 |
2.6.37 | 16,023 | 12/23/2019 |
2.6.35 | 15,957 | 12/4/2019 |
2.6.1 | 15,842 | 12/2/2019 |
2.6.0 | 15,781 | 11/28/2019 |
2.5.2 | 16,470 | 11/26/2019 |
2.5.1 | 15,804 | 11/12/2019 |
2.5.0 | 15,626 | 11/9/2019 |
2.4.3 | 14,081 | 10/16/2019 |
2.4.2 | 13,060 | 10/16/2019 |
2.4.1 | 13,308 | 9/20/2019 |
2.3.113 | 3,773 | 3/6/2021 |
2.3.112 | 3,866 | 3/6/2021 |
2.3.28 | 13,590 | 9/19/2019 |
2.3.27 | 13,575 | 8/30/2019 |
2.3.26 | 13,895 | 8/20/2019 |
2.3.25 | 13,339 | 8/12/2019 |
2.3.22 | 13,913 | 7/31/2019 |
2.3.21 | 14,037 | 7/20/2019 |
2.3.20 | 12,989 | 6/22/2019 |
2.3.19 | 13,643 | 6/14/2019 |
2.3.18 | 14,148 | 6/13/2019 |
2.3.17 | 13,581 | 6/13/2019 |
2.3.15 | 13,428 | 6/8/2019 |
2.3.14 | 13,452 | 6/8/2019 |
2.3.13 | 13,876 | 5/30/2019 |
2.3.12 | 7,448 | 5/24/2019 |
2.3.11 | 7,345 | 5/24/2019 |
2.3.10 | 7,589 | 5/21/2019 |
2.3.9 | 7,385 | 5/9/2019 |
2.3.8 | 7,668 | 5/8/2019 |
2.3.7 | 7,678 | 4/30/2019 |
2.3.6 | 7,671 | 4/23/2019 |
2.3.5 | 7,661 | 4/19/2019 |
2.3.4 | 7,334 | 4/18/2019 |
2.3.3 | 7,259 | 4/17/2019 |
2.3.2 | 7,426 | 4/6/2019 |
2.3.1 | 7,507 | 12/15/2018 |
2.3.0 | 7,304 | 12/7/2018 |
2.2.7 | 4,502 | 11/26/2018 |
2.2.6 | 7,844 | 11/25/2018 |
2.2.1 | 17,788 | 11/17/2018 |
2.2.0 | 6,227 | 11/16/2018 |
2.1.0 | 6,393 | 11/15/2018 |
2.0.1 | 5,088 | 11/6/2018 |
2.0.0 | 5,334 | 11/4/2018 |