Ejemplo n.º 1
0
        //log and exceptions

        public WebCallLogEntry(WebCallContext webCtx) : base(webCtx.OperationContext.LogContext)
        {
            WebCallId = Guid.NewGuid();
            Request   = webCtx.Request;
            Response  = webCtx.Response;
            Flags     = webCtx.Flags;
            Exception = webCtx.Request.Exception;
        }
Ejemplo n.º 2
0
        public WebCallLogEntry(WebCallContext webCtx) : base(webCtx.OperationContext, LogEntryType.WebCall)
        {
            var ctx = webCtx.OperationContext;

            this.Id             = webCtx.Id;
            this.CreatedOn      = webCtx.CreatedOn;
            this.Duration       = (int)(webCtx.TickCountEnd - webCtx.TickCountStart);
            this.Url            = webCtx.RequestUrl;
            this.UrlTemplate    = webCtx.RequestUrlTemplate;
            this.UrlReferrer    = webCtx.Referrer;
            this.IPAddress      = webCtx.IPAddress;
            this.ControllerName = webCtx.ControllerName;
            this.MethodName     = webCtx.MethodName;
            if (webCtx.Exception != null)
            {
                this.Error        = webCtx.Exception.Message;
                this.ErrorDetails = webCtx.Exception.ToLogString();
            }
            this.ErrorLogId     = webCtx.ErrorLogId;
            this.HttpMethod     = webCtx.HttpMethod;
            this.HttpStatus     = webCtx.HttpStatus;
            this.RequestSize    = webCtx.RequestSize;
            this.RequestHeaders = webCtx.RequestHeaders;
            this.Flags          = webCtx.Flags;
            if (webCtx.CustomTags.Count > 0)
            {
                this.CustomTags = string.Join(",", webCtx.CustomTags);
            }
            if (webCtx.Flags.IsSet(WebCallFlags.HideRequestBody))
            {
                this.RequestBody = "(Omitted)";
            }
            else
            {
                this.RequestBody = webCtx.RequestBody;
            }

            this.ResponseSize    = webCtx.ResponseSize;
            this.ResponseHeaders = webCtx.ResponseHeaders;
            if (webCtx.Flags.IsSet(WebCallFlags.HideResponseBody))
            {
                this.ResponseBody = "(Omitted)";
            }
            else
            {
                this.ResponseBody = webCtx.ResponseBody;
            }
            this.RequestObjectCount  = webCtx.RequestObjectCount;
            this.ResponseObjectCount = webCtx.ResponseObjectCount;
        }
Ejemplo n.º 3
0
 public static bool IsSet(this WebCallFlags flags, WebCallFlags flag)
 {
     return (flags & flag) != 0;
 }
Ejemplo n.º 4
0
 public static bool IsSet(this WebCallFlags flags, WebCallFlags flag)
 {
     return((flags & flag) != 0);
 }