示例#1
0
 public void Render(ILogEvent logEvent, XElement message)
 {
     message.Add(new XElement("identity",
                              new XAttribute("name", logEvent.TryGet(KEY_IDENTITY_NAME, null)),
                              new XAttribute("authenticated", logEvent.TryGet(KEY_IDENTITY_AUTHENTICATED, null)),
                              new XAttribute("type", logEvent.TryGet(KEY_IDENTITY_TYPE, null))
                              ));
 }
示例#2
0
        public void Render(ILogEvent logEvent, XElement message)
        {
            var requestElement = message.Element("request");

            if (requestElement == null)
            {
                requestElement = new XElement("request");
            }
            requestElement.SetAttributeValue("id", logEvent.TryGet(KEY_REQUEST_ID, null));
            requestElement.SetAttributeValue("ip", logEvent.TryGet(KEY_REQUEST_IP, null));
            requestElement.SetAttributeValue("method", logEvent.TryGet(KEY_REQUEST_METHOD, null));
            requestElement.SetAttributeValue("url", logEvent.TryGet(KEY_REQUEST_URL, null));
            requestElement.SetAttributeValue("referrer", logEvent.TryGet(KEY_REQUEST_REFERRER, null));

            if (logEvent.IsSet(KEY_REQUEST_AGENT))
            {
                var agentElement = requestElement.Element("agent");
                if (agentElement == null)
                {
                    agentElement = new XElement("agent");
                    requestElement.Add(agentElement);
                }
                agentElement.SetValue(logEvent.Get(KEY_REQUEST_AGENT));
            }

            if (logEvent.IsSet(KEY_REQUEST_COOKIES))
            {
                var cookiesElement = requestElement.Element("cookies");
                if (cookiesElement == null)
                {
                    cookiesElement = new XElement("cookies");
                    requestElement.Add(cookiesElement);
                }
                cookiesElement.SetValue(logEvent.Get(KEY_REQUEST_COOKIES));
            }

            if (logEvent.IsSet(KEY_REQUEST_POST))
            {
                var postElement = requestElement.Element("post");
                if (postElement == null)
                {
                    postElement = new XElement("post");
                    requestElement.Add(postElement);
                }
                postElement.SetValue(logEvent.Get(KEY_REQUEST_POST));
            }

            if (requestElement.Parent == null && (!requestElement.IsEmpty || requestElement.Attributes().Any()))
            {
                message.Add(requestElement);
            }
        }
示例#3
0
 public void Render(ILogEvent logEvent, XElement Run)
 {
     Run.Add(new XAttribute("runId", logEvent.TryGet(KEY_RUN_ID, "")));
 }
 public void Render(ILogEvent logEvent, XElement Run)
 {
     Run.Add(new XAttribute("runId", logEvent.TryGet(KEY_RUN_ID, "")));
 }
示例#5
0
 public void Render(ILogEvent logEvent, XElement message)
 {
     message.Add(new XAttribute("id", logEvent.TryGet(KEY_MESSAGE_ID, "")));
 }
        public void Render(ILogEvent logEvent, XElement message)
        {
            var requestElement = message.Element("request");
            if (requestElement == null)
            {
                requestElement = new XElement("request");
            }
            requestElement.SetAttributeValue("id", logEvent.TryGet(KEY_REQUEST_ID, null));
            requestElement.SetAttributeValue("ip", logEvent.TryGet(KEY_REQUEST_IP, null));
            requestElement.SetAttributeValue("method", logEvent.TryGet(KEY_REQUEST_METHOD, null));
            requestElement.SetAttributeValue("url", logEvent.TryGet(KEY_REQUEST_URL, null));
            requestElement.SetAttributeValue("referrer", logEvent.TryGet(KEY_REQUEST_REFERRER, null));

            if (logEvent.IsSet(KEY_REQUEST_AGENT))
            {
                var agentElement = requestElement.Element("agent");
                if (agentElement == null)
                {
                    agentElement = new XElement("agent");
                    requestElement.Add(agentElement);
                }
                agentElement.SetValue(logEvent.Get(KEY_REQUEST_AGENT));
            }

            if (logEvent.IsSet(KEY_REQUEST_COOKIES))
            {
                var cookiesElement = requestElement.Element("cookies");
                if (cookiesElement == null)
                {
                    cookiesElement = new XElement("cookies");
                    requestElement.Add(cookiesElement);
                }
                cookiesElement.SetValue(logEvent.Get(KEY_REQUEST_COOKIES));
            }

            if (logEvent.IsSet(KEY_REQUEST_POST))
            {
                var postElement = requestElement.Element("post");
                if (postElement == null)
                {
                    postElement = new XElement("post");
                    requestElement.Add(postElement);
                }
                postElement.SetValue(logEvent.Get(KEY_REQUEST_POST));
            }

            if (requestElement.Parent == null && (!requestElement.IsEmpty || requestElement.Attributes().Any()))
            {
                message.Add(requestElement);
            }
        }
 public void Render(ILogEvent logEvent, XElement message)
 {
     message.Add(new XAttribute("id", logEvent.TryGet(KEY_MESSAGE_ID, "")));
 }