Beispiel #1
0
        public override void FormatCustomEventDetails(WebEventFormatter formatter)
        {
            base.FormatCustomEventDetails(formatter);

            formatter.AppendLine("User Name: " + _user.Username);
            formatter.AppendLine("Culture: " + _culture);
        }
Beispiel #2
0
        // </Snippet16>

        // <Snippet17>
        //Formats Web request event information.
        public override void FormatCustomEventDetails(
            WebEventFormatter formatter)
        {
            base.FormatCustomEventDetails(formatter);

            // Add custom data.
            formatter.AppendLine("");

            // <Snippet18>
            formatter.IndentationLevel += 1;
            // </Snippet18>

            // <Snippet19>
            formatter.TabSize = 4;
            // </Snippet19>

            // <Snippet20>
            formatter.AppendLine(
                "*SampleWebBaseEvent Start *");

            // Display custom event information.
            formatter.AppendLine(customCreatedMsg);
            formatter.AppendLine(customRaisedMsg);
            formatter.AppendLine(firingRecordInfo);

            formatter.AppendLine(
                "* SampleWebBaseEvent End *");

            // </Snippet20>

            formatter.IndentationLevel -= 1;
        }
        //Formats Web request event information.
        public override void FormatCustomEventDetails(
            WebEventFormatter formatter)
        {
            base.FormatCustomEventDetails(formatter);

            // Add custom data.

            formatter.AppendLine("");
            formatter.AppendLine(
                "Custom Process Statistics:");

            formatter.IndentationLevel += 1;

            // Get the process statistics.
            formatter.AppendLine(GetAppDomainCount());
            formatter.AppendLine(GetManagedHeapSize());
            formatter.AppendLine(GetPeakWorkingSet());
            formatter.AppendLine(GetProcessStartTime());
            formatter.AppendLine(GetRequestsExecuting());
            formatter.AppendLine(GetRequestsQueued());
            formatter.AppendLine(GetRequestsRejected());
            formatter.AppendLine(GetThreadCount());
            formatter.AppendLine(GetWorkingSet());

            formatter.IndentationLevel -= 1;

            formatter.AppendLine(eventInfo.ToString());
        }
 protected override void FormatToString(WebEventFormatter formatter, bool includeAppInfo)
 {
     base.FormatToString(formatter, includeAppInfo);
     if (this._exception != null)
     {
         Exception innerException = this._exception;
         for (int i = 0; (innerException != null) && (i <= 2); i++)
         {
             formatter.AppendLine(string.Empty);
             if (i == 0)
             {
                 formatter.AppendLine(WebBaseEventWrapper.FormatResourceStringWithCache("Webevent_event_exception_information"));
             }
             else
             {
                 formatter.AppendLine(WebBaseEventWrapper.FormatResourceStringWithCache("Webevent_event_inner_exception_information", i.ToString(CultureInfo.InstalledUICulture)));
             }
             formatter.IndentationLevel++;
             formatter.AppendLine(WebBaseEventWrapper.FormatResourceStringWithCache("Webevent_event_exception_type", innerException.GetType().ToString()));
             formatter.AppendLine(WebBaseEventWrapper.FormatResourceStringWithCache("Webevent_event_exception_message", innerException.Message));
             formatter.IndentationLevel--;
             innerException = innerException.InnerException;
         }
     }
 }
Beispiel #5
0
        // </Snippet5>


        // <Snippet6>
        //Formats Web request event information.
        //This method is invoked indirectly by the provider
        // using one of the overloaded ToString() methods.
        public override void FormatCustomEventDetails(
            WebEventFormatter formatter)
        {
            base.FormatCustomEventDetails(formatter);

            // Add custom data.
            formatter.AppendLine("");

            formatter.IndentationLevel += 1;
            formatter.AppendLine(
                "******** SampleWebAuditEvent Information Start ********");
            formatter.AppendLine(string.Format("Request path: {0}",
                                               RequestInformation.RequestPath));
            formatter.AppendLine(string.Format("Request Url: {0}",
                                               RequestInformation.RequestUrl));

            // Display custom event timing.
            formatter.AppendLine(customCreatedMsg);
            formatter.AppendLine(customRaisedMsg);

            formatter.AppendLine(
                "******** SampleWebAuditEvent Information End ********");

            formatter.IndentationLevel -= 1;
        }
 public static void FormatToString(this WebApplicationInformation info, WebEventFormatter formatter)
 {
     formatter.AppendLine(WebBaseEventWrapper.FormatResourceStringWithCache("Webevent_event_application_domain", info.ApplicationDomain));
     formatter.AppendLine(WebBaseEventWrapper.FormatResourceStringWithCache("Webevent_event_trust_level", info.TrustLevel));
     formatter.AppendLine(WebBaseEventWrapper.FormatResourceStringWithCache("Webevent_event_application_virtual_path", info.ApplicationVirtualPath));
     formatter.AppendLine(WebBaseEventWrapper.FormatResourceStringWithCache("Webevent_event_application_path", info.ApplicationPath));
     formatter.AppendLine(WebBaseEventWrapper.FormatResourceStringWithCache("Webevent_event_machine_name", info.MachineName));
 }
Beispiel #7
0
 // Formats Web request event information.
 // This method is invoked indirectly by the provider using one of the
 // overloaded ToString methods. If buffering is enabled, this method is
 // called asynchronously on a non-Web request thread, where the
 // HttpContext is not available.
 public override void FormatCustomEventDetails(WebEventFormatter formatter)
 {
     base.FormatCustomEventDetails(formatter);
     formatter.AppendLine(">>User ID: " + userID);
     formatter.AppendLine(">>Authentication Type: " + authType);
     formatter.AppendLine(">>User Authenticated: " +
                          isAuthenticated.ToString());
     formatter.AppendLine(">>Activity Description: Critical Operation");
 }
Beispiel #8
0
        /// <summary>   Format custom event details.  Calls the base method and then adds the exception on a new line. </summary>
        /// <remarks>   ebrown, 11/10/2010. </remarks>
        /// <exception cref="ArgumentNullException">    Thrown when one or more required arguments are null. </exception>
        /// <param name="formatter">    The formatter. </param>
        public override void FormatCustomEventDetails(WebEventFormatter formatter)
        {
            if (null == formatter)
            {
                throw new ArgumentNullException("formatter");
            }

            base.FormatCustomEventDetails(formatter);
            formatter.AppendLine(_exception.ToString());
        }
Beispiel #9
0
        /// <summary>
        /// Add additional meta data to the log.
        /// </summary>
        /// <param name="formatter">The web formatter object.  This is used to add additional info to the log.</param>
        public override void FormatCustomEventDetails(WebEventFormatter formatter)
        {
            base.FormatCustomEventDetails(formatter);

            //formatter.AppendLine("ApplicationName: " + RuntimeUtilities.ApplicationName);
            //formatter.AppendLine("TimeZone: " + Utility.AbbreviateTimezone(dt));
            //formatter.AppendLine("TimeStampEastern: " + Utility.SchwabEST(dt));
            //formatter.AppendLine("TimeStampLocal: " + Utility.SchwabLocalTime(dt));
            //formatter.AppendLine("UserName: "******"CorrelatorID: " + RuntimeUtilities.CorrelationID);
        }
        public override void FormatCustomEventDetails(WebEventFormatter formatter)
        {
            if (ajaxProcessor != null)
            {
                MethodInfo methodInfo = ajaxProcessor.AjaxMethod;
                object[]   paremeters = ajaxProcessor.RetreiveParameters();
                string     str        = string.Format("TargetSite: {0}", exception.TargetSite);

                formatter.AppendLine(str);
                formatter.AppendLine("");

                if (System.Web.HttpContext.Current.Items[Constant.AjaxID + ".JSON"] != null)
                {
                    formatter.AppendLine("JSON: " + System.Web.HttpContext.Current.Items[Constant.AjaxID + ".JSON"].ToString());
                    formatter.AppendLine("");
                }

                str = string.Format(Constant.AjaxID + " Method: {0}.{1}", methodInfo.ReflectedType.ToString(), methodInfo.Name);

                formatter.AppendLine(str);
                formatter.AppendLine("");

                if (this.parameters != null)
                {
                    foreach (object o in this.parameters)
                    {
                        formatter.AppendLine(string.Format("Parameter: {0}", o));
                    }

                    formatter.AppendLine("");
                }

                formatter.AppendLine("StrackTrace:");
                formatter.AppendLine(exception.StackTrace);
            }
            else
            {
                string str = string.Format("TargetSite: {0}", exception.TargetSite);

                formatter.AppendLine(str);
                formatter.AppendLine("");

                if (System.Web.HttpContext.Current.Items[Constant.AjaxID + ".JSON"] != null)
                {
                    formatter.AppendLine("JSON: " + System.Web.HttpContext.Current.Items[Constant.AjaxID + ".JSON"].ToString());
                    formatter.AppendLine("");
                }

                formatter.AppendLine("StrackTrace:");
                formatter.AppendLine(exception.StackTrace);
            }

            base.FormatCustomEventDetails(formatter);
        }
        // </Snippet6>

        // <Snippet7>
        //Formats Web request event information.
        public override void FormatCustomEventDetails(
            WebEventFormatter formatter)
        {
            base.FormatCustomEventDetails(formatter);

            // Add custom data.
            formatter.AppendLine("Custom Process Information:");
            formatter.IndentationLevel += 1;

            // Display the process information.
            formatter.AppendLine(GetAccountName());
            formatter.AppendLine(GetProcessId());
            formatter.AppendLine(GetProcessName());
            formatter.IndentationLevel -= 1;
            formatter.AppendLine(eventInfo.ToString());
        }
Beispiel #12
0
        //Formats Web request event information.
        public override void FormatCustomEventDetails(
            WebEventFormatter formatter)
        {
            // Add custom data.
            formatter.AppendLine("");

            formatter.IndentationLevel += 1;
            formatter.AppendLine("* Custom Request Information Start *");

            // Display custom event timing.
            formatter.AppendLine(customCreatedMsg);
            formatter.AppendLine(customRaisedMsg);

            formatter.AppendLine("* Custom Request Information End *");

            formatter.IndentationLevel -= 1;
        }
Beispiel #13
0
        //Formats Web request event information.
        public override void FormatCustomEventDetails(
            WebEventFormatter formatter)
        {
            base.FormatCustomEventDetails(formatter);

            // Add custom data.
            formatter.AppendLine("");

            formatter.IndentationLevel += 1;
            formatter.AppendLine(
                "** SampleWebRequestEvent Start **");

            // Add custom data.
            formatter.AppendLine(eventInfo.ToString());

            formatter.AppendLine(
                "** SampleWebRequestEvent End **");
        }
        // </Snippet8>
        // <Snippet9>
        //Formats Web request event information.
        public override void FormatCustomEventDetails(
            WebEventFormatter formatter)
        {
            base.FormatCustomEventDetails(formatter);

            // Add custom data.
            formatter.AppendLine("");
            formatter.AppendLine(
                "Custom Application Information:");
            formatter.IndentationLevel += 1;

            // Display the application information.
            formatter.AppendLine(GetApplicationDomain());
            formatter.AppendLine(GetApplicationPath());
            formatter.AppendLine(GetApplicationVirtualPath());
            formatter.AppendLine(GetApplicationMachineName());
            formatter.AppendLine(GetApplicationTrustLevel());
            formatter.IndentationLevel -= 1;
            formatter.AppendLine(eventInfo.ToString());
        }
        // </Snippet7>

        // <Snippet8>

        // Formats Web request event information.
        public override void FormatCustomEventDetails(
            WebEventFormatter formatter)
        {
            // Add custom data.

            formatter.AppendLine("");
            formatter.AppendLine(
                "Custom Thread Information:");

            formatter.IndentationLevel += 1;

            // Display the thread information obtained
            formatter.AppendLine(GetThreadImpersonation());
            formatter.AppendLine(GetThreadStackTrace());
            formatter.AppendLine(GetThreadAccountName());
            formatter.AppendLine(GetThreadId());
            formatter.IndentationLevel -= 1;

            formatter.AppendLine(eventInfo.ToString());
        }
        /// <summary>
        /// Raises the UploadRequestErrorEvent.
        /// </summary>
        //public override void Raise()
        //{
        //    base.Raise();
        //}
        /// <summary>
        /// Formats Web request event information.
        /// </summary>
        /// <param name="formatter"></param>
        public override void FormatCustomEventDetails(WebEventFormatter formatter)
        {
            base.FormatCustomEventDetails(formatter);

            // Add event details
            if (_EventSource != null)
            {
                try
                {
                    formatter.AppendLine(String.Empty);
                    //formatter.IndentationLevel += 1;
                    //formatter.TabSize = 4;
                    formatter.AppendLine(_EventSource.ToString());
                }
                catch (Exception Ex)
                {
                    formatter.AppendLine(Ex.ToString());
                }
            }
        }
        // Formats Web request event information.
        public override void FormatCustomEventDetails(
            WebEventFormatter formatter)
        {
            // Add custom data.

            formatter.AppendLine("");
            formatter.AppendLine(
                "Custom Request Information:");

            formatter.IndentationLevel += 1;

            // Display the request information obtained
            // using the WebRequestInformation object.
            formatter.AppendLine(GetRequestPath());
            formatter.AppendLine(GetRequestUrl());
            formatter.AppendLine(GetRequestUserHostAdddress());
            formatter.AppendLine(GetRequestPrincipal());

            formatter.IndentationLevel -= 1;

            formatter.AppendLine(eventInfo.ToString());
        }
        public override void FormatCustomEventDetails(WebEventFormatter formatter)
        {
            base.FormatCustomEventDetails(formatter);

            formatter.AppendLine("");

            formatter.IndentationLevel += 1;
            formatter.AppendLine(
                "* mojoWebAuthenticationSuccessAuditEvent Start *");
            formatter.AppendLine(string.Format("Request path: {0}",
                                               RequestInformation.RequestPath));
            formatter.AppendLine(string.Format("Request Url: {0}",
                                               RequestInformation.RequestUrl));

            formatter.AppendLine(customCreatedMsg);
            formatter.AppendLine(customRaisedMsg);

            formatter.AppendLine(
                "* mojoWebAuthenticationSuccessAuditEvent End *");

            formatter.IndentationLevel -= 1;
        }
        //Formats Web request event information.
        public override void FormatCustomEventDetails(
            WebEventFormatter formatter)
        {
            base.FormatCustomEventDetails(formatter);

            // Add custom data.
            formatter.AppendLine("");

            formatter.IndentationLevel += 1;

            formatter.TabSize = 4;

            formatter.AppendLine(
                "*SampleWebApplicationLifetimeEvent Start *");
            formatter.AppendLine("Custom information goes here");
            formatter.AppendLine(
                "* SampleWebApplicationLifetimeEvent End *");
            // Display custom event timing.
            formatter.AppendLine(customCreatedMsg);
            formatter.AppendLine(customRaisedMsg);

            formatter.IndentationLevel -= 1;
        }
Beispiel #20
0
        // </Snippet2>

        // Display the events contained in the collection.
        public override void FormatCustomEventDetails(WebEventFormatter formatter)
        {
            base.FormatCustomEventDetails(formatter);
            // Add custom data.
            formatter.AppendLine("");

            formatter.IndentationLevel += 1;
            formatter.AppendLine(
                "**SampleWebBaseEventCollection Data Start **");
            foreach (WebBaseEvent ev in events)
            {
                formatter.AppendLine(string.Format(
                                         "Message:   {0}", ev.Message));
                formatter.AppendLine(string.Format(
                                         "Source:    {0}", ev.EventSource.ToString()));
                formatter.AppendLine(string.Format(
                                         "Code:      {0}", ev.EventCode.ToString()));
            }

            formatter.AppendLine(
                "**SampleWebBaseEventCollection Data End **");

            formatter.IndentationLevel -= 1;
        }
Beispiel #21
0
        // </Snippet5>


        // <Snippet6>
        //Formats Web request event information.
        //This method is invoked indirectly by the provider using one of the
        //overloaded ToString methods.
        public override void FormatCustomEventDetails(WebEventFormatter formatter)
        {
            base.FormatCustomEventDetails(formatter);

            // Add custom data.
            formatter.AppendLine("");

            formatter.IndentationLevel += 1;
            formatter.AppendLine(
                "** SampleWebBaseErrrorEvent Information Start **");
            formatter.AppendLine(string.Format(
                                     "Error message:      {0}", ErrorException.Message));
            formatter.AppendLine(string.Format(
                                     "Error source:       {0}", ErrorException.Source));

            // Display custom event timing.
            formatter.AppendLine(customCreatedMsg);
            formatter.AppendLine(customRaisedMsg);

            formatter.AppendLine(
                "** SampleWebBaseErrrorEvent Information End **");

            formatter.IndentationLevel -= 1;
        }
        protected virtual void FormatToString(WebEventFormatter formatter, bool includeAppInfo)
        {
            formatter.AppendLine(FormatResourceStringWithCache("Webevent_event_code", this.EventCode.ToString(CultureInfo.InstalledUICulture)));
            formatter.AppendLine(FormatResourceStringWithCache("Webevent_event_message", this.Message));
            formatter.AppendLine(FormatResourceStringWithCache("Webevent_event_time", this.EventTime.ToString(CultureInfo.InstalledUICulture)));
            formatter.AppendLine(FormatResourceStringWithCache("Webevent_event_time_Utc", this.EventTimeUtc.ToString(CultureInfo.InstalledUICulture)));
            formatter.AppendLine(FormatResourceStringWithCache("Webevent_event_id", this.EventID.ToString("N", CultureInfo.InstalledUICulture)));
            formatter.AppendLine(FormatResourceStringWithCache("Webevent_event_sequence", this.EventSequence.ToString(CultureInfo.InstalledUICulture)));
            #if MONO

            #else
            //formatter.AppendLine(FormatResourceStringWithCache("Webevent_event_occurrence", this.EventOccurrence.ToString(CultureInfo.InstalledUICulture)));
            #endif
            formatter.AppendLine(FormatResourceStringWithCache("Webevent_event_detail_code", this.EventDetailCode.ToString(CultureInfo.InstalledUICulture)));
            if (includeAppInfo)
            {
                formatter.AppendLine(string.Empty);
                formatter.AppendLine(FormatResourceStringWithCache("Webevent_event_application_information"));
                formatter.IndentationLevel++;
                ApplicationInformation.FormatToString(formatter);
                formatter.IndentationLevel--;
            }
        }
Beispiel #23
0
 public override void FormatCustomEventDetails(WebEventFormatter formatter)
 {
     base.FormatCustomEventDetails(formatter);
     formatter.AppendLine(this.customMessage);
 }
 public void FormatToString(WebEventFormatter formatter)
 {
     string name;
     string authenticationType;
     bool isAuthenticated;
     if (this.Principal == null)
     {
         name = string.Empty;
         authenticationType = string.Empty;
         isAuthenticated = false;
     }
     else
     {
         IIdentity identity = this.Principal.Identity;
         name = identity.Name;
         isAuthenticated = identity.IsAuthenticated;
         authenticationType = identity.AuthenticationType;
     }
     formatter.AppendLine(WebBaseEventWrapper.FormatResourceStringWithCache("Webevent_event_request_url", this.RequestUrl));
     formatter.AppendLine(WebBaseEventWrapper.FormatResourceStringWithCache("Webevent_event_request_path", this.RequestPath));
     formatter.AppendLine(WebBaseEventWrapper.FormatResourceStringWithCache("Webevent_event_user_host_address", this.UserHostAddress));
     formatter.AppendLine(WebBaseEventWrapper.FormatResourceStringWithCache("Webevent_event_user", name));
     if (isAuthenticated)
     {
         formatter.AppendLine(WebBaseEventWrapper.FormatResourceStringWithCache("Webevent_event_is_authenticated"));
     }
     else
     {
         formatter.AppendLine(WebBaseEventWrapper.FormatResourceStringWithCache("Webevent_event_is_not_authenticated"));
     }
     formatter.AppendLine(WebBaseEventWrapper.FormatResourceStringWithCache("Webevent_event_authentication_type", authenticationType));
     formatter.AppendLine(WebBaseEventWrapper.FormatResourceStringWithCache("Webevent_event_thread_account_name", this.ThreadAccountName));
 }
Beispiel #25
0
 public virtual void FormatCustomEventDetails(WebEventFormatter formatter)
 {
 }
 public void FormatToString(WebEventFormatter formatter)
 {
     formatter.AppendLine(WebBaseEventWrapper.FormatResourceStringWithCache("Webevent_event_thread_id", this.ThreadID.ToString(CultureInfo.InstalledUICulture)));
     formatter.AppendLine(WebBaseEventWrapper.FormatResourceStringWithCache("Webevent_event_thread_account_name", this.ThreadAccountName));
     if (this.IsImpersonating)
     {
         formatter.AppendLine(WebBaseEventWrapper.FormatResourceStringWithCache("Webevent_event_is_impersonating"));
     }
     else
     {
         formatter.AppendLine(WebBaseEventWrapper.FormatResourceStringWithCache("Webevent_event_is_not_impersonating"));
     }
     formatter.AppendLine(WebBaseEventWrapper.FormatResourceStringWithCache("Webevent_event_stack_trace", this.StackTrace));
 }
 public override string ToString(bool includeAppInfo, bool includeCustomEventDetails)
 {
     WebEventFormatter formatter = new WebEventFormatter();
     this.FormatToString(formatter, includeAppInfo);
     if (!this.IsSystemEvent && includeCustomEventDetails)
     {
         formatter.AppendLine(string.Empty);
         formatter.AppendLine(SR.GetString("Webevent_event_custom_event_details"));
         formatter.IndentationLevel++;
         this.FormatCustomEventDetails(formatter);
         formatter.IndentationLevel--;
     }
     return formatter.ToString();
 }
Beispiel #28
0
 // Methods
 public void FormatToString(WebEventFormatter formatter)
 {
 }
 public virtual void FormatCustomEventDetails(WebEventFormatter formatter)
 {
 }
Beispiel #30
0
 public override void FormatCustomEventDetails(WebEventFormatter formatter)
 {
     formatter.AppendLine(_sb.ToString());
     base.FormatCustomEventDetails(formatter);
 }
Beispiel #31
0
 /// <summary>
 /// Add additional meta data to the log.
 /// </summary>
 /// <param name="formatter">The web formatter object.  This is used to add additional info to the log.</param>
 public override void FormatCustomEventDetails(WebEventFormatter formatter)
 {
     base.FormatCustomEventDetails(formatter);
 }
 protected override void FormatToString(WebEventFormatter formatter, bool includeAppInfo)
 {
     base.FormatToString(formatter, includeAppInfo);
     formatter.AppendLine(string.Empty);
     formatter.AppendLine(WebBaseEventWrapper.FormatResourceStringWithCache("Webevent_event_request_information"));
     formatter.IndentationLevel++;
     this.RequestInformation.FormatToString(formatter);
     formatter.IndentationLevel--;
     formatter.AppendLine(string.Empty);
     formatter.AppendLine(WebBaseEventWrapper.FormatResourceStringWithCache("Webevent_event_thread_information"));
     formatter.IndentationLevel++;
     this.ThreadInformation.FormatToString(formatter);
     formatter.IndentationLevel--;
 }
 // Methods
 public void FormatToString(WebEventFormatter formatter)
 {
 }