NET Logging Library
Logging to MSMQ
Basic Tasks > Logging to MSMQ

The MSMQ target is used to log to an Microsoft Message Queue

It has these properties that can be configured:

 

//Example runtime configuration, can also use log.config, app.config, or web.config
Log.ResetConfiguration();  
MsmqTarget target = new MsmqTarget(); 

target.CreateNewQueue = true;
target.Queue = ".\\private$\\logger";
target.MessageLabel = "This is a message label";
target.Priority = System.Messaging.MessagePriority.Normal;    
Log.Config.Targets.Add(target);

Log.Debug("This is a test");