Пример #1
0
 public void PersonActivated(
     Microsoft.ServiceFabric.Actors.Runtime.Actor actor,
     FG.ServiceFabric.Services.Remoting.FabricTransport.ServiceRequestContext context,
     string name,
     string title)
 {
     if (this.IsEnabled())
     {
         PersonActivated(
             actor.GetType().ToString(),
             actor.Id.ToString(),
             actor.ActorService.Context.CodePackageActivationContext.ApplicationTypeName,
             actor.ActorService.Context.CodePackageActivationContext.ApplicationName,
             actor.ActorService.Context.ServiceTypeName,
             actor.ActorService.Context.ServiceName.ToString(),
             actor.ActorService.Context.PartitionId,
             actor.ActorService.Context.ReplicaId,
             actor.ActorService.Context.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"],
             name,
             title);
     }
 }
Пример #2
0
 public void PersonActivated(
     Microsoft.ServiceFabric.Actors.Runtime.Actor actor,
     Guid correlationId,
     string message,
     string name,
     string title)
 {
     if (this.IsEnabled())
     {
         PersonActivated(
             actor.GetType().ToString(),
             actor.Id.ToString(),
             actor.ActorService.Context.CodePackageActivationContext.ApplicationTypeName,
             actor.ActorService.Context.CodePackageActivationContext.ApplicationName,
             actor.ActorService.Context.ServiceTypeName,
             actor.ActorService.Context.ServiceName.ToString(),
             actor.ActorService.Context.PartitionId,
             actor.ActorService.Context.ReplicaId,
             actor.ActorService.Context.NodeContext.NodeName,
             correlationId,
             message,
             name,
             title);
     }
 }
Пример #3
0
        public ActorDomainLogger(
            Microsoft.ServiceFabric.Actors.Runtime.Actor actor,
            FG.ServiceFabric.Services.Remoting.FabricTransport.ServiceRequestContext context)
        {
            _actor   = actor;
            _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();
        }
Пример #4
0
        public PersonActorLogger(
            Microsoft.ServiceFabric.Actors.Runtime.Actor actor,
            Guid correlationId,
            string message)
        {
            _actor         = actor;
            _correlationId = correlationId;
            _message       = message;

            _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();
        }
Пример #5
0
 public void ActorMessage(Microsoft.ServiceFabric.Actors.Runtime.Actor actor, string message)
 {
     if (this.IsEnabled())
     {
         ActorMessage(
             actor.ActorService.Context.ServiceName.ToString(),
             actor.ActorService.Context.ServiceTypeName,
             actor.ActorService.Context.ReplicaOrInstanceId,
             actor.ActorService.Context.PartitionId,
             actor.ActorService.Context.CodePackageActivationContext.ApplicationName,
             actor.ActorService.Context.CodePackageActivationContext.ApplicationTypeName,
             actor.ActorService.Context.NodeContext.NodeName,
             actor.Id.ToString(),
             actor.ActorService.ActorTypeInformation.ImplementationType.ToString(),
             message);
     }
 }
Пример #6
0
 public void ActorDemoCountUpdated(Microsoft.ServiceFabric.Actors.Runtime.Actor actor, int count)
 {
     if (this.IsEnabled())
     {
         ActorDemoCountUpdated(
             actor.ActorService.Context.ServiceName.ToString(),
             actor.ActorService.Context.ServiceTypeName,
             actor.ActorService.Context.ReplicaOrInstanceId,
             actor.ActorService.Context.PartitionId,
             actor.ActorService.Context.CodePackageActivationContext.ApplicationName,
             actor.ActorService.Context.CodePackageActivationContext.ApplicationTypeName,
             actor.ActorService.Context.NodeContext.NodeName,
             actor.Id.ToString(),
             actor.ActorService.ActorTypeInformation.ImplementationType.ToString(),
             $"ActorDemo count updated {count}",
             count);
     }
 }
Пример #7
0
 public void ActorMessage(Microsoft.ServiceFabric.Actors.Runtime.Actor actor, string message, params object[] args)
 {
     if (this.IsEnabled() &&
         actor.Id != null &&
         actor.ActorService != null &&
         actor.ActorService.Context != null &&
         actor.ActorService.Context.CodePackageActivationContext != null)
     {
         string finalMessage = string.Format(message, args);
         ActorMessage(
             actor.GetType().ToString(),
             actor.Id.ToString(),
             actor.ActorService.Context.CodePackageActivationContext.ApplicationTypeName,
             actor.ActorService.Context.CodePackageActivationContext.ApplicationName,
             actor.ActorService.Context.ServiceTypeName,
             actor.ActorService.Context.ServiceName.ToString(),
             actor.ActorService.Context.PartitionId,
             actor.ActorService.Context.ReplicaId,
             actor.ActorService.Context.NodeContext.NodeName,
             finalMessage);
     }
 }