BlueGroup.TraceClsLib 2.0.0

BlueGroup.TraceClsLib

BlueGroup.TraceClsLib is an open-source library for centralized logging using MSMQ. It is valid both for .NET Framework (from version 3.5) and .NET.

For .NET Framework, it exploits the System.Messaging package, while for .NET it exploits the equivalent Msmq.NetCore.Messaging package (System.Messaging is deprecated for .NET).

From version 1.1 also file logging is supported.

How To Use

Just add the package to your project via NuGet Package Manager.

To log a message, you have to create a TraceMsg object, containing all the needed information:

  • Application: the name of the application that is logging the message;
  • Date: the date (day, month and year, in the format of a string) when the message is logged;
  • Time: the time (hour, minutes, seconds and eventually milliseconds, in the format of a string) when the message is logged;
  • Method: the name of the method that is logging the message;
  • Message: the message that has to be logged;
  • Computer: the name of the machine that is logging the message (usually Environment.MachineName);
  • User: the user that is logging the message (usually Environment.UserName);
  • TraceType: the severity level of the message. You can choose between four levels: DEBUG, INFO, WARNING and ERROR;
  • TraceCategory: the type of application that is logging the message (e.g. WebService, WindowsService, etc...).

Once the TraceMsg object is created, it can be sent to the messaging queue using a ClsTrace object. This object has two different constructors, one for Queue logging, another for File logging. If the queue logging is chosen, the ClsTrace object internally searches if the desired messaging queue already exists, and creates it if it doesn't. Then, using the SendMessage method, it enqueues all the desired log messages. If no queue name is given to the constructor of the ClsTrace object, the default queue will be named .\Private$\BlueGroupLogService . If the file logging is chosen, the ClsTrace object internally searches if the desired logging folder already exists, and creates it if it doesn't. Then, using the WriteMessage method, it writes the desired log messages to the file. If no folder name is given to the constructor of the ClsTrace object, the default folder will be C:\BlueGroup\Log\. When file logging is chosen, maximum file size and retention policies can be customized.

No packages depend on BlueGroup.TraceClsLib.

.NET Framework 3.5

  • No dependencies.

.NET Standard 2.1

Version Downloads Last updated
2.0.0 1 05/22/2026
1.3.0 0 05/22/2026