< Summary

Class:Azure.Messaging.ServiceBus.Diagnostics.ServiceBusEventSource
Assembly:Azure.Messaging.ServiceBus
File(s):C:\Git\azure-sdk-for-net\sdk\servicebus\Azure.Messaging.ServiceBus\src\Diagnostics\ServiceBusEventSource.cs
Covered lines:30
Uncovered lines:334
Coverable lines:364
Total lines:1409
Line coverage:8.2% (30 of 364)
Covered branches:13
Total branches:258
Branch coverage:5% (13 of 258)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
get_Log()-100%100%
.ctor(...)-100%100%
.ctor()-100%100%
SendMessageStart(...)-66.67%50%
SendMessageComplete(...)-66.67%50%
SendMessageException(...)-0%0%
CreateMessageBatchStart(...)-0%0%
CreateMessageBatchComplete(...)-0%0%
CreateMessageBatchException(...)-0%0%
ReceiveMessageStart(...)-66.67%50%
ReceiveMessageComplete(...)-66.67%50%
ReceiveMessageException(...)-0%0%
ReceiveDeferredMessageStartCore(...)-0%100%
ReceiveDeferredMessageStart(...)-0%0%
ReceiveDeferredMessageComplete(...)-0%0%
ReceiveDeferredMessageException(...)-0%0%
PeekMessageStart(...)-0%0%
PeekMessageComplete(...)-0%0%
PeekMessageException(...)-0%0%
ScheduleMessagesStart(...)-0%0%
ScheduleMessagesComplete(...)-0%0%
ScheduleMessagesException(...)-0%0%
CancelScheduledMessagesStart(...)-0%0%
CancelScheduledMessagesStartCore(...)-0%0%
CancelScheduledMessagesComplete(...)-0%0%
CancelScheduledMessagesException(...)-0%0%
CompleteMessageStart(...)-0%0%
CompleteMessageComplete(...)-0%0%
CompleteMessageException(...)-0%0%
DeferMessageStart(...)-0%0%
DeferMessageComplete(...)-0%0%
DeferMessageException(...)-0%100%
AbandonMessageStart(...)-0%0%
AbandonMessageComplete(...)-0%0%
AbandonMessageException(...)-0%0%
DeadLetterMessageStart(...)-0%0%
DeadLetterMessageComplete(...)-0%0%
DeadLetterMessageException(...)-0%0%
RenewMessageLockStart(...)-0%0%
RenewMessageLockComplete(...)-0%0%
RenewMessageLockException(...)-0%0%
RenewSessionLockStart(...)-0%0%
RenewSessionLockComplete(...)-0%0%
RenewSessionLockException(...)-0%0%
GetSessionStateStart(...)-0%0%
GetSessionStateComplete(...)-0%0%
GetSessionStateException(...)-0%0%
SetSessionStateStart(...)-0%0%
SetSessionStateComplete(...)-0%0%
SetSessionStateException(...)-0%0%
StartProcessingStart(...)-66.67%50%
StartProcessingComplete(...)-0%0%
StartProcessingException(...)-66.67%50%
StopProcessingStart(...)-0%0%
StopProcessingComplete(...)-0%0%
StopProcessingException(...)-0%0%
ProcessorRenewMessageLockStart(...)-0%0%
ProcessorRenewMessageLockComplete(...)-0%0%
ProcessorRenewMessageLockException(...)-0%0%
ProcessorRenewSessionLockStart(...)-0%0%
ProcessorRenewSessionLockComplete(...)-0%0%
ProcessorRenewSessionLockException(...)-0%0%
ProcessorErrorHandlerThrewException(...)-0%0%
AddRuleStart(...)-0%0%
AddRuleComplete(...)-0%0%
AddRuleException(...)-0%0%
RemoveRuleStart(...)-0%0%
RemoveRuleComplete(...)-0%0%
RemoveRuleException(...)-0%0%
GetRuleStart(...)-0%0%
GetRuleComplete(...)-0%0%
GetRuleException(...)-0%0%
LinkStateLost(...)-0%0%
ReceiveLinkClosed(...)-0%0%
ReceiveLinkClosedCore(...)-0%0%
AmqpLinkAuthorizationRefreshStart(...)-0%0%
AmqpLinkAuthorizationRefreshComplete(...)-0%0%
AmqpLinkAuthorizationRefreshError(...)-0%0%
CreateSendLinkStart(...)-0%0%
CreateSendLinkComplete(...)-0%0%
CreateSendLinkException(...)-0%0%
SendLinkClosed(...)-0%0%
SendLinkClosedCore(...)-0%0%
CreateReceiveLinkStart(...)-66.67%50%
CreateReceiveLinkComplete(...)-0%0%
CreateReceiveLinkException(...)-66.67%50%
CreateManagementLinkStart(...)-0%0%
CreateManagementLinkComplete(...)-0%0%
CreateManagementLinkException(...)-0%0%
ManagementLinkClosed(...)-0%0%
ManagementLinkClosedCore(...)-0%0%
RunOperationExceptionEncountered(...)-66.67%50%
ClientCreateStart(...)-66.67%25%
ClientCreateStartCore(...)-0%0%
ClientCreateComplete(...)-66.67%25%
ClientCreateCompleteCore(...)-0%0%
ClientCreateException(...)-0%0%
ClientCreateExceptionCore(...)-0%0%
ClientDisposeStart(...)-66.67%25%
ClientDisposeStartCore(...)-0%0%
ClientDisposeComplete(...)-66.67%25%
ClientDisposeCompleteCore(...)-0%0%
ClientDisposeException(...)-0%0%
ClientDisposeExceptionCore(...)-0%0%
TransactionInitializeException(...)-0%0%
TransactionDeclared(...)-0%0%
TransactionDeclared(...)-0%100%
TransactionDischarged(...)-0%0%
TransactionDischarged(...)-0%100%
TransactionDischargeException(...)-0%0%
TransactionDischargeException(...)-0%100%
CreateControllerException(...)-0%0%
PluginCallStarted(...)-0%0%
PluginCallCompleted(...)-0%0%
PluginCallException(...)-0%0%
ScheduleTaskFailed(...)-0%0%
ScheduleTaskFailed(...)-0%100%
ManagementSerializationException(...)-0%0%
MaxMessagesExceedsPrefetch(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\servicebus\Azure.Messaging.ServiceBus\src\Diagnostics\ServiceBusEventSource.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4using System;
 5using System.Collections.Generic;
 6using System.Diagnostics.Tracing;
 7using System.Reflection;
 8using System.Threading.Tasks;
 9using Azure.Core.Diagnostics;
 10using Azure.Messaging.ServiceBus.Amqp;
 11using Azure.Messaging.ServiceBus.Primitives;
 12using Microsoft.Azure.Amqp;
 13
 14namespace Azure.Messaging.ServiceBus.Diagnostics
 15{
 16    /// <summary>
 17    ///   Serves as an ETW event source for logging of information about
 18    ///   Entitys client.
 19    /// </summary>
 20    ///
 21    /// <remarks>
 22    ///   When defining Start/Stop tasks, it is highly recommended that the
 23    ///   the StopEvent.Id must be exactly StartEvent.Id + 1.
 24    /// </remarks>
 25    [EventSource(Name = EventSourceName)]
 26    internal class ServiceBusEventSource : EventSource
 27    {
 28        /// <summary>The name to use for the event source.</summary>
 29        private const string EventSourceName = "Azure-Messaging-ServiceBus";
 30
 31        /// <summary>
 32        ///   Provides a singleton instance of the event source for callers to
 33        ///   use for logging.
 34        /// </summary>
 40435        public static ServiceBusEventSource Log { get; } = new ServiceBusEventSource(EventSourceName);
 36
 37        /// <summary>
 38        ///   Prevents an instance of the <see cref="ServiceBusEventSource"/> class from being
 39        ///   created outside the scope of the <see cref="Log" /> instance, as well as setting up the
 40        ///   integration with AzureEventSourceListenter.
 41        /// </summary>
 242        private ServiceBusEventSource(string eventSourceName) : base(eventSourceName, EventSourceSettings.Default, Azure
 43        {
 244        }
 45
 46        // parameterless constructor for mocking
 14847        internal ServiceBusEventSource() { }
 48
 49        #region event constants
 50        // event constants should not be changed
 51        internal const int SendMessageStartEvent = 1;
 52        internal const int SendMessageCompleteEvent = 2;
 53        internal const int SendMessageExceptionEvent = 3;
 54
 55        internal const int CreateMessageBatchStartEvent = 4;
 56        internal const int CreateMessageBatchCompleteEvent = 5;
 57        internal const int CreateMessageBatchExceptionEvent = 6;
 58
 59        internal const int ReceiveMessageStartEvent = 7;
 60        internal const int ReceiveMessageCompleteEvent = 8;
 61        internal const int ReceiveMessageExceptionEvent = 9;
 62
 63        internal const int ScheduleMessageStartEvent = 10;
 64        internal const int ScheduleMessageCompleteEvent = 11;
 65        internal const int ScheduleMessageExceptionEvent = 12;
 66
 67        internal const int CancelScheduledMessageStartEvent = 13;
 68        internal const int CancelScheduledMessageCompleteEvent = 14;
 69        internal const int CancelScheduledMessageExceptionEvent = 15;
 70
 71        internal const int CompleteMessageStartEvent = 16;
 72        internal const int CompleteMessageCompleteEvent = 17;
 73        internal const int CompleteMessageExceptionEvent = 18;
 74
 75        internal const int DeferMessageStartEvent = 19;
 76        internal const int DeferMessageCompleteEvent = 20;
 77        internal const int DeferMessageExceptionEvent = 21;
 78
 79        internal const int AbandonMessageStartEvent = 22;
 80        internal const int AbandonMessageCompleteEvent = 23;
 81        internal const int AbandonMessageExceptionEvent = 24;
 82
 83        internal const int DeadLetterMessageStartEvent = 25;
 84        internal const int DeadLetterMessageCompleteEvent = 26;
 85        internal const int DeadLetterMessageExceptionEvent = 27;
 86
 87        internal const int PeekMessageStartEvent = 28;
 88        internal const int PeekMessageCompleteEvent = 29;
 89        internal const int PeekMessageExceptionEvent = 30;
 90
 91        internal const int RenewMessageLockStartEvent = 31;
 92        internal const int RenewMessageLockCompleteEvent = 32;
 93        internal const int RenewMessageLockExceptionEvent = 33;
 94
 95        internal const int ReceiveDeferredMessageStartEvent = 34;
 96        internal const int ReceiveDeferredMessageCompleteEvent = 35;
 97        internal const int ReceiveDeferredMessageExceptionEvent = 36;
 98
 99        internal const int LinkStateLostEvent = 37;
 100        internal const int ReceiveLinkClosedEvent = 38;
 101        internal const int AmqpLinkRefreshStartEvent = 39;
 102        internal const int AmqpLinkRefreshCompleteEvent = 40;
 103        internal const int AmqpLinkRefreshExceptionEvent = 41;
 104
 105        internal const int ManagementSerializedExceptionEvent = 42;
 106        internal const int RunOperationExceptionEvent = 43;
 107
 108        internal const int ClientDisposeStartEvent = 44;
 109        internal const int ClientDisposeCompleteEvent = 45;
 110        internal const int ClientDisposeExceptionEvent = 46;
 111
 112        internal const int RenewSessionLockStartEvent = 47;
 113        internal const int RenewSessionLockCompleteEvent = 48;
 114        internal const int RenewSessionLockExceptionEvent = 49;
 115
 116        internal const int StartProcessingStartEvent = 50;
 117        internal const int StartProcessingCompleteEvent = 51;
 118        internal const int StartProcessingExceptionEvent = 52;
 119
 120        internal const int StopProcessingStartEvent = 53;
 121        internal const int StopProcessingCompleteEvent = 54;
 122        internal const int StopProcessingExceptionEvent = 55;
 123
 124        internal const int ProcessorRenewMessageLockStartEvent = 56;
 125        internal const int ProcessorRenewMessageLockCompleteEvent = 57;
 126        internal const int ProcessorRenewMessageLockExceptionEvent = 58;
 127
 128        internal const int ProcessorRenewSessionLockStartEvent = 59;
 129        internal const int ProcessorRenewSessionLockCompleteEvent = 60;
 130        internal const int ProcessorRenewSessionLockExceptionEvent = 61;
 131
 132        internal const int GetSessionStateStartEvent = 62;
 133        internal const int GetSessionStateCompleteEvent = 63;
 134        internal const int GetSessionStateExceptionEvent = 64;
 135
 136        internal const int SetSessionStateStartEvent = 65;
 137        internal const int SetSessionStateCompleteEvent = 66;
 138        internal const int SetSessionStateExceptionEvent = 67;
 139
 140        internal const int AddRuleStartEvent = 68;
 141        internal const int AddRuleCompleteEvent = 69;
 142        internal const int AddRuleExceptionEvent = 70;
 143
 144        internal const int RemoveRuleStartEvent = 71;
 145        internal const int RemoveRuleCompleteEvent = 72;
 146        internal const int RemoveRuleExceptionEvent = 73;
 147
 148        internal const int GetRuleStartEvent = 74;
 149        internal const int GetRuleCompleteEvent = 75;
 150        internal const int GetRuleExceptionEvent = 76;
 151
 152        internal const int ClientCreateStartEvent = 77;
 153        internal const int ClientCreateCompleteEvent = 78;
 154        internal const int ClientCreateExceptionEvent = 79;
 155
 156        internal const int CreateSendLinkStartEvent = 80;
 157        internal const int CreateSendLinkCompleteEvent = 81;
 158        internal const int CreateSendLinkExceptionEvent = 82;
 159
 160        internal const int CreateReceiveLinkStartEvent = 83;
 161        internal const int CreateReceiveLinkCompleteEvent = 84;
 162        internal const int CreateReceiveLinkExceptionEvent = 85;
 163
 164        internal const int CreateManagementLinkStartEvent = 86;
 165        internal const int CreateManagementLinkCompleteEvent = 87;
 166        internal const int CreateManagementLinkExceptionEvent = 88;
 167
 168        internal const int TransactionInitializationExceptionEvent = 89;
 169        internal const int TransactionDeclaredEvent = 90;
 170        internal const int TransactionDischargedEvent = 91;
 171        internal const int TransactionDischargedExceptionEvent = 92;
 172        internal const int CreateControllerExceptionEvent = 93;
 173
 174        internal const int ProcessorErrorHandlerThrewExceptionEvent = 94;
 175        internal const int ScheduleTaskFailedEvent = 95;
 176
 177        internal const int PluginStartEvent = 96;
 178        internal const int PluginCompleteEvent = 97;
 179        internal const int PluginExceptionEvent = 98;
 180
 181        internal const int MaxMessagesExceedsPrefetchEvent = 99;
 182        internal const int SendLinkClosedEvent = 100;
 183        internal const int ManagementLinkClosedEvent = 101;
 184
 185        #endregion
 186        // add new event numbers here incrementing from previous
 187
 188        #region Sending
 189        [Event(SendMessageStartEvent, Level = EventLevel.Informational, Message = "{0}: SendAsync start. MessageCount = 
 190        public virtual void SendMessageStart(string identifier, int messageCount)
 191        {
 2192            if (IsEnabled())
 193            {
 0194                WriteEvent(SendMessageStartEvent, identifier, messageCount);
 195            }
 2196        }
 197
 198        [Event(SendMessageCompleteEvent, Level = EventLevel.Informational, Message = "{0}: SendAsync done.")]
 199        public virtual void SendMessageComplete(string identifier)
 200        {
 2201            if (IsEnabled())
 202            {
 0203                WriteEvent(SendMessageCompleteEvent, identifier);
 204            }
 2205        }
 206
 207        [Event(SendMessageExceptionEvent, Level = EventLevel.Error, Message = "{0}: SendAsync Exception: {1}.")]
 208        public virtual void SendMessageException(string identifier, string exception)
 209        {
 0210            if (IsEnabled())
 211            {
 0212                WriteEvent(SendMessageExceptionEvent, identifier, exception);
 213            }
 0214        }
 215
 216        [Event(CreateMessageBatchStartEvent, Level = EventLevel.Informational, Message = "{0}: CreateBatchAsync start.")
 217        public virtual void CreateMessageBatchStart(string identifier)
 218        {
 0219            if (IsEnabled())
 220            {
 0221                WriteEvent(CreateMessageBatchStartEvent, identifier);
 222            }
 0223        }
 224
 225        [Event(CreateMessageBatchCompleteEvent, Level = EventLevel.Informational, Message = "{0}: CreateBatchAsync done.
 226        public virtual void CreateMessageBatchComplete(string identifier)
 227        {
 0228            if (IsEnabled())
 229            {
 0230                WriteEvent(CreateMessageBatchCompleteEvent, identifier);
 231            }
 0232        }
 233
 234        [Event(CreateMessageBatchExceptionEvent, Level = EventLevel.Error, Message = "{0}: CreateBatchAsync Exception: {
 235        public virtual void CreateMessageBatchException(string identifier, string exception)
 236        {
 0237            if (IsEnabled())
 238            {
 0239                WriteEvent(CreateMessageBatchExceptionEvent, identifier, exception);
 240            }
 0241        }
 242        #endregion
 243
 244        #region Receiving
 245
 246        [Event(ReceiveMessageStartEvent, Level = EventLevel.Informational, Message = "{0}: ReceiveBatchAsync start. Mess
 247        public virtual void ReceiveMessageStart(string identifier, int messageCount)
 248        {
 4249            if (IsEnabled())
 250            {
 0251                WriteEvent(ReceiveMessageStartEvent, identifier, messageCount);
 252            }
 4253        }
 254
 255        [Event(ReceiveMessageCompleteEvent, Level = EventLevel.Informational, Message = "{0}: ReceiveBatchAsync done. Re
 256        public virtual void ReceiveMessageComplete(
 257            string identifier,
 258            int messageCount)
 259        {
 4260            if (IsEnabled())
 261            {
 0262                WriteEvent(ReceiveMessageCompleteEvent, identifier, messageCount);
 263            }
 4264        }
 265
 266        [Event(ReceiveMessageExceptionEvent, Level = EventLevel.Error, Message = "{0}: ReceiveBatchAsync Exception: {1}.
 267        public virtual void ReceiveMessageException(
 268            string clientId,
 269            string exception)
 270        {
 0271            if (IsEnabled())
 272            {
 0273                WriteEvent(ReceiveMessageExceptionEvent, clientId, exception);
 274            }
 0275        }
 276
 277        [Event(ReceiveDeferredMessageStartEvent, Level = EventLevel.Informational, Message = "{0}: ReceiveDeferredMessag
 278        public void ReceiveDeferredMessageStartCore(string identifier, int messageCount, string sequenceNumbers)
 279        {
 0280            WriteEvent(ReceiveDeferredMessageStartEvent, identifier, messageCount, sequenceNumbers);
 0281        }
 282
 283        [NonEvent]
 284        public virtual void ReceiveDeferredMessageStart(string identifier, IList<long> sequenceNumbers)
 285        {
 0286            if (IsEnabled())
 287            {
 0288                var formattedSequenceNumbers = StringUtility.GetFormattedSequenceNumbers(sequenceNumbers);
 0289                ReceiveDeferredMessageStartCore(identifier, sequenceNumbers.Count, formattedSequenceNumbers);
 290            }
 0291        }
 292
 293        [Event(ReceiveDeferredMessageCompleteEvent, Level = EventLevel.Informational, Message = "{0}: ReceiveDeferredMes
 294        public virtual void ReceiveDeferredMessageComplete(string identifier, int messageCount)
 295        {
 0296            if (IsEnabled())
 297            {
 0298                WriteEvent(ReceiveDeferredMessageCompleteEvent, identifier, messageCount);
 299            }
 0300        }
 301
 302        [Event(ReceiveDeferredMessageExceptionEvent, Level = EventLevel.Error, Message = "{0}: ReceiveDeferredMessageAsy
 303        public virtual void ReceiveDeferredMessageException(string identifier, string exception)
 304        {
 0305            if (IsEnabled())
 306            {
 0307                WriteEvent(ReceiveDeferredMessageExceptionEvent, identifier, exception);
 308            }
 0309        }
 310        #endregion
 311
 312        #region Peeking
 313        [Event(PeekMessageStartEvent, Level = EventLevel.Informational, Message = "{0}: MessagePeekAsync start. Sequence
 314        public virtual void PeekMessageStart(string identifier, long? sequenceNumber, int messageCount)
 315        {
 0316            if (IsEnabled())
 317            {
 0318                WriteEvent(PeekMessageStartEvent, identifier, sequenceNumber, messageCount);
 319            }
 0320        }
 321
 322        [Event(PeekMessageCompleteEvent, Level = EventLevel.Informational, Message = "{0}: MessagePeekAsync done. Peeked
 323        public virtual void PeekMessageComplete(string identifier, int messageCount)
 324        {
 0325            if (IsEnabled())
 326            {
 0327                WriteEvent(PeekMessageCompleteEvent, identifier, messageCount);
 328            }
 0329        }
 330
 331        [Event(PeekMessageExceptionEvent, Level = EventLevel.Error, Message = "{0}: MessagePeekAsync Exception: {1}.")]
 332        public virtual void PeekMessageException(string identifier, string exception)
 333        {
 0334            if (IsEnabled())
 335            {
 0336                WriteEvent(PeekMessageExceptionEvent, identifier, exception);
 337            }
 0338        }
 339        #endregion
 340
 341        #region Scheduling
 342        [Event(ScheduleMessageStartEvent, Level = EventLevel.Informational, Message = "{0}: ScheduleMessageAsync start. 
 343        public virtual void ScheduleMessagesStart(string identifier, int messageCount, string scheduledEnqueueTime)
 344        {
 0345            if (IsEnabled())
 346            {
 0347                WriteEvent(ScheduleMessageStartEvent, identifier, messageCount, scheduledEnqueueTime);
 348            }
 0349        }
 350
 351        [Event(ScheduleMessageCompleteEvent, Level = EventLevel.Informational, Message = "{0}: ScheduleMessageAsync done
 352        public virtual void ScheduleMessagesComplete(string identifier)
 353        {
 0354            if (IsEnabled())
 355            {
 0356                WriteEvent(ScheduleMessageCompleteEvent, identifier);
 357            }
 0358        }
 359
 360        [Event(ScheduleMessageExceptionEvent, Level = EventLevel.Error, Message = "{0}: ScheduleMessageAsync Exception: 
 361        public virtual void ScheduleMessagesException(string identifier, string exception)
 362        {
 0363            if (IsEnabled())
 364            {
 0365                WriteEvent(ScheduleMessageExceptionEvent, identifier, exception);
 366            }
 0367        }
 368
 369        [NonEvent]
 370        public virtual void CancelScheduledMessagesStart(string identifier, long[] sequenceNumbers)
 371        {
 0372            if (IsEnabled())
 373            {
 0374                var formattedSequenceNumbers = StringUtility.GetFormattedSequenceNumbers(sequenceNumbers);
 0375                CancelScheduledMessagesStartCore(identifier, sequenceNumbers.Length, formattedSequenceNumbers);
 376            }
 0377        }
 378
 379        [Event(CancelScheduledMessageStartEvent, Level = EventLevel.Informational, Message = "{0}: CancelScheduledMessag
 380        public virtual void CancelScheduledMessagesStartCore(string identifier, int messageCount, string sequenceNumbers
 381        {
 0382            if (IsEnabled())
 383            {
 0384                WriteEvent(CancelScheduledMessageStartEvent, identifier, messageCount, sequenceNumbers);
 385            }
 0386        }
 387
 388        [Event(CancelScheduledMessageCompleteEvent, Level = EventLevel.Informational, Message = "{0}: CancelScheduledMes
 389        public virtual void CancelScheduledMessagesComplete(string identifier)
 390        {
 0391            if (IsEnabled())
 392            {
 0393                WriteEvent(CancelScheduledMessageCompleteEvent, identifier);
 394            }
 0395        }
 396
 397        [Event(CancelScheduledMessageExceptionEvent, Level = EventLevel.Error, Message = "{0}: CancelScheduledMessageAsy
 398        public virtual void CancelScheduledMessagesException(string identifier, string exception)
 399        {
 0400            if (IsEnabled())
 401            {
 0402                WriteEvent(CancelScheduledMessageExceptionEvent, identifier, exception);
 403            }
 0404        }
 405        #endregion
 406
 407        #region Settlement
 408        [Event(CompleteMessageStartEvent, Level = EventLevel.Informational, Message = "{0}: CompleteAsync start. Message
 409        public virtual void CompleteMessageStart(string identifier, int messageCount, string lockTokens)
 410        {
 0411            if (IsEnabled())
 412            {
 0413                WriteEvent(CompleteMessageStartEvent, identifier, messageCount, lockTokens);
 414            }
 0415        }
 416
 417        [Event(CompleteMessageCompleteEvent, Level = EventLevel.Informational, Message = "{0}: CompleteAsync done.")]
 418        public virtual void CompleteMessageComplete(string identifier)
 419        {
 0420            if (IsEnabled())
 421            {
 0422                WriteEvent(CompleteMessageCompleteEvent, identifier);
 423            }
 0424        }
 425
 426        [Event(CompleteMessageExceptionEvent, Level = EventLevel.Error, Message = "{0}: CompleteAsync Exception: {1}.")]
 427        public virtual void CompleteMessageException(string identifier, string exception)
 428        {
 0429            if (IsEnabled())
 430            {
 0431                WriteEvent(CompleteMessageExceptionEvent, identifier, exception);
 432            }
 0433        }
 434
 435        [Event(DeferMessageStartEvent, Level = EventLevel.Informational, Message = "{0}: DeferAsync start. MessageCount 
 436        public virtual void DeferMessageStart(string identifier, int messageCount, string lockToken)
 437        {
 0438            if (IsEnabled())
 439            {
 0440                WriteEvent(DeferMessageStartEvent, identifier, messageCount, lockToken);
 441            }
 0442        }
 443
 444        [Event(DeferMessageCompleteEvent, Level = EventLevel.Informational, Message = "{0}: DeferAsync done.")]
 445        public virtual void DeferMessageComplete(string identifier)
 446        {
 0447            if (IsEnabled())
 448            {
 0449                WriteEvent(DeferMessageCompleteEvent, identifier);
 450            }
 0451        }
 452
 453        [Event(DeferMessageExceptionEvent, Level = EventLevel.Error, Message = "{0}: DeferAsync Exception: {1}.")]
 454        public virtual void DeferMessageException(string identifier, string exception)
 455        {
 0456            WriteEvent(DeferMessageExceptionEvent, identifier, exception);
 0457        }
 458
 459        [Event(AbandonMessageStartEvent, Level = EventLevel.Informational, Message = "{0}: AbandonAsync start. MessageCo
 460        public virtual void AbandonMessageStart(string identifier, int messageCount, string lockToken)
 461        {
 0462            if (IsEnabled())
 463            {
 0464                WriteEvent(AbandonMessageStartEvent, identifier, messageCount, lockToken);
 465            }
 0466        }
 467
 468        [Event(AbandonMessageCompleteEvent, Level = EventLevel.Informational, Message = "{0}: AbandonAsync done.")]
 469        public virtual void AbandonMessageComplete(string identifier)
 470        {
 0471            if (IsEnabled())
 472            {
 0473                WriteEvent(AbandonMessageCompleteEvent, identifier);
 474            }
 0475        }
 476
 477        [Event(AbandonMessageExceptionEvent, Level = EventLevel.Error, Message = "{0}: AbandonAsync Exception: {1}.")]
 478        public virtual void AbandonMessageException(string identifier, string exception)
 479        {
 0480            if (IsEnabled())
 481            {
 0482                WriteEvent(AbandonMessageExceptionEvent, identifier, exception);
 483            }
 0484        }
 485
 486        [Event(DeadLetterMessageStartEvent, Level = EventLevel.Informational, Message = "{0}: DeadLetterAsync start. Mes
 487        public virtual void DeadLetterMessageStart(string identifier, int messageCount, string lockToken)
 488        {
 0489            if (IsEnabled())
 490            {
 0491                WriteEvent(DeadLetterMessageStartEvent, identifier, messageCount, lockToken);
 492            }
 0493        }
 494
 495        [Event(DeadLetterMessageCompleteEvent, Level = EventLevel.Informational, Message = "{0}: DeadLetterAsync done.")
 496        public virtual void DeadLetterMessageComplete(string identifier)
 497        {
 0498            if (IsEnabled())
 499            {
 0500                WriteEvent(DeadLetterMessageCompleteEvent, identifier);
 501            }
 0502        }
 503
 504        [Event(DeadLetterMessageExceptionEvent, Level = EventLevel.Error, Message = "{0}: DeadLetterAsync Exception: {1}
 505        public virtual void DeadLetterMessageException(string identifier, string exception)
 506        {
 0507            if (IsEnabled())
 508            {
 0509                WriteEvent(DeadLetterMessageExceptionEvent, identifier, exception);
 510            }
 0511        }
 512        #endregion
 513
 514        #region Lock renewal
 515        [Event(RenewMessageLockStartEvent, Level = EventLevel.Informational, Message = "{0}: RenewLockAsync start. Messa
 516        public virtual void RenewMessageLockStart(string identifier, int messageCount, string lockToken)
 517        {
 0518            if (IsEnabled())
 519            {
 0520                WriteEvent(RenewMessageLockStartEvent, identifier, messageCount, lockToken);
 521            }
 0522        }
 523
 524        [Event(RenewMessageLockCompleteEvent, Level = EventLevel.Informational, Message = "{0}: RenewLockAsync done.")]
 525        public virtual void RenewMessageLockComplete(string identifier)
 526        {
 0527            if (IsEnabled())
 528            {
 0529                WriteEvent(RenewMessageLockCompleteEvent, identifier);
 530            }
 0531        }
 532
 533        [Event(RenewMessageLockExceptionEvent, Level = EventLevel.Error, Message = "{0}: RenewLockAsync Exception: {1}."
 534        public virtual void RenewMessageLockException(string identifier, string exception)
 535        {
 0536            if (IsEnabled())
 537            {
 0538                WriteEvent(RenewMessageLockExceptionEvent, identifier, exception);
 539            }
 0540        }
 541
 542        [Event(RenewSessionLockStartEvent, Level = EventLevel.Informational, Message = "{0}: RenewSessionLockAsync start
 543        public virtual void RenewSessionLockStart(string identifier, string sessionId)
 544        {
 0545            if (IsEnabled())
 546            {
 0547                WriteEvent(RenewSessionLockStartEvent, identifier, sessionId);
 548            }
 0549        }
 550
 551        [Event(RenewSessionLockCompleteEvent, Level = EventLevel.Informational, Message = "{0}: RenewSessionLockAsync do
 552        public virtual void RenewSessionLockComplete(string identifier)
 553        {
 0554            if (IsEnabled())
 555            {
 0556                WriteEvent(RenewSessionLockCompleteEvent, identifier);
 557            }
 0558        }
 559
 560        [Event(RenewSessionLockExceptionEvent, Level = EventLevel.Error, Message = "{0}: RenewSessionLockAsync Exception
 561        public virtual void RenewSessionLockException(string identifier, string exception)
 562        {
 0563            if (IsEnabled())
 564            {
 0565                WriteEvent(RenewSessionLockExceptionEvent, identifier, exception);
 566            }
 0567        }
 568        #endregion
 569
 570        #region Get/Set session state
 571
 572        [Event(GetSessionStateStartEvent, Level = EventLevel.Informational, Message = "{0}: Session GetStateAsync start.
 573        public virtual void GetSessionStateStart(string identifiers, string sessionId)
 574        {
 0575            if (IsEnabled())
 576            {
 0577                WriteEvent(GetSessionStateStartEvent, identifiers, sessionId);
 578            }
 0579        }
 580
 581        [Event(GetSessionStateCompleteEvent, Level = EventLevel.Informational, Message = "{0}: Session GetStateAsync don
 582        public virtual void GetSessionStateComplete(string identifier)
 583        {
 0584            if (IsEnabled())
 585            {
 0586                WriteEvent(GetSessionStateCompleteEvent, identifier);
 587            }
 0588        }
 589
 590        [Event(GetSessionStateExceptionEvent, Level = EventLevel.Error, Message = "{0}: Session GetStateAsync Exception:
 591        public virtual void GetSessionStateException(string identifier, string exception)
 592        {
 0593            if (IsEnabled())
 594            {
 0595                WriteEvent(GetSessionStateExceptionEvent, identifier, exception);
 596            }
 0597        }
 598
 599        [Event(SetSessionStateStartEvent, Level = EventLevel.Informational, Message = "{0}: Session SetStateAsync start.
 600        public virtual void SetSessionStateStart(string identifiers, string sessionId)
 601        {
 0602            if (IsEnabled())
 603            {
 0604                WriteEvent(SetSessionStateStartEvent, identifiers, sessionId);
 605            }
 0606        }
 607
 608        [Event(SetSessionStateCompleteEvent, Level = EventLevel.Informational, Message = "{0}: Session SetStateAsync don
 609        public virtual void SetSessionStateComplete(string identifier)
 610        {
 0611            if (IsEnabled())
 612            {
 0613                WriteEvent(SetSessionStateCompleteEvent, identifier);
 614            }
 0615        }
 616
 617        [Event(SetSessionStateExceptionEvent, Level = EventLevel.Error, Message = "{0}: Session SetStateAsync Exception:
 618        public virtual void SetSessionStateException(string identifier, string exception)
 619        {
 0620            if (IsEnabled())
 621            {
 0622                WriteEvent(SetSessionStateExceptionEvent, identifier, exception);
 623            }
 0624        }
 625        #endregion
 626
 627        #region Processor
 628
 629        [Event(StartProcessingStartEvent, Level = EventLevel.Informational, Message = "{0}: StartProcessingAsync start."
 630        public virtual void StartProcessingStart(string identifier)
 631        {
 8632            if (IsEnabled())
 633            {
 0634                WriteEvent(StartProcessingStartEvent, identifier);
 635            }
 8636        }
 637
 638        [Event(StartProcessingCompleteEvent, Level = EventLevel.Informational, Message = "{0}: StartProcessingAsync done
 639        public virtual void StartProcessingComplete(string identifier)
 640        {
 0641            if (IsEnabled())
 642            {
 0643                WriteEvent(StartProcessingCompleteEvent, identifier);
 644            }
 0645        }
 646
 647        [Event(StartProcessingExceptionEvent, Level = EventLevel.Error, Message = "{0}: StartProcessingAsync Exception: 
 648        public virtual void StartProcessingException(string identifier, string exception)
 649        {
 8650            if (IsEnabled())
 651            {
 0652                WriteEvent(StartProcessingExceptionEvent, identifier, exception);
 653            }
 8654        }
 655
 656        [Event(StopProcessingStartEvent, Level = EventLevel.Informational, Message = "{0}: StopProcessingAsync start.")]
 657        public virtual void StopProcessingStart(string identifier)
 658        {
 0659            if (IsEnabled())
 660            {
 0661                WriteEvent(StopProcessingStartEvent, identifier);
 662            }
 0663        }
 664
 665        [Event(StopProcessingCompleteEvent, Level = EventLevel.Informational, Message = "{0}: StopProcessingAsync done."
 666        public virtual void StopProcessingComplete(string identifier)
 667        {
 0668            if (IsEnabled())
 669            {
 0670                WriteEvent(StopProcessingCompleteEvent, identifier);
 671            }
 0672        }
 673
 674        [Event(StopProcessingExceptionEvent, Level = EventLevel.Error, Message = "{0}: StopProcessingAsync Exception: {1
 675        public virtual void StopProcessingException(string identifier, string exception)
 676        {
 0677            if (IsEnabled())
 678            {
 0679                WriteEvent(StopProcessingExceptionEvent, identifier, exception);
 680            }
 0681        }
 682
 683        [Event(ProcessorRenewMessageLockStartEvent, Level = EventLevel.Informational, Message = "{0}: Processor RenewMes
 684        public virtual void ProcessorRenewMessageLockStart(string identifier, int messageCount, string lockToken)
 685        {
 0686            if (IsEnabled())
 687            {
 0688                WriteEvent(ProcessorRenewMessageLockStartEvent, identifier, messageCount, lockToken);
 689            }
 0690        }
 691
 692        [Event(ProcessorRenewMessageLockCompleteEvent, Level = EventLevel.Informational, Message = "{0}: Processor Renew
 693        public virtual void ProcessorRenewMessageLockComplete(string identifier)
 694        {
 0695            if (IsEnabled())
 696            {
 0697                WriteEvent(ProcessorRenewMessageLockCompleteEvent, identifier);
 698            }
 0699        }
 700
 701        [Event(ProcessorRenewMessageLockExceptionEvent, Level = EventLevel.Error, Message = "{0}: Processor RenewMessage
 702        public virtual void ProcessorRenewMessageLockException(string identifier, string exception)
 703        {
 0704            if (IsEnabled())
 705            {
 0706                WriteEvent(ProcessorRenewMessageLockExceptionEvent, identifier, exception);
 707            }
 0708        }
 709
 710        [Event(ProcessorRenewSessionLockStartEvent, Level = EventLevel.Informational, Message = "{0}: Processor RenewSes
 711        public virtual void ProcessorRenewSessionLockStart(string identifier, string sessionId)
 712        {
 0713            if (IsEnabled())
 714            {
 0715                WriteEvent(ProcessorRenewSessionLockStartEvent, identifier, sessionId);
 716            }
 0717        }
 718
 719        [Event(ProcessorRenewSessionLockCompleteEvent, Level = EventLevel.Informational, Message = "{0}: Processor Renew
 720        public virtual void ProcessorRenewSessionLockComplete(string identifier)
 721        {
 0722            if (IsEnabled())
 723            {
 0724                WriteEvent(ProcessorRenewSessionLockCompleteEvent, identifier);
 725            }
 0726        }
 727
 728        [Event(ProcessorRenewSessionLockExceptionEvent, Level = EventLevel.Error, Message = "{0}: Processor RenewSession
 729        public virtual void ProcessorRenewSessionLockException(string identifier, string exception)
 730        {
 0731            if (IsEnabled())
 732            {
 0733                WriteEvent(ProcessorRenewSessionLockExceptionEvent, identifier, exception);
 734            }
 0735        }
 736
 737        [Event(ProcessorErrorHandlerThrewExceptionEvent, Level = EventLevel.Error, Message = "ExceptionReceivedHandler t
 738        public void ProcessorErrorHandlerThrewException(string exception)
 739        {
 0740            if (IsEnabled())
 741            {
 0742                WriteEvent(ProcessorErrorHandlerThrewExceptionEvent, exception);
 743            }
 0744        }
 745
 746        #endregion region
 747
 748        #region Rule management
 749        [Event(AddRuleStartEvent, Level = EventLevel.Informational, Message = "{0}: Add rule start. RuleName = {1}")]
 750        public virtual void AddRuleStart(string identifiers, string ruleName)
 751        {
 0752            if (IsEnabled())
 753            {
 0754                WriteEvent(AddRuleStartEvent, identifiers, ruleName);
 755            }
 0756        }
 757
 758        [Event(AddRuleCompleteEvent, Level = EventLevel.Informational, Message = "{0}: Add rule done.")]
 759        public virtual void AddRuleComplete(string identifier)
 760        {
 0761            if (IsEnabled())
 762            {
 0763                WriteEvent(AddRuleCompleteEvent, identifier);
 764            }
 0765        }
 766
 767        [Event(AddRuleExceptionEvent, Level = EventLevel.Error, Message = "{0}: Add rule Exception: {1}.")]
 768        public virtual void AddRuleException(string identifier, string exception)
 769        {
 0770            if (IsEnabled())
 771            {
 0772                WriteEvent(AddRuleExceptionEvent, identifier, exception);
 773            }
 0774        }
 775
 776        [Event(RemoveRuleStartEvent, Level = EventLevel.Informational, Message = "{0}: Remove rule start. RuleName = {1}
 777        public virtual void RemoveRuleStart(string identifiers, string ruleName)
 778        {
 0779            if (IsEnabled())
 780            {
 0781                WriteEvent(RemoveRuleStartEvent, identifiers, ruleName);
 782            }
 0783        }
 784
 785        [Event(RemoveRuleCompleteEvent, Level = EventLevel.Informational, Message = "{0}: Remove rule done.")]
 786        public virtual void RemoveRuleComplete(string identifier)
 787        {
 0788            if (IsEnabled())
 789            {
 0790                WriteEvent(RemoveRuleCompleteEvent, identifier);
 791            }
 0792        }
 793
 794        [Event(RemoveRuleExceptionEvent, Level = EventLevel.Error, Message = "{0}: Remove rule Exception: {1}.")]
 795        public virtual void RemoveRuleException(string identifier, string exception)
 796        {
 0797            if (IsEnabled())
 798            {
 0799                WriteEvent(RemoveRuleExceptionEvent, identifier, exception);
 800            }
 0801        }
 802
 803        [Event(GetRuleStartEvent, Level = EventLevel.Informational, Message = "{0}: Get rule start.")]
 804        public virtual void GetRuleStart(string identifiers)
 805        {
 0806            if (IsEnabled())
 807            {
 0808                WriteEvent(GetRuleStartEvent, identifiers);
 809            }
 0810        }
 811
 812        [Event(GetRuleCompleteEvent, Level = EventLevel.Informational, Message = "{0}: Get rule done.")]
 813        public virtual void GetRuleComplete(string identifier)
 814        {
 0815            if (IsEnabled())
 816            {
 0817                WriteEvent(GetRuleCompleteEvent, identifier);
 818            }
 0819        }
 820
 821        [Event(GetRuleExceptionEvent, Level = EventLevel.Error, Message = "{0}: Get rule Exception: {1}.")]
 822        public virtual void GetRuleException(string identifier, string exception)
 823        {
 0824            if (IsEnabled())
 825            {
 0826                WriteEvent(GetRuleExceptionEvent, identifier, exception);
 827            }
 0828        }
 829        #endregion
 830
 831        #region Link lifecycle
 832        [Event(LinkStateLostEvent, Level = EventLevel.Error, Message = "Link state lost. Throwing LockLostException for 
 833        public virtual void LinkStateLost(string identifier, string receiveLinkName, string receiveLinkState, bool isSes
 834        {
 0835            if (IsEnabled())
 836            {
 0837                WriteEvent(LinkStateLostEvent, identifier, receiveLinkName, receiveLinkState, isSessionReceiver, excepti
 838            }
 0839        }
 840
 841        [NonEvent]
 842        public virtual void ReceiveLinkClosed(
 843            string identifier,
 844            string sessionId,
 845            object receiver)
 846        {
 0847            if (IsEnabled())
 848            {
 0849                var link = (ReceivingAmqpLink)receiver;
 0850                if (link != null)
 851                {
 0852                    Exception exception = link.GetInnerException();
 0853                    ReceiveLinkClosedCore(
 0854                        identifier,
 0855                        sessionId,
 0856                        exception?.ToString());
 857                }
 858            }
 0859        }
 860
 861        [Event(ReceiveLinkClosedEvent, Level = EventLevel.Informational, Message = "Receive Link Closed. Identifier: {0}
 862        public virtual void ReceiveLinkClosedCore(string identifier, string sessionId, string linkException)
 863        {
 0864            if (IsEnabled())
 865            {
 0866                WriteEvent(ReceiveLinkClosedEvent, identifier, sessionId, linkException);
 867            }
 0868        }
 869
 870        /// <summary>
 871        ///   Indicates that refreshing authorization for an AMQP link has started.
 872        /// </summary>
 873        ///
 874        /// <param name="identifier">The name of the Entity that the link is associated with.</param>
 875        /// <param name="endpoint">The service endpoint that the link is bound to for communication.</param>
 876        ///
 877        [Event(AmqpLinkRefreshStartEvent, Level = EventLevel.Informational, Message = "Beginning refresh of AMQP link au
 878        public virtual void AmqpLinkAuthorizationRefreshStart(
 879            string identifier,
 880            string endpoint)
 881        {
 0882            if (IsEnabled())
 883            {
 0884                WriteEvent(AmqpLinkRefreshStartEvent, identifier ?? string.Empty, endpoint ?? string.Empty);
 885            }
 0886        }
 887
 888        /// <summary>
 889        ///   Indicates that refreshing authorization for an AMQP link has completed.
 890        /// </summary>
 891        ///
 892        /// <param name="identifier">The name of the Entity that the link is associated with.</param>
 893        /// <param name="endpoint">The service endpoint that the link is bound to for communication.</param>
 894        ///
 895        [Event(AmqpLinkRefreshCompleteEvent, Level = EventLevel.Informational, Message = "Completed refresh of AMQP link
 896        public virtual void AmqpLinkAuthorizationRefreshComplete(
 897            string identifier,
 898            string endpoint)
 899        {
 0900            if (IsEnabled())
 901            {
 0902                WriteEvent(AmqpLinkRefreshCompleteEvent, identifier ?? string.Empty, endpoint ?? string.Empty);
 903            }
 0904        }
 905
 906        /// <summary>
 907        ///   Indicates that an exception was encountered while refreshing authorization for an AMQP link has started.
 908        /// </summary>
 909        ///
 910        /// <param name="identifier">The name of the Entity that the link is associated with.</param>
 911        /// <param name="endpoint">The service endpoint that the link is bound to for communication.</param>
 912        /// <param name="errorMessage">The message for the exception that occurred.</param>
 913        ///
 914        [Event(AmqpLinkRefreshExceptionEvent, Level = EventLevel.Error, Message = "An exception occurred while refreshin
 915        public virtual void AmqpLinkAuthorizationRefreshError(
 916            string identifier,
 917            string endpoint,
 918            string errorMessage)
 919        {
 0920            if (IsEnabled())
 921            {
 0922                WriteEvent(AmqpLinkRefreshExceptionEvent, identifier ?? string.Empty, endpoint ?? string.Empty, errorMes
 923            }
 0924        }
 925
 926        [Event(CreateSendLinkStartEvent, Level = EventLevel.Informational, Message = "Creating send link for Identifier:
 927        public virtual void CreateSendLinkStart(
 928            string identifier)
 929        {
 0930            if (IsEnabled())
 931            {
 0932                WriteEvent(CreateSendLinkStartEvent, identifier);
 933            }
 0934        }
 935
 936        [Event(CreateSendLinkCompleteEvent, Level = EventLevel.Informational, Message = "Send link created for Identifie
 937        public virtual void CreateSendLinkComplete(
 938            string identifier)
 939        {
 0940            if (IsEnabled())
 941            {
 0942                WriteEvent(CreateSendLinkCompleteEvent, identifier);
 943            }
 0944        }
 945
 946        [Event(CreateSendLinkExceptionEvent, Level = EventLevel.Error, Message = "An exception occurred while creating s
 947        public virtual void CreateSendLinkException(
 948            string identifier,
 949            string exception)
 950        {
 0951            if (IsEnabled())
 952            {
 0953                WriteEvent(CreateSendLinkExceptionEvent, identifier, exception);
 954            }
 0955        }
 956
 957        [NonEvent]
 958        public virtual void SendLinkClosed(
 959            string identifier,
 960            object sender)
 961        {
 0962            if (IsEnabled())
 963            {
 0964                var link = (SendingAmqpLink)sender;
 0965                if (link != null)
 966                {
 0967                    Exception exception = link.GetInnerException();
 0968                    SendLinkClosedCore(
 0969                        identifier,
 0970                        exception?.ToString());
 971                }
 972            }
 0973        }
 974
 975        [Event(SendLinkClosedEvent, Level = EventLevel.Informational, Message = "Send Link Closed. Identifier: {0}, link
 976        public virtual void SendLinkClosedCore(
 977            string identifier,
 978            string linkException)
 979        {
 0980            if (IsEnabled())
 981            {
 0982                WriteEvent(SendLinkClosedEvent, identifier, linkException);
 983            }
 0984        }
 985
 986        [Event(CreateReceiveLinkStartEvent, Level = EventLevel.Informational, Message = "Creating receive link for Ident
 987        public virtual void CreateReceiveLinkStart(string identifier)
 988        {
 36989            if (IsEnabled())
 990            {
 0991                WriteEvent(CreateReceiveLinkStartEvent, identifier);
 992            }
 36993        }
 994
 995        [Event(CreateReceiveLinkCompleteEvent, Level = EventLevel.Informational, Message = "Receive link created for Ide
 996        public virtual void CreateReceiveLinkComplete(string identifier)
 997        {
 0998            if (IsEnabled())
 999            {
 01000                WriteEvent(CreateReceiveLinkCompleteEvent, identifier);
 1001            }
 01002        }
 1003
 1004        [Event(CreateReceiveLinkExceptionEvent, Level = EventLevel.Error, Message = "An exception occurred while creatin
 1005        public virtual void CreateReceiveLinkException(string identifier, string exception)
 1006        {
 361007            if (IsEnabled())
 1008            {
 01009                WriteEvent(CreateReceiveLinkExceptionEvent, identifier, exception);
 1010            }
 361011        }
 1012
 1013        [Event(CreateManagementLinkStartEvent, Level = EventLevel.Informational, Message = "Creating management link for
 1014        public virtual void CreateManagementLinkStart(string identifier)
 1015        {
 01016            if (IsEnabled())
 1017            {
 01018                WriteEvent(CreateManagementLinkStartEvent, identifier);
 1019            }
 01020        }
 1021
 1022        [Event(CreateManagementLinkCompleteEvent, Level = EventLevel.Informational, Message = "Management link created f
 1023        public virtual void CreateManagementLinkComplete(string identifier)
 1024        {
 01025            if (IsEnabled())
 1026            {
 01027                WriteEvent(CreateManagementLinkCompleteEvent, identifier);
 1028            }
 01029        }
 1030
 1031        [Event(CreateManagementLinkExceptionEvent, Level = EventLevel.Error, Message = "An exception occurred while crea
 1032        public virtual void CreateManagementLinkException(string identifier, string exception)
 1033        {
 01034            if (IsEnabled())
 1035            {
 01036                WriteEvent(CreateManagementLinkExceptionEvent, identifier, exception);
 1037            }
 01038        }
 1039
 1040        [NonEvent]
 1041        public virtual void ManagementLinkClosed(
 1042            string identifier,
 1043            object managementLink)
 1044        {
 01045            if (IsEnabled())
 1046            {
 01047                var link = (RequestResponseAmqpLink)managementLink;
 01048                if (link != null)
 1049                {
 01050                    Exception exception = link.GetInnerException();
 01051                    ManagementLinkClosedCore(
 01052                        identifier,
 01053                        exception?.ToString());
 1054                }
 1055            }
 01056        }
 1057
 1058        [Event(ManagementLinkClosedEvent, Level = EventLevel.Informational, Message = "Management Link Closed. Identifie
 1059        public virtual void ManagementLinkClosedCore(
 1060            string identifier,
 1061            string linkException)
 1062        {
 01063            if (IsEnabled())
 1064            {
 01065                WriteEvent(ManagementLinkClosedEvent, identifier, linkException);
 1066            }
 01067        }
 1068        #endregion
 1069
 1070        #region Retries
 1071
 1072        [Event(RunOperationExceptionEvent, Level = EventLevel.Warning, Message = "RunOperation encountered an exception 
 1073        public virtual void RunOperationExceptionEncountered(string exception)
 1074        {
 121075            if (IsEnabled())
 1076            {
 01077                WriteEvent(RunOperationExceptionEvent, exception);
 1078            }
 121079        }
 1080        #endregion
 1081
 1082        #region Client lifecycle
 1083
 1084        /// <summary>
 1085        ///   Indicates that a client is being created, which may correspond to
 1086        ///   a <see cref="ServiceBusClient" />, <see cref="ServiceBusSender" />,
 1087        ///   or <see cref="ServiceBusReceiver"/>.
 1088        /// </summary>
 1089        ///
 1090        /// <param name="clientType">The type of client being created.</param>
 1091        /// <param name="fullyQualifiedNamespace">The namespace for the client.</param>
 1092        /// <param name="entityName">The entity name for the client.</param>
 1093        [NonEvent]
 1094        public virtual void ClientCreateStart(
 1095            Type clientType,
 1096            string fullyQualifiedNamespace,
 1097            string entityName = default)
 1098        {
 1401099            if (IsEnabled())
 1100            {
 01101                ClientCreateStartCore(clientType.Name, fullyQualifiedNamespace, entityName ?? string.Empty);
 1102            }
 1401103        }
 1104
 1105        [Event(ClientCreateStartEvent, Level = EventLevel.Verbose, Message = "Creating a {0} (Namespace: '{1}', Entity n
 1106        public virtual void ClientCreateStartCore(
 1107            string clientType,
 1108            string fullyQualifiedNamespace,
 1109            string entityName = default)
 1110        {
 01111            if (IsEnabled())
 1112            {
 01113                WriteEvent(ClientCreateStartEvent, clientType, fullyQualifiedNamespace, entityName);
 1114            }
 01115        }
 1116
 1117        /// <summary>
 1118        ///   Indicates that a client has been created, which may correspond to a
 1119        ///   <see cref="ServiceBusClient" />, <see cref="ServiceBusSender" />, or
 1120        ///   <see cref="ServiceBusReceiver"/>.
 1121        /// </summary>
 1122        ///
 1123        /// <param name="clientType">The type of client being closed.</param>
 1124        /// <param name="identifier">An identifier to associate with the client.</param>
 1125        ///
 1126        [NonEvent]
 1127        public virtual void ClientCreateComplete(
 1128            Type clientType,
 1129            string identifier)
 1130        {
 1161131            if (IsEnabled())
 1132            {
 01133                ClientCreateCompleteCore(clientType.Name, identifier ?? string.Empty);
 1134            }
 1161135        }
 1136
 1137        [Event(ClientCreateCompleteEvent, Level = EventLevel.Verbose, Message = "A {0} has been created (Identifier '{1}
 1138        public virtual void ClientCreateCompleteCore(
 1139            string clientType,
 1140            string identifier)
 1141        {
 01142            if (IsEnabled())
 1143            {
 01144                WriteEvent(ClientCreateCompleteEvent, clientType, identifier ?? string.Empty);
 1145            }
 01146        }
 1147
 1148        /// <summary>
 1149        ///   Indicates that an exception was encountered while creating
 1150        ///   <see cref="ServiceBusClient" />, <see cref="ServiceBusSender" />, or
 1151        ///   <see cref="ServiceBusReceiver"/>.
 1152        /// </summary>
 1153        ///
 1154        /// <param name="clientType">The type of client being closed.</param>
 1155        /// <param name="fullyQualifiedNamespace">The namespace for the client.</param>
 1156        /// <param name="entityPath">The entity path for the client.</param>
 1157        /// <param name="exception">The message for the exception that occurred.</param>
 1158        ///
 1159        [NonEvent]
 1160        public virtual void ClientCreateException(
 1161            Type clientType,
 1162            string fullyQualifiedNamespace,
 1163            string entityPath,
 1164            Exception exception)
 1165        {
 01166            if (IsEnabled())
 1167            {
 01168                ClientCreateExceptionCore(clientType.Name, fullyQualifiedNamespace, entityPath, exception.ToString());
 1169            }
 01170        }
 1171
 1172        [Event(ClientCreateExceptionEvent, Level = EventLevel.Error, Message = "An exception occurred while creating a {
 1173        public virtual void ClientCreateExceptionCore(
 1174            string clientType,
 1175            string fullyQualifiedNamespace,
 1176            string entityPath,
 1177            string exception)
 1178        {
 01179            if (IsEnabled())
 1180            {
 01181                WriteEvent(ClientCreateExceptionEvent, clientType, fullyQualifiedNamespace, entityPath, exception);
 1182            }
 01183        }
 1184
 1185        /// <summary>
 1186        ///   Indicates that a client is closing, which may correspond to
 1187        ///   a <see cref="ServiceBusClient" />, <see cref="ServiceBusSender" />,
 1188        ///   or <see cref="ServiceBusReceiver"/>.
 1189        /// </summary>
 1190        ///
 1191        /// <param name="clientType">The type of client being closed.</param>
 1192        /// <param name="identifier">An identifier to associate with the client.</param>
 1193        ///
 1194        [NonEvent]
 1195        public virtual void ClientDisposeStart(
 1196            Type clientType,
 1197            string identifier)
 1198        {
 41199            if (IsEnabled())
 1200            {
 01201                ClientDisposeStartCore(clientType.Name, identifier ?? string.Empty);
 1202            }
 41203        }
 1204
 1205        [Event(ClientDisposeStartEvent, Level = EventLevel.Verbose, Message = "Closing a {0} (Identifier '{1}').")]
 1206        public virtual void ClientDisposeStartCore(
 1207            string clientType,
 1208            string identifier)
 1209        {
 01210            if (IsEnabled())
 1211            {
 01212                WriteEvent(ClientDisposeStartEvent, clientType, identifier);
 1213            }
 01214        }
 1215
 1216        /// <summary>
 1217        ///   Indicates that a client has been closed, which may correspond to an <see cref="ServiceBusConnection" />,
 1218        ///   <see cref="ServiceBusSender" />, <see cref="ServiceBusProcessor" />, or <c>EventProcessorClient</c>.
 1219        /// </summary>
 1220        ///
 1221        /// <param name="clientType">The type of client being closed.</param>
 1222        /// <param name="identifier">An identifier to associate with the client.</param>
 1223        ///
 1224        [NonEvent]
 1225        public virtual void ClientDisposeComplete(
 1226            Type clientType,
 1227            string identifier)
 1228        {
 41229            if (IsEnabled())
 1230            {
 01231                ClientDisposeCompleteCore(clientType.Name, identifier ?? string.Empty);
 1232            }
 41233        }
 1234
 1235        [Event(ClientDisposeCompleteEvent, Level = EventLevel.Verbose, Message = "A {0} has been closed (Identifier '{1}
 1236        public virtual void ClientDisposeCompleteCore(
 1237            string clientType,
 1238            string identifier)
 1239        {
 01240            if (IsEnabled())
 1241            {
 01242                WriteEvent(ClientDisposeCompleteEvent, clientType, identifier);
 1243            }
 01244        }
 1245
 1246        /// <summary>
 1247        ///   Indicates that an exception was encountered while closing an <see cref="ServiceBusConnection" />,
 1248        ///   <see cref="ServiceBusSender" />, <see cref="ServiceBusProcessor" />, or <c>EventProcessorClient</c>.
 1249        /// </summary>
 1250        ///
 1251        /// <param name="clientType">The type of client being closed.</param>
 1252        /// <param name="identifier">An identifier to associate with the client.</param>
 1253        /// <param name="exception">The message for the exception that occurred.</param>
 1254        ///
 1255        [NonEvent]
 1256        public virtual void ClientDisposeException(
 1257            Type clientType,
 1258            string identifier,
 1259            Exception exception)
 1260        {
 01261            if (IsEnabled())
 1262            {
 01263                ClientDisposeExceptionCore(clientType.Name, identifier ?? string.Empty, exception.ToString());
 1264            }
 01265        }
 1266
 1267        [Event(ClientDisposeExceptionEvent, Level = EventLevel.Error, Message = "An exception occurred while closing a {
 1268        public virtual void ClientDisposeExceptionCore(
 1269            string clientType,
 1270            string identifier,
 1271            string exception)
 1272        {
 01273            if (IsEnabled())
 1274            {
 01275                WriteEvent(ClientDisposeExceptionEvent, clientType, identifier, exception);
 1276            }
 01277        }
 1278        #endregion
 1279
 1280        #region transactions
 1281        [Event(TransactionInitializationExceptionEvent, Level = EventLevel.Error, Message = "AmqpTransactionInitializeEx
 1282        public void TransactionInitializeException(string transactionId, string exception)
 1283        {
 01284            if (IsEnabled())
 1285            {
 01286                WriteEvent(TransactionInitializationExceptionEvent, transactionId, exception);
 1287            }
 01288        }
 1289
 1290        [NonEvent]
 1291        public void TransactionDeclared(string localTransactionId, ArraySegment<byte> amqpTransactionId)
 1292        {
 01293            if (IsEnabled())
 1294            {
 01295                TransactionDeclared(localTransactionId, amqpTransactionId.GetAsciiString());
 1296            }
 01297        }
 1298
 1299        [Event(TransactionDeclaredEvent, Level = EventLevel.Informational, Message = "AmqpTransactionDeclared for LocalT
 1300        public void TransactionDeclared(string transactionId, string amqpTransactionId)
 1301        {
 01302            WriteEvent(TransactionDeclaredEvent, transactionId, amqpTransactionId);
 01303        }
 1304
 1305        [NonEvent]
 1306        public void TransactionDischarged(string localTransactionId, ArraySegment<byte> amqpTransactionId, bool rollback
 1307        {
 01308            if (IsEnabled())
 1309            {
 01310                TransactionDischarged(localTransactionId, amqpTransactionId.GetAsciiString(), rollback);
 1311            }
 01312        }
 1313
 1314        [Event(TransactionDischargedEvent, Level = EventLevel.Informational, Message = "AmqpTransactionDischarged for Lo
 1315        public void TransactionDischarged(string transactionId, string amqpTransactionId, bool rollback)
 1316        {
 01317            WriteEvent(TransactionDischargedEvent, transactionId, amqpTransactionId, rollback);
 01318        }
 1319
 1320        [NonEvent]
 1321        public void TransactionDischargeException(string transactionId, ArraySegment<byte> amqpTransactionId, Exception 
 1322        {
 01323            if (IsEnabled())
 1324            {
 01325                TransactionDischargeException(transactionId, amqpTransactionId.GetAsciiString(), exception.ToString());
 1326            }
 01327        }
 1328
 1329        [Event(TransactionDischargedExceptionEvent, Level = EventLevel.Error, Message = "AmqpTransactionDischargeExcepti
 1330        public void TransactionDischargeException(string transactionId, string amqpTransactionId, string exception)
 1331        {
 01332            WriteEvent(TransactionDischargedExceptionEvent, transactionId, amqpTransactionId, exception);
 01333        }
 1334
 1335        [Event(CreateControllerExceptionEvent, Level = EventLevel.Error, Message = "AmqpCreateControllerException for Co
 1336        public void CreateControllerException(string connectionManager, string exception)
 1337        {
 01338            if (IsEnabled())
 1339            {
 01340                WriteEvent(CreateControllerExceptionEvent, connectionManager, exception);
 1341            }
 01342        }
 1343        #endregion
 1344
 1345        #region plugins
 1346        [Event(PluginStartEvent, Level = EventLevel.Verbose, Message = "User plugin {0} called on message {1}")]
 1347        public void PluginCallStarted(string pluginName, string messageId)
 1348        {
 01349            if (IsEnabled())
 1350            {
 01351                WriteEvent(PluginStartEvent, pluginName, messageId);
 1352            }
 01353        }
 1354
 1355        [Event(PluginCompleteEvent, Level = EventLevel.Verbose, Message = "User plugin {0} completed on message {1}")]
 1356        public void PluginCallCompleted(string pluginName, string messageId)
 1357        {
 01358            if (IsEnabled())
 1359            {
 01360                WriteEvent(PluginCompleteEvent, pluginName, messageId);
 1361            }
 01362        }
 1363
 1364        [Event(PluginExceptionEvent, Level = EventLevel.Error, Message = "Exception during {0} plugin execution. Message
 1365        public void PluginCallException(string pluginName, string messageId, string exception)
 1366        {
 01367            if (IsEnabled())
 1368            {
 01369                WriteEvent(PluginExceptionEvent, pluginName, messageId, exception);
 1370            }
 01371        }
 1372        #endregion
 1373
 1374        #region misc
 1375        [NonEvent]
 1376        public void ScheduleTaskFailed(Func<Task> task, Exception exception)
 1377        {
 01378            if (IsEnabled())
 1379            {
 01380                ScheduleTaskFailed(task.Target.GetType().FullName, task.GetMethodInfo().Name, exception.ToString());
 1381            }
 01382        }
 1383
 1384        [Event(ScheduleTaskFailedEvent, Level = EventLevel.Error, Message = "Exception during Schedule Task. FunctionTar
 1385        public void ScheduleTaskFailed(string funcTargetName, string methodInfoName, string exception)
 1386        {
 01387            WriteEvent(ScheduleTaskFailedEvent, funcTargetName, methodInfoName, exception);
 01388        }
 1389
 1390        [Event(ManagementSerializedExceptionEvent, Level = EventLevel.Warning, Message = "[De]Serialization failed for o
 1391        public void ManagementSerializationException(string objectName, string details = "")
 1392        {
 01393            if (IsEnabled())
 1394            {
 01395                WriteEvent(ManagementSerializedExceptionEvent, objectName, details);
 1396            }
 01397        }
 1398
 1399        [Event(MaxMessagesExceedsPrefetchEvent, Level = EventLevel.Warning, Message = "Prefetch count for receiver with 
 1400        public virtual void MaxMessagesExceedsPrefetch(string identifier, int prefetchCount, int maxMessages)
 1401        {
 01402            if (IsEnabled())
 1403            {
 01404                WriteEvent(MaxMessagesExceedsPrefetchEvent, identifier, prefetchCount, maxMessages);
 1405            }
 01406        }
 1407        #endregion
 1408    }
 1409}

Methods/Properties

get_Log()
.ctor(...)
.ctor()
SendMessageStart(...)
SendMessageComplete(...)
SendMessageException(...)
CreateMessageBatchStart(...)
CreateMessageBatchComplete(...)
CreateMessageBatchException(...)
ReceiveMessageStart(...)
ReceiveMessageComplete(...)
ReceiveMessageException(...)
ReceiveDeferredMessageStartCore(...)
ReceiveDeferredMessageStart(...)
ReceiveDeferredMessageComplete(...)
ReceiveDeferredMessageException(...)
PeekMessageStart(...)
PeekMessageComplete(...)
PeekMessageException(...)
ScheduleMessagesStart(...)
ScheduleMessagesComplete(...)
ScheduleMessagesException(...)
CancelScheduledMessagesStart(...)
CancelScheduledMessagesStartCore(...)
CancelScheduledMessagesComplete(...)
CancelScheduledMessagesException(...)
CompleteMessageStart(...)
CompleteMessageComplete(...)
CompleteMessageException(...)
DeferMessageStart(...)
DeferMessageComplete(...)
DeferMessageException(...)
AbandonMessageStart(...)
AbandonMessageComplete(...)
AbandonMessageException(...)
DeadLetterMessageStart(...)
DeadLetterMessageComplete(...)
DeadLetterMessageException(...)
RenewMessageLockStart(...)
RenewMessageLockComplete(...)
RenewMessageLockException(...)
RenewSessionLockStart(...)
RenewSessionLockComplete(...)
RenewSessionLockException(...)
GetSessionStateStart(...)
GetSessionStateComplete(...)
GetSessionStateException(...)
SetSessionStateStart(...)
SetSessionStateComplete(...)
SetSessionStateException(...)
StartProcessingStart(...)
StartProcessingComplete(...)
StartProcessingException(...)
StopProcessingStart(...)
StopProcessingComplete(...)
StopProcessingException(...)
ProcessorRenewMessageLockStart(...)
ProcessorRenewMessageLockComplete(...)
ProcessorRenewMessageLockException(...)
ProcessorRenewSessionLockStart(...)
ProcessorRenewSessionLockComplete(...)
ProcessorRenewSessionLockException(...)
ProcessorErrorHandlerThrewException(...)
AddRuleStart(...)
AddRuleComplete(...)
AddRuleException(...)
RemoveRuleStart(...)
RemoveRuleComplete(...)
RemoveRuleException(...)
GetRuleStart(...)
GetRuleComplete(...)
GetRuleException(...)
LinkStateLost(...)
ReceiveLinkClosed(...)
ReceiveLinkClosedCore(...)
AmqpLinkAuthorizationRefreshStart(...)
AmqpLinkAuthorizationRefreshComplete(...)
AmqpLinkAuthorizationRefreshError(...)
CreateSendLinkStart(...)
CreateSendLinkComplete(...)
CreateSendLinkException(...)
SendLinkClosed(...)
SendLinkClosedCore(...)
CreateReceiveLinkStart(...)
CreateReceiveLinkComplete(...)
CreateReceiveLinkException(...)
CreateManagementLinkStart(...)
CreateManagementLinkComplete(...)
CreateManagementLinkException(...)
ManagementLinkClosed(...)
ManagementLinkClosedCore(...)
RunOperationExceptionEncountered(...)
ClientCreateStart(...)
ClientCreateStartCore(...)
ClientCreateComplete(...)
ClientCreateCompleteCore(...)
ClientCreateException(...)
ClientCreateExceptionCore(...)
ClientDisposeStart(...)
ClientDisposeStartCore(...)
ClientDisposeComplete(...)
ClientDisposeCompleteCore(...)
ClientDisposeException(...)
ClientDisposeExceptionCore(...)
TransactionInitializeException(...)
TransactionDeclared(...)
TransactionDeclared(...)
TransactionDischarged(...)
TransactionDischarged(...)
TransactionDischargeException(...)
TransactionDischargeException(...)
CreateControllerException(...)
PluginCallStarted(...)
PluginCallCompleted(...)
PluginCallException(...)
ScheduleTaskFailed(...)
ScheduleTaskFailed(...)
ManagementSerializationException(...)
MaxMessagesExceedsPrefetch(...)