Example #1
0
        //public string RequestUrl { get; set; }

        public static WebEvent FromWebBaseEvent(WebBaseEvent webBaseEvent)
        {
            var webEvent = new WebEvent();

            webEvent.ApplicationPath = HostingEnvironment.ApplicationPhysicalPath;
            webEvent.ApplicationVirtualPath = HostingEnvironment.ApplicationVirtualPath;
            webEvent.Details = webBaseEvent.ToString();
            webEvent.EventCode = webBaseEvent.EventCode;
            webEvent.EventDetailCode = webBaseEvent.EventDetailCode;
            webEvent.EventID = webBaseEvent.EventID;
            webEvent.EventOccurrence = webBaseEvent.EventOccurrence;
            webEvent.EventSequence = webBaseEvent.EventSequence;
            webEvent.EventTime = webBaseEvent.EventTime;
            webEvent.EventTimeUtc = webBaseEvent.EventTimeUtc;
            webEvent.EventType = webBaseEvent.GetType().Name;
            //webEvent.MachineName = HttpContext.Current.Server.MachineName;
            webEvent.Message = webBaseEvent.Message;
            //webEvent.RequestUrl = HttpContext.Current.Request.Url.ToString();

            if (webBaseEvent is WebBaseErrorEvent)
            {
                webEvent.ExceptionType = ((WebBaseErrorEvent)webBaseEvent).ErrorException.GetType().Name;
            }

            return webEvent;
        }
Example #2
0
        public static WebEvent FromWebBaseEvent(WebBaseEvent webBaseEvent)
        {
          var webEvent = new WebEvent
          {
            ApplicationPath = HostingEnvironment.ApplicationPhysicalPath,
            ApplicationVirtualPath = HostingEnvironment.ApplicationVirtualPath,
            Details = webBaseEvent.ToString(),
            EventCode = webBaseEvent.EventCode,
            EventDetailCode = webBaseEvent.EventDetailCode,
            EventID = webBaseEvent.EventID,
            EventOccurrence = webBaseEvent.EventOccurrence,
            EventSequence = webBaseEvent.EventSequence,
            EventTime = webBaseEvent.EventTime,
            EventTimeUtc = webBaseEvent.EventTimeUtc,
            EventType = webBaseEvent.GetType().Name,
            Message = webBaseEvent.Message
          };


          var baseErrorEvent = webBaseEvent as WebBaseErrorEvent;
          if (baseErrorEvent != null)
            {
                webEvent.ExceptionType = baseErrorEvent.ErrorException.GetType().Name;
            }

            return webEvent;
        }
Example #3
0
        //public string RequestUrl { get; set; }

        public static WebEvent FromWebBaseEvent(WebBaseEvent webBaseEvent)
        {
            var webEvent = new WebEvent();

            webEvent.ApplicationPath        = HostingEnvironment.ApplicationPhysicalPath;
            webEvent.ApplicationVirtualPath = HostingEnvironment.ApplicationVirtualPath;
            webEvent.Details         = webBaseEvent.ToString();
            webEvent.EventCode       = webBaseEvent.EventCode;
            webEvent.EventDetailCode = webBaseEvent.EventDetailCode;
            webEvent.EventID         = webBaseEvent.EventID;
            webEvent.EventOccurrence = webBaseEvent.EventOccurrence;
            webEvent.EventSequence   = webBaseEvent.EventSequence;
            webEvent.EventTime       = webBaseEvent.EventTime;
            webEvent.EventTimeUtc    = webBaseEvent.EventTimeUtc;
            webEvent.EventType       = webBaseEvent.GetType().Name;
            //webEvent.MachineName = HttpContext.Current.Server.MachineName;
            webEvent.Message = webBaseEvent.Message;
            //webEvent.RequestUrl = HttpContext.Current.Request.Url.ToString();

            if (webBaseEvent is WebBaseErrorEvent)
            {
                webEvent.ExceptionType = ((WebBaseErrorEvent)webBaseEvent).ErrorException.GetType().Name;
            }

            return(webEvent);
        }
Example #4
0
        public static WebEvent FromWebBaseEvent(WebBaseEvent webBaseEvent)
        {
            var webEvent = new WebEvent
            {
                ApplicationPath        = HostingEnvironment.ApplicationPhysicalPath,
                ApplicationVirtualPath = HostingEnvironment.ApplicationVirtualPath,
                Details         = webBaseEvent.ToString(),
                EventCode       = webBaseEvent.EventCode,
                EventDetailCode = webBaseEvent.EventDetailCode,
                EventID         = webBaseEvent.EventID,
                EventOccurrence = webBaseEvent.EventOccurrence,
                EventSequence   = webBaseEvent.EventSequence,
                EventTime       = webBaseEvent.EventTime,
                EventTimeUtc    = webBaseEvent.EventTimeUtc,
                EventType       = webBaseEvent.GetType().Name,
                Message         = webBaseEvent.Message
            };


            var baseErrorEvent = webBaseEvent as WebBaseErrorEvent;

            if (baseErrorEvent != null)
            {
                webEvent.ExceptionType = baseErrorEvent.ErrorException.GetType().Name;
            }

            return(webEvent);
        }