亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? xmllayoutschemalog4j.cs

?? 詳細(xì)講述了數(shù)據(jù)庫編程
?? CS
字號(hào):
#region Copyright & License
//
// Copyright 2001-2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#endregion

using System;
using System.Text;
using System.Xml;
using System.IO;

using log4net.Core;
using log4net.Util;

namespace log4net.Layout
{
	/// <summary>
	/// Layout that formats the log events as XML elements compatible with the log4j schema
	/// </summary>
	/// <remarks>
	/// <para>
	/// Formats the log events according to the http://logging.apache.org/log4j schema.
	/// </para>
	/// </remarks>
	/// <author>Nicko Cadell</author>
	public class XmlLayoutSchemaLog4j : XmlLayoutBase
	{
		#region Static Members

		/// <summary>
		/// The 1st of January 1970 in UTC
		/// </summary>
		private static readonly DateTime s_date1970 = new DateTime(1970, 1, 1);

		#endregion

		#region Constructors

		/// <summary>
		/// Constructs an XMLLayoutSchemaLog4j
		/// </summary>
		public XmlLayoutSchemaLog4j() : base()
		{
		}

		/// <summary>
		/// Constructs an XMLLayoutSchemaLog4j.
		/// </summary>
		/// <remarks>
		/// <para>
		/// The <b>LocationInfo</b> option takes a boolean value. By
		/// default, it is set to false which means there will be no location
		/// information output by this layout. If the the option is set to
		/// true, then the file name and line number of the statement
		/// at the origin of the log statement will be output. 
		/// </para>
		/// <para>
		/// If you are embedding this layout within an SMTPAppender
		/// then make sure to set the <b>LocationInfo</b> option of that 
		/// appender as well.
		/// </para>
		/// </remarks>
		public XmlLayoutSchemaLog4j(bool locationInfo) :  base(locationInfo)
		{
		}

		#endregion

		#region Public Properties

		/// <summary>
		/// The version of the log4j schema to use.
		/// </summary>
		/// <remarks>
		/// <para>
		/// Only version 1.2 of the log4j schema is supported.
		/// </para>
		/// </remarks>
		public string Version
		{
			get { return "1.2"; }
			set 
			{ 
				if (value != "1.2")
				{
					throw new ArgumentException("Only version 1.2 of the log4j schema is currently supported");
				}
			}
		}

		#endregion

		/* Example log4j schema event

<log4j:event logger="first logger" level="ERROR" thread="Thread-3" timestamp="1051494121460">
  <log4j:message><![CDATA[errormsg 3]]></log4j:message>
  <log4j:NDC><![CDATA[third]]></log4j:NDC>
  <log4j:MDC>
    <log4j:data name="some string" value="some valuethird"/>
  </log4j:MDC>
  <log4j:throwable><![CDATA[java.lang.Exception: someexception-third
 	at org.apache.log4j.chainsaw.Generator.run(Generator.java:94)
]]></log4j:throwable>
  <log4j:locationInfo class="org.apache.log4j.chainsaw.Generator"
method="run" file="Generator.java" line="94"/>
  <log4j:properties>
    <log4j:data name="log4jmachinename" value="windows"/>
    <log4j:data name="log4japp" value="udp-generator"/>
  </log4j:properties>
</log4j:event>

		*/

		/* Since log4j 1.3 the log4j:MDC has been combined into the log4j:properties element */

		/// <summary>
		/// Actually do the writing of the xml
		/// </summary>
		/// <param name="writer">the writer to use</param>
		/// <param name="loggingEvent">the event to write</param>
		/// <remarks>
		/// <para>
		/// Generate XML that is compatible with the log4j schema.
		/// </para>
		/// </remarks>
		override protected void FormatXml(XmlWriter writer, LoggingEvent loggingEvent)
		{
			// Translate logging events for log4j

			// Translate hostname property
			if (loggingEvent.LookupProperty(LoggingEvent.HostNameProperty) != null && 
				loggingEvent.LookupProperty("log4jmachinename") == null)
			{
				loggingEvent.GetProperties()["log4jmachinename"] = loggingEvent.LookupProperty(LoggingEvent.HostNameProperty);
			}

			// translate appdomain name
			if (loggingEvent.LookupProperty("log4japp") == null && 
				loggingEvent.Domain != null && 
				loggingEvent.Domain.Length > 0)
			{
				loggingEvent.GetProperties()["log4japp"] = loggingEvent.Domain;
			}

			// translate identity name
			if (loggingEvent.Identity != null && 
				loggingEvent.Identity.Length > 0 && 
				loggingEvent.LookupProperty(LoggingEvent.IdentityProperty) == null)
			{
				loggingEvent.GetProperties()[LoggingEvent.IdentityProperty] = loggingEvent.Identity;
			}

			// translate user name
			if (loggingEvent.UserName != null && 
				loggingEvent.UserName.Length > 0 && 
				loggingEvent.LookupProperty(LoggingEvent.UserNameProperty) == null)
			{
				loggingEvent.GetProperties()[LoggingEvent.UserNameProperty] = loggingEvent.UserName;
			}

			// Write the start element
			writer.WriteStartElement("log4j:event");
			writer.WriteAttributeString("logger", loggingEvent.LoggerName);

			// Calculate the timestamp as the number of milliseconds since january 1970
			// 
			// We must convert the TimeStamp to UTC before performing any mathematical
			// operations. This allows use to take into account discontinuities
			// caused by daylight savings time transitions.
			TimeSpan timeSince1970 = loggingEvent.TimeStamp.ToUniversalTime() - s_date1970;

			writer.WriteAttributeString("timestamp", XmlConvert.ToString((long)timeSince1970.TotalMilliseconds));
			writer.WriteAttributeString("level", loggingEvent.Level.DisplayName);
			writer.WriteAttributeString("thread", loggingEvent.ThreadName);
    
			// Append the message text
			writer.WriteStartElement("log4j:message");
			Transform.WriteEscapedXmlString(writer, loggingEvent.RenderedMessage,this.InvalidCharReplacement);
			writer.WriteEndElement();

			object ndcObj = loggingEvent.LookupProperty("NDC");
			if (ndcObj != null)
			{
				string valueStr = loggingEvent.Repository.RendererMap.FindAndRender(ndcObj);

				if (valueStr != null && valueStr.Length > 0)
				{
					// Append the NDC text
					writer.WriteStartElement("log4j:NDC");
					Transform.WriteEscapedXmlString(writer, valueStr,this.InvalidCharReplacement);
					writer.WriteEndElement();
				}
			}

			// Append the properties text
			PropertiesDictionary properties = loggingEvent.GetProperties();
			if (properties.Count > 0)
			{
				writer.WriteStartElement("log4j:properties");
				foreach(System.Collections.DictionaryEntry entry in properties)
				{
					writer.WriteStartElement("log4j:data");
					writer.WriteAttributeString("name", (string)entry.Key);

					// Use an ObjectRenderer to convert the object to a string
					string valueStr = loggingEvent.Repository.RendererMap.FindAndRender(entry.Value);
					writer.WriteAttributeString("value", valueStr);

					writer.WriteEndElement();
				}
				writer.WriteEndElement();
			}

			string exceptionStr = loggingEvent.GetExceptionString();
			if (exceptionStr != null && exceptionStr.Length > 0)
			{
				// Append the stack trace line
				writer.WriteStartElement("log4j:throwable");
				Transform.WriteEscapedXmlString(writer, exceptionStr,this.InvalidCharReplacement);
				writer.WriteEndElement();
			}

			if (LocationInfo)
			{ 
				LocationInfo locationInfo = loggingEvent.LocationInformation;

				writer.WriteStartElement("log4j:locationInfo");
				writer.WriteAttributeString("class", locationInfo.ClassName);
				writer.WriteAttributeString("method", locationInfo.MethodName);
				writer.WriteAttributeString("file", locationInfo.FileName);
				writer.WriteAttributeString("line", locationInfo.LineNumber);
				writer.WriteEndElement();
			}

			writer.WriteEndElement();
		}
	}
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲精品少妇30p| 九一九一国产精品| 中文字幕一区二区在线观看| 久久综合色之久久综合| 欧美一级艳片视频免费观看| 欧美日韩精品系列| 欧美视频中文一区二区三区在线观看| k8久久久一区二区三区| 国产精品香蕉一区二区三区| 国产一区二区三区精品视频| 极品少妇一区二区三区精品视频 | 久久综合狠狠综合| 精品国产91乱码一区二区三区| 日韩限制级电影在线观看| 欧美一区二区精美| 欧美一区午夜精品| 精品乱人伦小说| 久久久不卡网国产精品一区| 国产日韩欧美在线一区| 国产日韩三级在线| 国产精品久久久久久久久久免费看| 欧美高清在线精品一区| 中文字幕亚洲区| 亚洲午夜久久久| 日韩av一级电影| 粉嫩绯色av一区二区在线观看| 不卡视频一二三| 在线精品视频免费播放| 欧美日韩激情在线| 欧美大度的电影原声| 国产午夜精品久久久久久久| 国产精品卡一卡二| 亚洲一区二区三区四区五区黄| 日韩精品一区第一页| 久久99日本精品| 成人黄色小视频在线观看| 在线观看欧美精品| 日韩精品一区二区三区视频播放 | 欧美精品日韩综合在线| 日韩欧美不卡在线观看视频| 久久综合色天天久久综合图片| 综合久久给合久久狠狠狠97色 | 91免费精品国自产拍在线不卡| 色先锋久久av资源部| 欧美一区三区二区| 久久九九全国免费| 亚洲综合色噜噜狠狠| 久久精品国产精品亚洲综合| 波多野结衣中文一区| 欧美三级韩国三级日本一级| 欧美精品一区二区久久婷婷| 亚洲天堂网中文字| 美国毛片一区二区| 色综合欧美在线视频区| 精品国精品自拍自在线| 亚洲精品欧美在线| 国产一区二区不卡在线 | 亚洲精品日日夜夜| 久久国产尿小便嘘嘘尿| 91色视频在线| 2019国产精品| 亚洲电影一区二区| 成人综合在线观看| 欧美一区二区视频在线观看2020| 国产精品久久三| 日韩av电影免费观看高清完整版 | 免费看日韩精品| 99精品国产热久久91蜜凸| 精品剧情v国产在线观看在线| 亚洲理论在线观看| 顶级嫩模精品视频在线看| 538prom精品视频线放| 自拍偷拍国产精品| 国产原创一区二区三区| 制服.丝袜.亚洲.中文.综合| 亚洲美女视频在线| 成人性生交大片免费看视频在线 | 99久久精品国产一区二区三区| 777色狠狠一区二区三区| 日韩久久一区二区| 国产成人精品一区二| 51精品视频一区二区三区| 亚洲免费在线视频| 国产成人精品www牛牛影视| 欧美一级久久久| 亚洲第一成人在线| 色美美综合视频| 中文字幕人成不卡一区| 国产成人免费视频 | 久久99精品一区二区三区 | 国产精品美女久久久久久久久久久| 欧美aaaaaa午夜精品| 欧美无人高清视频在线观看| 亚洲欧洲日韩av| 成人综合在线网站| 国产精品无遮挡| 成人手机电影网| 国产欧美精品一区二区三区四区| 韩国一区二区三区| 精品国免费一区二区三区| 久久激情综合网| 精品奇米国产一区二区三区| 人禽交欧美网站| 日韩三级高清在线| 久久精品国产精品青草| 日韩女优制服丝袜电影| 热久久一区二区| 精品日韩一区二区三区免费视频| 免费观看成人av| 欧美精品一区二区三区蜜桃| 久久激五月天综合精品| 久久新电视剧免费观看| 国产黄色成人av| 中文乱码免费一区二区| 成人黄色大片在线观看| 成人免费一区二区三区视频| 色婷婷av一区二区三区软件| 亚洲精品视频一区| 在线不卡中文字幕播放| 免费观看91视频大全| 久久在线观看免费| 高清不卡一区二区在线| 亚洲欧美日韩电影| 欧美日韩aaaaa| 久久精品国产**网站演员| 久久综合色8888| 99国产一区二区三精品乱码| 樱桃视频在线观看一区| 欧美男女性生活在线直播观看| 蜜桃免费网站一区二区三区| 久久噜噜亚洲综合| 97se亚洲国产综合自在线不卡| 一区二区国产视频| 日韩三级视频在线看| 国产成人精品亚洲午夜麻豆| 亚洲欧美日韩电影| 欧美日韩中文另类| 精品在线播放免费| 亚洲品质自拍视频网站| 欧美一区二区日韩| 成人夜色视频网站在线观看| 亚洲一区二区3| 精品美女在线播放| 色综合久久综合网欧美综合网| 亚洲va国产天堂va久久en| 久久久久久免费网| 色狠狠一区二区三区香蕉| 蜜桃视频一区二区三区在线观看| 国产精品拍天天在线| 欧美日本一区二区| 国产成人综合网站| 午夜一区二区三区在线观看| 久久这里只精品最新地址| 欧美影片第一页| 国产精品自拍毛片| 五月婷婷欧美视频| 国产欧美一区二区精品性 | 亚洲专区一二三| 亚洲精品一区二区精华| 色诱视频网站一区| 国产一区欧美日韩| 亚洲国产日产av| 中文成人av在线| 日韩精品中文字幕在线不卡尤物 | 欧美一区二区视频在线观看| 不卡的电影网站| 美国欧美日韩国产在线播放| 一区二区三区**美女毛片| 精品av久久707| 欧美高清性hdvideosex| 不卡一区在线观看| 精品一区二区三区视频| 亚洲一卡二卡三卡四卡五卡| 国产欧美日韩精品在线| 91麻豆精品国产无毒不卡在线观看| av网站一区二区三区| 久久精品久久精品| 五月婷婷激情综合网| 亚洲特黄一级片| 欧美国产一区视频在线观看| 欧美一区二区三区四区视频| 91丨九色porny丨蝌蚪| 国产成人午夜精品影院观看视频| 三级成人在线视频| 亚洲午夜一二三区视频| 亚洲天堂精品视频| 久久久久久久久久久99999| 日韩一级黄色片| 欧美日韩一级黄| 91黄色免费观看| 91麻豆免费看片| av在线播放不卡| 成人午夜电影久久影院| 国产在线精品免费| 看电影不卡的网站| 男女视频一区二区| 日韩电影在线一区二区| 五月天亚洲精品| 偷拍自拍另类欧美| 亚洲风情在线资源站|