SyslogLogging 2.0.5

There is a newer version of this package available.
See the version list below for details.
dotnet add package SyslogLogging --version 2.0.5                
NuGet\Install-Package SyslogLogging -Version 2.0.5                
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.5" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SyslogLogging --version 2.0.5                
#r "nuget: SyslogLogging, 2.0.5"                
#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.5

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

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 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net6.0

    • No dependencies.
  • net7.0

    • No dependencies.
  • net8.0

    • No dependencies.

NuGet packages (11)

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.6 205 10/17/2024
2.0.5 243 9/10/2024
2.0.4 117 9/10/2024
2.0.3 100 9/10/2024
2.0.2 9,521 8/1/2023
2.0.1.8 9,041 10/6/2022
2.0.1.7 20,945 11/19/2021
2.0.1.6 1,308 11/12/2021
2.0.1.5 4,248 9/13/2021
2.0.1.4 25,131 5/20/2021
2.0.1.3 4,373 3/11/2021
2.0.1.2 1,108 3/11/2021
2.0.1.1 1,077 3/10/2021
2.0.1 1,098 3/10/2021
1.3.2.7 8,762 12/2/2020
1.3.2.6 2,705 11/23/2020
1.3.2.5 2,049 11/15/2020
1.3.2.4 1,382 11/6/2020
1.3.2.3 5,288 9/10/2020
1.3.2.2 23,223 6/10/2020
1.3.2.1 9,256 5/8/2020
1.3.2 73,725 12/3/2019
1.3.1 11,531 10/27/2019
1.3.0 1,227 10/7/2019
1.2.1 4,052 9/21/2019
1.2.0 2,186 8/10/2019
1.1.0 763,547 7/30/2019
1.0.12 1,244 7/6/2019
1.0.11 1,366 6/12/2019
1.0.10 5,197 3/10/2019
1.0.9 16,917 9/11/2017
1.0.8 6,262 12/12/2016

Strong naming