SyslogLogging 2.0.2

dotnet add package SyslogLogging --version 2.0.2
NuGet\Install-Package SyslogLogging -Version 2.0.2
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="SyslogLogging" Version="2.0.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SyslogLogging --version 2.0.2
#r "nuget: SyslogLogging, 2.0.2"
#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 SyslogLogging as a Cake Addin
#addin nuget:?package=SyslogLogging&version=2.0.2

// Install SyslogLogging as a Cake Tool
#tool nuget:?package=SyslogLogging&version=2.0.2

SyslogLogging

NuGet Version NuGet

Simple C# class library for logging to syslog, console, and file, targeted to .NET Core, .NET Standard, and .NET Framework. For a sample app please refer to the included test project.

SyslogLogging is targeted to .NET Core, .NET Standard, and .NET Framework.

Help or Feedback

First things first - do you need help or have feedback? File an issue here! We'd love to hear from you.

New in v2.0.1

  • Breaking changes including new constructors and minor API changes
  • Support for multiple syslog servers
  • Simplified class definitions

It's Really Easy... I Mean, REALLY Easy

By default, 127.0.0.1:514 is automatically included in the list of servers.

Single Syslog Server

using SyslogLogging;

LoggingModule log = new LoggingModule(); // 127.0.0.1:514 is automatically included
log.Debug("This is a debug message!");

Multiple Syslog Servers and Console

using SyslogLogging;

List<SyslogServer> servers = new List<SyslogServer>
{
  new SyslogServer("logginghost.com", 2000),
  new SyslogServer("myhost.com", 514)
};

LoggingModule log = new LoggingModule(servers, true); // true to enable console
log.Warn("Look out!");

Logging to File

using SyslogLogging;

LoggingModule log = new LoggingModule("mylogfile.txt");
log.Info("Here's some new information!");

Logging EVERYWHERE

using SyslogLogging;

List<SyslogServer> servers = new List<SyslogServer>
{
  new SyslogServer("127.0.0.1", 514)
};

LoggingModule log = new LoggingModule(servers, true); // true to enable console
log.Settings.FileLogging = FileLoggingMode.SingleLogFile;
log.Settings.LogFilename = "mylogfile.txt";
log.Alert("We're going everywhere!");

When using FileLoggingMode.FileWithDate, LoggingModule with append .yyyyMMdd to the supplied filename in LogFilename. When using FileLoggingMode.SingleLogFile, the filename is left untouched.

Supported Environments

Tested and works well in Windows in .NET Framework 4.5.2 or later or .NET Core. Tested and works well in Linux and OSX environments, too. Should work well in Mono environments. You may want to use the Mono Ahead-of-time compiler (AOT).

This package has also been tested with PaperTrail. Realistically, any cloud syslog server should work.

Changing Console Message Color

If you wish to change the colors used by the library, modify the Settings.Colors property. A variable of type ColorScheme exists for each severity level. To disable colors, set Settings.EnableColors to false.

log.Settings.EnableColors = true;
log.Settings.Colors.Debug = new ColorScheme(ConsoleColor.DarkGray, ConsoleColor.Black);

Special Thanks

We'd like to extend a special thank you to those that have helped make this library better, including:

@dev-jan @jisotalo

Version History

Please refer to CHANGELOG.md.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  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 is compatible.  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 netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
.NET Framework net451 is compatible.  net452 was computed.  net46 was computed.  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 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.
  • .NETFramework 4.5.1

    • No dependencies.
  • .NETStandard 2.1

    • No dependencies.
  • net6.0

    • No dependencies.
  • net7.0

    • No dependencies.

NuGet packages (10)

Showing the top 5 NuGet packages that depend on SyslogLogging:

Package Downloads
Omnicx.WebStore.Core

OmniCX WebStore Core contains the Controllers, API SDK and Models required to run the MVC Views of the WebStore.

BigQ.dll

BigQ is a messaging platform using TCP sockets and websockets featuring sync, async, channel, and private communications.

ContainerFS

Self-contained single-user file system written in C#.

Less3

<3 Less3 is S3-compatible object storage that you can run on your laptop, server, or anywhere you like.

RestDb

RestDb is a platform that enables a RESTful API interface in front of Microsoft SQL Server, MySQL, PostgreSQL, and Sqlite databases.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.0.2 6,099 8/1/2023
2.0.1.8 8,646 10/6/2022
2.0.1.7 20,135 11/19/2021
2.0.1.6 1,242 11/12/2021
2.0.1.5 4,184 9/13/2021
2.0.1.4 25,018 5/20/2021
2.0.1.3 4,297 3/11/2021
2.0.1.2 1,080 3/11/2021
2.0.1.1 1,030 3/10/2021
2.0.1 1,066 3/10/2021
1.3.2.7 8,664 12/2/2020
1.3.2.6 2,603 11/23/2020
1.3.2.5 1,957 11/15/2020
1.3.2.4 1,353 11/6/2020
1.3.2.3 5,141 9/10/2020
1.3.2.2 22,789 6/10/2020
1.3.2.1 9,228 5/8/2020
1.3.2 73,647 12/3/2019
1.3.1 11,503 10/27/2019
1.3.0 1,198 10/7/2019
1.2.1 3,657 9/21/2019
1.2.0 2,065 8/10/2019
1.1.0 753,528 7/30/2019
1.0.12 1,217 7/6/2019
1.0.11 1,335 6/12/2019
1.0.10 4,894 3/10/2019
1.0.9 16,485 9/11/2017
1.0.8 6,101 12/12/2016

Strong naming