예제 #1
0
 /// <summary>
 /// Add a message queue
 /// </summary>
 /// <param name="instance">Log manager instance</param>
 /// <param name="appName">Application name (to be able to identify this app at the receiver end)</param>
 /// <param name="queueName">Queue which is used for the transportation.</param>
 public static void AddMessageQueue(this SimpleLogManager instance, string appName, string queueName)
 {
     if (instance == null)
     {
         throw new ArgumentNullException("instance");
     }
     if (appName == null)
     {
         throw new ArgumentNullException("appName");
     }
     if (queueName == null)
     {
         throw new ArgumentNullException("queueName");
     }
     SimpleLogManager.Instance.AddTarget(new MqTarget(appName, null, queueName));
 }
예제 #2
0
 /// <summary>
 /// Create a singleton instance if it hasn't been created.
 /// </summary>
 private static void CreateIfNeeded()
 {
     if (_instance == null)
     {
         _instance = new SimpleLogManager();
         LogManager.Assign(_instance);
     }
 }