Пример #1
0
        public Logger(UserInfo info, CommonControllerModel commonControllerModel)
        {
            this.Info = info;
            this.CommonControllerModel = commonControllerModel;
            this.telemetryClient       = new TelemetryClient {
                InstrumentationKey = Constants.AppInsightsKey
            };

            this.telemetryClient.Context.Operation.Id   = info.OperationId;
            this.telemetryClient.Context.User.Id        = info.UserId;
            this.telemetryClient.Context.Session.Id     = info.SessionId;
            this.telemetryClient.Context.Operation.Name = info.ActionName;

            if (this.globalParams == null)
            {
                this.globalParams = new Dictionary <string, string>();
            }

            this.globalParams.Add("TemplateName", info.AppName);
            this.globalParams.Add("UserGenId", info.UserGenId);
            this.globalParams.Add("EntryPointAction", info.ActionName);
            this.globalParams.Add("OriginatingSource", commonControllerModel.Source);
            this.globalParams.Add("LinkedOperationId", info.OperationId);
            this.globalParams.Add("UniqueLink", info.UniqueLink);
            this.globalParams.Add("Build", System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString());

            this.AddToDictionary(this.globalParams, this.telemetryClient.Context.Properties);
        }
 public CommonController(CommonControllerModel commonControllerModel)
 {
     this.CommonControllerModel = commonControllerModel;
 }