Ejemplo n.º 1
0
 public void StopCallService(
     System.Fabric.StatefulServiceContext context,
     System.Uri requestUri,
     string serviceMethodName,
     Microsoft.ServiceFabric.Services.Remoting.ServiceRemotingMessageHeaders serviceMessageHeaders,
     FG.ServiceFabric.Services.Remoting.FabricTransport.CustomServiceRequestHeader customServiceRequestHeader)
 {
     if (this.IsEnabled())
     {
         StopCallService(
             context.ServiceName.ToString(),
             context.ServiceTypeName,
             context.ReplicaOrInstanceId,
             context.PartitionId,
             context.CodePackageActivationContext.ApplicationName,
             context.CodePackageActivationContext.ApplicationTypeName,
             context.NodeContext.NodeName,
             requestUri.ToString(),
             serviceMethodName,
             (serviceMessageHeaders?.InterfaceId ?? 0),
             (serviceMessageHeaders?.MethodId ?? 0),
             customServiceRequestHeader?.GetHeader("userId"),
             customServiceRequestHeader?.GetHeader("correlationId"));
     }
 }
Ejemplo n.º 2
0
 public void ServiceClientFailed(
     System.Fabric.StatefulServiceContext context,
     System.Uri requestUri,
     FG.ServiceFabric.Services.Remoting.FabricTransport.CustomServiceRequestHeader customServiceRequestHeader,
     System.Exception ex)
 {
     if (this.IsEnabled())
     {
         ServiceClientFailed(
             context.ServiceName.ToString(),
             context.ServiceTypeName,
             context.ReplicaOrInstanceId,
             context.PartitionId,
             context.CodePackageActivationContext.ApplicationName,
             context.CodePackageActivationContext.ApplicationTypeName,
             context.NodeContext.NodeName,
             requestUri.ToString(),
             customServiceRequestHeader?.GetHeader("userId"),
             customServiceRequestHeader?.GetHeader("correlationId"),
             ex.Message,
             ex.Source,
             ex.GetType().FullName,
             ex.AsJson());
     }
 }
Ejemplo n.º 3
0
 public void FailedToGetServiceMethodName(
     System.Fabric.StatefulServiceContext context,
     System.Uri requestUri,
     int interfaceId,
     int methodId,
     System.Exception ex)
 {
     if (this.IsEnabled())
     {
         FailedToGetServiceMethodName(
             context.ServiceName.ToString(),
             context.ServiceTypeName,
             context.ReplicaOrInstanceId,
             context.PartitionId,
             context.CodePackageActivationContext.ApplicationName,
             context.CodePackageActivationContext.ApplicationTypeName,
             context.NodeContext.NodeName,
             requestUri.ToString(),
             interfaceId,
             methodId,
             ex.Message,
             ex.Source,
             ex.GetType().FullName,
             ex.AsJson());
     }
 }
Ejemplo n.º 4
0
 public void RecieveServiceMessageFailed(
     System.Fabric.StatefulServiceContext context,
     System.Uri requestUri,
     string serviceMethodName,
     Microsoft.ServiceFabric.Services.Remoting.ServiceRemotingMessageHeaders serviceMessageHeaders,
     FG.ServiceFabric.Services.Remoting.FabricTransport.CustomServiceRequestHeader customServiceRequestHeader,
     System.Exception ex)
 {
     if (this.IsEnabled())
     {
         RecieveServiceMessageFailed(
             context.ServiceName.ToString(),
             context.ServiceTypeName,
             context.ReplicaOrInstanceId,
             context.PartitionId,
             context.CodePackageActivationContext.ApplicationName,
             context.CodePackageActivationContext.ApplicationTypeName,
             context.NodeContext.NodeName,
             requestUri.ToString(),
             serviceMethodName,
             (serviceMessageHeaders?.InterfaceId ?? 0),
             (serviceMessageHeaders?.MethodId ?? 0),
             customServiceRequestHeader?.GetHeader("userId"),
             customServiceRequestHeader?.GetHeader("correlationId"),
             ex.Message,
             ex.Source,
             ex.GetType().FullName,
             ex.AsJson());
     }
 }
Ejemplo n.º 5
0
        public CommunicationLogger(
            System.Fabric.StatefulServiceContext context)
        {
            _context = context;

            _telemetryClient = new Microsoft.ApplicationInsights.TelemetryClient();
            _telemetryClient.Context.User.Id                = Environment.UserName;
            _telemetryClient.Context.Session.Id             = Guid.NewGuid().ToString();
            _telemetryClient.Context.Device.OperatingSystem = Environment.OSVersion.ToString();
        }
Ejemplo n.º 6
0
        public TitleServiceLogger(
            System.Fabric.StatefulServiceContext serviceContext,
            FG.ServiceFabric.Services.Remoting.FabricTransport.ServiceRequestContext requestContext)
        {
            _serviceContext = serviceContext;
            _requestContext = requestContext;

            _telemetryClient = new Microsoft.ApplicationInsights.TelemetryClient();
            _telemetryClient.Context.User.Id                = Environment.UserName;
            _telemetryClient.Context.Session.Id             = Guid.NewGuid().ToString();
            _telemetryClient.Context.Device.OperatingSystem = Environment.OSVersion.ToString();
        }
Ejemplo n.º 7
0
 public void EnumeratingPartitions(
     System.Fabric.StatefulServiceContext context,
     System.Uri serviceUri)
 {
     if (this.IsEnabled())
     {
         EnumeratingPartitions(
             context.ServiceName.ToString(),
             context.ServiceTypeName,
             context.ReplicaOrInstanceId,
             context.PartitionId,
             context.CodePackageActivationContext.ApplicationName,
             context.CodePackageActivationContext.ApplicationTypeName,
             context.NodeContext.NodeName,
             serviceUri.ToString());
     }
 }
Ejemplo n.º 8
0
 public void StopRequestContext(
     System.Fabric.StatefulServiceContext context,
     System.Collections.Generic.IEnumerable <FG.ServiceFabric.Services.Remoting.FabricTransport.ServiceRequestHeader> headers)
 {
     if (this.IsEnabled())
     {
         StopRequestContext(
             context.ServiceName.ToString(),
             context.ServiceTypeName,
             context.ReplicaOrInstanceId,
             context.PartitionId,
             context.CodePackageActivationContext.ApplicationName,
             context.CodePackageActivationContext.ApplicationTypeName,
             context.NodeContext.NodeName,
             headers.ToString());
     }
 }
Ejemplo n.º 9
0
 public void EnumeratedAndCachedPartitions(
     System.Fabric.StatefulServiceContext context,
     System.Uri serviceUri,
     System.Collections.Generic.IEnumerable <System.Fabric.ServicePartitionInformation> partitions)
 {
     if (this.IsEnabled())
     {
         EnumeratedAndCachedPartitions(
             context.ServiceName.ToString(),
             context.ServiceTypeName,
             context.ReplicaOrInstanceId,
             context.PartitionId,
             context.CodePackageActivationContext.ApplicationName,
             context.CodePackageActivationContext.ApplicationTypeName,
             context.NodeContext.NodeName,
             serviceUri.ToString(),
             partitions.ToString());
     }
 }
Ejemplo n.º 10
0
 public void FailedToEnumeratePartitions(
     System.Fabric.StatefulServiceContext context,
     System.Uri serviceUri,
     System.Exception ex)
 {
     if (this.IsEnabled())
     {
         FailedToEnumeratePartitions(
             context.ServiceName.ToString(),
             context.ServiceTypeName,
             context.ReplicaOrInstanceId,
             context.PartitionId,
             context.CodePackageActivationContext.ApplicationName,
             context.CodePackageActivationContext.ApplicationTypeName,
             context.NodeContext.NodeName,
             serviceUri.ToString(),
             ex.Message,
             ex.Source,
             ex.GetType().FullName,
             ex.AsJson());
     }
 }
Ejemplo n.º 11
0
 public void FailedRequestContext(
     System.Fabric.StatefulServiceContext context,
     System.Collections.Generic.IEnumerable <FG.ServiceFabric.Services.Remoting.FabricTransport.ServiceRequestHeader> headers,
     System.Exception exception)
 {
     if (this.IsEnabled())
     {
         FailedRequestContext(
             context.ServiceName.ToString(),
             context.ServiceTypeName,
             context.ReplicaOrInstanceId,
             context.PartitionId,
             context.CodePackageActivationContext.ApplicationName,
             context.CodePackageActivationContext.ApplicationTypeName,
             context.NodeContext.NodeName,
             headers.ToString(),
             exception.Message,
             exception.Source,
             exception.GetType().FullName,
             exception.AsJson());
     }
 }
Ejemplo n.º 12
0
 public void FailedToReadCustomServiceMessageHeader(
     System.Fabric.StatefulServiceContext context,
     Microsoft.ServiceFabric.Services.Remoting.ServiceRemotingMessageHeaders serviceRemotingMessageHeaders,
     System.Exception ex)
 {
     if (this.IsEnabled())
     {
         FailedToReadCustomServiceMessageHeader(
             context.ServiceName.ToString(),
             context.ServiceTypeName,
             context.ReplicaOrInstanceId,
             context.PartitionId,
             context.CodePackageActivationContext.ApplicationName,
             context.CodePackageActivationContext.ApplicationTypeName,
             context.NodeContext.NodeName,
             (serviceRemotingMessageHeaders?.InterfaceId ?? 0),
             (serviceRemotingMessageHeaders?.MethodId ?? 0),
             ex.Message,
             ex.Source,
             ex.GetType().FullName,
             ex.AsJson());
     }
 }
Ejemplo n.º 13
0
 public void UpdateTitle(
     System.Fabric.StatefulServiceContext serviceContext,
     FG.ServiceFabric.Services.Remoting.FabricTransport.ServiceRequestContext requestContext,
     string person,
     string title)
 {
     if (this.IsEnabled())
     {
         UpdateTitle(
             serviceContext.ServiceName.ToString(),
             serviceContext.ServiceTypeName,
             serviceContext.ReplicaOrInstanceId,
             serviceContext.PartitionId,
             serviceContext.CodePackageActivationContext.ApplicationName,
             serviceContext.CodePackageActivationContext.ApplicationTypeName,
             serviceContext.NodeContext.NodeName,
             FG.ServiceFabric.Services.Remoting.FabricTransport.ServiceRequestContext.Current?["correlationId"],
             FG.ServiceFabric.Services.Remoting.FabricTransport.ServiceRequestContext.Current?["userId"],
             FG.ServiceFabric.Services.Remoting.FabricTransport.ServiceRequestContext.Current?["requestUri"],
             person,
             title);
     }
 }