SyslogLogging 2.0.8

dotnet add package SyslogLogging --version 2.0.8                
NuGet\Install-Package SyslogLogging -Version 2.0.8                
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.8" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SyslogLogging --version 2.0.8                
#r "nuget: SyslogLogging, 2.0.8"                
#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.8

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

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.x

  • 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

Easiest Way Possible

Using the constructor with no parameters will cause the library to log to 127.0.0.1:514.

using SyslogLogging;
LoggingModule log = new LoggingModule();
log.Debug("Hello, world!");

Single Syslog Server

using SyslogLogging;

LoggingModule log = new LoggingModule("mysyslogserver", 514);
log.Debug("Hello, world!");

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.

Changing Console Message Color

Colors are disabled by default to ensure compatibility across different operating systems and environments.

If you wish to enable colors and change the colors used by the library, set Settings.EnableColors to true and 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 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. 
.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 is compatible. 
.NET Framework net461 was computed.  net462 is compatible.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETFramework 4.6.2

    • No dependencies.
  • .NETFramework 4.8

    • No dependencies.
  • .NETStandard 2.0

    • No dependencies.
  • .NETStandard 2.1

    • No dependencies.
  • net6.0

    • No dependencies.
  • net8.0

    • No dependencies.

NuGet packages (12)

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.8 77 1/7/2025
2.0.7 130 12/23/2024
2.0.6 458 10/17/2024
2.0.5 281 9/10/2024
2.0.4 133 9/10/2024
2.0.3 124 9/10/2024
2.0.2 10,292 8/1/2023
2.0.1.8 9,185 10/6/2022
2.0.1.7 21,089 11/19/2021
2.0.1.6 1,327 11/12/2021
2.0.1.5 4,262 9/13/2021
2.0.1.4 25,157 5/20/2021
2.0.1.3 4,404 3/11/2021
2.0.1.2 1,122 3/11/2021
2.0.1.1 1,094 3/10/2021
2.0.1 1,111 3/10/2021
1.3.2.7 8,787 12/2/2020
1.3.2.6 2,726 11/23/2020
1.3.2.5 2,063 11/15/2020
1.3.2.4 1,395 11/6/2020
1.3.2.3 5,302 9/10/2020
1.3.2.2 23,239 6/10/2020
1.3.2.1 9,270 5/8/2020
1.3.2 73,743 12/3/2019
1.3.1 11,544 10/27/2019
1.3.0 1,240 10/7/2019
1.2.1 4,166 9/21/2019
1.2.0 2,202 8/10/2019
1.1.0 763,783 7/30/2019
1.0.12 1,257 7/6/2019
1.0.11 1,379 6/12/2019
1.0.10 5,212 3/10/2019
1.0.9 17,015 9/11/2017
1.0.8 6,281 12/12/2016

Retarget