Exemplo n.º 1
0
 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;
         }
     }
 }
Exemplo n.º 2
0
        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));
        }
Exemplo n.º 3
0
 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));
 }
Exemplo n.º 4
0
 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--;
 }
Exemplo n.º 5
0
 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));
 }