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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? xmllayout.cs

?? 詳細講述了數據庫編程
?? CS
字號:
#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 log4net.Core;
using log4net.Util;

namespace log4net.Layout
{
	/// <summary>
	/// Layout that formats the log events as XML elements.
	/// </summary>
	/// <remarks>
	/// <para>
	/// The output of the <see cref="XmlLayout" /> consists of a series of 
	/// log4net:event elements. It does not output a complete well-formed XML 
	/// file. The output is designed to be included as an <em>external entity</em>
	/// in a separate file to form a correct XML file.
	/// </para>
	/// <para>
	/// For example, if <c>abc</c> is the name of the file where
	/// the <see cref="XmlLayout" /> output goes, then a well-formed XML file would 
	/// be:
	/// </para>
	/// <code lang="XML">
	/// &lt;?xml version="1.0" ?&gt;
	/// 
	/// &lt;!DOCTYPE log4net:events SYSTEM "log4net-events.dtd" [&lt;!ENTITY data SYSTEM "abc"&gt;]&gt;
	///
	/// &lt;log4net:events version="1.2" xmlns:log4net="http://logging.apache.org/log4net/schemas/log4net-events-1.2&gt;
	///     &amp;data;
	/// &lt;/log4net:events&gt;
	/// </code>
	/// <para>
	/// This approach enforces the independence of the <see cref="XmlLayout" /> 
	/// and the appender where it is embedded.
	/// </para>
	/// <para>
	/// The <c>version</c> attribute helps components to correctly
	/// interpret output generated by <see cref="XmlLayout" />. The value of 
	/// this attribute should be "1.2" for release 1.2 and later.
	/// </para>
	/// <para>
	/// Alternatively the <c>Header</c> and <c>Footer</c> properties can be
	/// configured to output the correct XML header, open tag and close tag.
	/// When setting the <c>Header</c> and <c>Footer</c> properties it is essential
	/// that the underlying data store not be appendable otherwise the data
	/// will become invalid XML.
	/// </para>
	/// </remarks>
	/// <author>Nicko Cadell</author>
	/// <author>Gert Driesen</author>
	public class XmlLayout : XmlLayoutBase
	{
		#region Public Instance Constructors

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

		/// <summary>
		/// Constructs an XmlLayout.
		/// </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 XmlLayout(bool locationInfo) :  base(locationInfo)
		{
		}

		#endregion Public Instance Constructors

		#region Public Instance Properties

		/// <summary>
		/// The prefix to use for all element names
		/// </summary>
		/// <remarks>
		/// <para>
		/// The default prefix is <b>log4net</b>. Set this property
		/// to change the prefix. If the prefix is set to an empty string
		/// then no prefix will be written.
		/// </para>
		/// </remarks>
		public string Prefix
		{
			get { return m_prefix; }
			set { m_prefix = value; }
		}

		
		/// <summary>
		/// Set whether or not to base64 encode the message.
		/// </summary>
		/// <remarks>
		/// <para>
		/// By default the log message will be written as text to the xml
		/// output. This can cause problems when the message contains binary
		/// data. By setting this to true the contents of the message will be
		/// base64 encoded. If this is set then invalid character replacement
		/// (see <see cref="XmlLayoutBase.InvalidCharReplacement"/>) will not be performed
		/// on the log message.
		/// </para>
		/// </remarks>
		public bool Base64EncodeMessage
		{
			get {return m_base64Message;}
			set {m_base64Message=value;}
		}

		/// <summary>
		/// Set whether or not to base64 encode the property values.
		/// </summary>
		/// <remarks>
		/// <para>
		/// By default the properties will be written as text to the xml
		/// output. This can cause problems when one or more properties contain
		/// binary data. By setting this to true the values of the properties
		/// will be base64 encoded. If this is set then invalid character replacement
		/// (see <see cref="XmlLayoutBase.InvalidCharReplacement"/>) will not be performed
		/// on the property values.
		/// </para>
		/// </remarks>
		public bool Base64EncodeProperties
		{
			get {return m_base64Properties;}
			set {m_base64Properties=value;}
		}


		#endregion Public Instance Properties

		#region Implementation of IOptionHandler

		/// <summary>
		/// Initialize layout options
		/// </summary>
		/// <remarks>
		/// <para>
		/// This is part of the <see cref="IOptionHandler"/> delayed object
		/// activation scheme. The <see cref="ActivateOptions"/> method must 
		/// be called on this object after the configuration properties have
		/// been set. Until <see cref="ActivateOptions"/> is called this
		/// object is in an undefined state and must not be used. 
		/// </para>
		/// <para>
		/// If any of the configuration properties are modified then 
		/// <see cref="ActivateOptions"/> must be called again.
		/// </para>
		/// <para>
		/// Builds a cache of the element names
		/// </para>
		/// </remarks>
		override public void ActivateOptions() 
		{
			base.ActivateOptions();

			// Cache the full element names including the prefix
			if (m_prefix != null && m_prefix.Length > 0)
			{
				m_elmEvent = m_prefix + ":" + ELM_EVENT;
				m_elmMessage = m_prefix + ":" + ELM_MESSAGE;
				m_elmProperties = m_prefix + ":" + ELM_PROPERTIES;
				m_elmData = m_prefix + ":" + ELM_DATA;
				m_elmException = m_prefix + ":" + ELM_EXCEPTION;
				m_elmLocation = m_prefix + ":" + ELM_LOCATION;
			}
		}

		#endregion Implementation of IOptionHandler

		#region Override implementation of XMLLayoutBase

		/// <summary>
		/// Does the actual writing of the XML.
		/// </summary>
		/// <param name="writer">The writer to use to output the event to.</param>
		/// <param name="loggingEvent">The event to write.</param>
		/// <remarks>
		/// <para>
		/// Override the base class <see cref="XmlLayoutBase.FormatXml"/> method
		/// to write the <see cref="LoggingEvent"/> to the <see cref="XmlWriter"/>.
		/// </para>
		/// </remarks>
		override protected void FormatXml(XmlWriter writer, LoggingEvent loggingEvent)
		{
			writer.WriteStartElement(m_elmEvent);
			writer.WriteAttributeString(ATTR_LOGGER, loggingEvent.LoggerName);

#if NET_2_0 || MONO_2_0
			writer.WriteAttributeString(ATTR_TIMESTAMP, XmlConvert.ToString(loggingEvent.TimeStamp, XmlDateTimeSerializationMode.Local));
#else
			writer.WriteAttributeString(ATTR_TIMESTAMP, XmlConvert.ToString(loggingEvent.TimeStamp));
#endif

			writer.WriteAttributeString(ATTR_LEVEL, loggingEvent.Level.DisplayName);
			writer.WriteAttributeString(ATTR_THREAD, loggingEvent.ThreadName);

			if (loggingEvent.Domain != null && loggingEvent.Domain.Length > 0)
			{
				writer.WriteAttributeString(ATTR_DOMAIN, loggingEvent.Domain);
			}
			if (loggingEvent.Identity != null && loggingEvent.Identity.Length > 0)
			{
				writer.WriteAttributeString(ATTR_IDENTITY, loggingEvent.Identity);
			}
			if (loggingEvent.UserName != null && loggingEvent.UserName.Length > 0)
			{
				writer.WriteAttributeString(ATTR_USERNAME, loggingEvent.UserName);
			}
    
			// Append the message text
			writer.WriteStartElement(m_elmMessage);
			if (!this.Base64EncodeMessage)
			{
				Transform.WriteEscapedXmlString(writer, loggingEvent.RenderedMessage, this.InvalidCharReplacement);
			}
			else
			{
				byte[] messageBytes = Encoding.UTF8.GetBytes(loggingEvent.RenderedMessage);
				string base64Message = Convert.ToBase64String(messageBytes, 0, messageBytes.Length);
				Transform.WriteEscapedXmlString(writer, base64Message,this.InvalidCharReplacement);
			}
			writer.WriteEndElement();

			PropertiesDictionary properties = loggingEvent.GetProperties();

			// Append the properties text
			if (properties.Count > 0)
			{
				writer.WriteStartElement(m_elmProperties);
				foreach(System.Collections.DictionaryEntry entry in properties)
				{
					writer.WriteStartElement(m_elmData);
					writer.WriteAttributeString(ATTR_NAME, Transform.MaskXmlInvalidCharacters((string)entry.Key,this.InvalidCharReplacement));

					// Use an ObjectRenderer to convert the object to a string
					string valueStr =null;
					if (!this.Base64EncodeProperties)
					{
						valueStr = Transform.MaskXmlInvalidCharacters(loggingEvent.Repository.RendererMap.FindAndRender(entry.Value),this.InvalidCharReplacement);
					}
					else
					{
						byte[] propertyValueBytes = Encoding.UTF8.GetBytes(loggingEvent.Repository.RendererMap.FindAndRender(entry.Value));
						valueStr = Convert.ToBase64String(propertyValueBytes, 0, propertyValueBytes.Length);
					}
					writer.WriteAttributeString(ATTR_VALUE, valueStr);

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

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

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

				writer.WriteStartElement(m_elmLocation);
				writer.WriteAttributeString(ATTR_CLASS, locationInfo.ClassName);
				writer.WriteAttributeString(ATTR_METHOD, locationInfo.MethodName);
				writer.WriteAttributeString(ATTR_FILE, locationInfo.FileName);
				writer.WriteAttributeString(ATTR_LINE, locationInfo.LineNumber);
				writer.WriteEndElement();
			}

			writer.WriteEndElement();
		}

		#endregion Override implementation of XMLLayoutBase

		#region Private Instance Fields
  
		/// <summary>
		/// The prefix to use for all generated element names
		/// </summary>
		private string m_prefix = PREFIX;

		private string m_elmEvent = ELM_EVENT;
		private string m_elmMessage = ELM_MESSAGE;
		private string m_elmData = ELM_DATA;
		private string m_elmProperties = ELM_PROPERTIES;
		private string m_elmException = ELM_EXCEPTION;
		private string m_elmLocation = ELM_LOCATION;

		private bool m_base64Message=false;
		private bool m_base64Properties=false;

		#endregion Private Instance Fields

		#region Private Static Fields

		private const string PREFIX = "log4net";

		private const string ELM_EVENT = "event";
		private const string ELM_MESSAGE = "message";
		private const string ELM_PROPERTIES = "properties";
		private const string ELM_GLOBAL_PROPERTIES = "global-properties";
		private const string ELM_DATA = "data";
		private const string ELM_EXCEPTION = "exception";
		private const string ELM_LOCATION = "locationInfo";

		private const string ATTR_LOGGER = "logger";
		private const string ATTR_TIMESTAMP = "timestamp";
		private const string ATTR_LEVEL = "level";
		private const string ATTR_THREAD = "thread";
		private const string ATTR_DOMAIN = "domain";
		private const string ATTR_IDENTITY = "identity";
		private const string ATTR_USERNAME = "username";
		private const string ATTR_CLASS = "class";
		private const string ATTR_METHOD = "method";
		private const string ATTR_FILE = "file";
		private const string ATTR_LINE = "line";
		private const string ATTR_NAME = "name";
		private const string ATTR_VALUE = "value";


		#endregion Private Static Fields
	}
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美视频日韩视频| 国产精品国产成人国产三级| 亚洲第一搞黄网站| 欧美综合在线视频| 亚洲人快播电影网| 成人黄色大片在线观看| 亚洲视频你懂的| 欧美日本一道本| 国产一区二区三区免费看| www欧美成人18+| 国产黄色精品网站| 午夜久久久影院| 国产精品久久久99| 91精品国产综合久久福利软件| 国产精品资源网站| 夜夜精品浪潮av一区二区三区| 精品久久一区二区三区| 色婷婷av一区二区三区软件| 久久国产欧美日韩精品| 一区二区三区美女视频| 国产三级欧美三级日产三级99| 一本色道综合亚洲| 成人美女视频在线观看| 蜜桃免费网站一区二区三区| 亚洲永久免费av| 国产精品久久久久久久久搜平片| 日韩欧美在线123| 欧美人与z0zoxxxx视频| 欧美专区亚洲专区| 在线观看日韩一区| 在线视频亚洲一区| 91成人免费在线| 欧美亚一区二区| 欧洲精品中文字幕| 欧美亚洲另类激情小说| 欧美性感一类影片在线播放| 99精品在线观看视频| 色综合久久综合| 日本精品一级二级| 欧美高清www午色夜在线视频| 欧美中文字幕一区二区三区 | 国产欧美在线观看一区| 久久影院电视剧免费观看| 2024国产精品视频| 欧美激情在线观看视频免费| 亚洲三级电影全部在线观看高清| 日韩毛片视频在线看| 亚洲一级电影视频| 国产最新精品免费| 91老师国产黑色丝袜在线| 91精品国产综合久久久久久久久久 | 中文字幕的久久| 一区二区三区四区乱视频| 日韩精品亚洲一区二区三区免费| 日韩av成人高清| 91丨porny丨首页| 欧美一级在线观看| 亚洲日本va在线观看| 久久国产生活片100| 日本乱人伦aⅴ精品| 久久久精品国产免大香伊| 亚洲成人先锋电影| 大胆欧美人体老妇| 久久久天堂av| 天使萌一区二区三区免费观看| 国产69精品久久久久毛片| 中文字幕不卡三区| 亚洲图片欧美色图| 国产制服丝袜一区| 国产成人欧美日韩在线电影| 日本精品裸体写真集在线观看| 国产视频视频一区| 久久99精品久久久久久动态图| 日本精品免费观看高清观看| 国产精品久久久久久久久久久免费看| 免费精品99久久国产综合精品| 欧美性感一类影片在线播放| 亚洲丝袜自拍清纯另类| 色综合久久综合网| 亚洲美女免费在线| 欧美精品精品一区| 免费看黄色91| 国产日韩欧美精品在线| 丁香亚洲综合激情啪啪综合| 国产欧美精品一区二区色综合朱莉| 午夜欧美视频在线观看| 日韩精品一区二区三区在线播放 | 亚洲欧洲国产日韩| 97se亚洲国产综合在线| 午夜a成v人精品| 久久综合九色综合97婷婷| 国产成a人无v码亚洲福利| 国产精品久久久久久妇女6080 | 91视频国产观看| 视频在线观看一区| 日韩美女久久久| 日韩一区二区三免费高清| 不卡的av在线| 极品少妇一区二区| 亚洲国产视频在线| 国产精品热久久久久夜色精品三区 | 精品999久久久| 欧美日韩视频在线一区二区| 粉嫩久久99精品久久久久久夜| 亚洲视频1区2区| 欧美激情综合五月色丁香小说| 在线观看成人小视频| 国产一区二区免费在线| 婷婷久久综合九色国产成人| 亚洲男人的天堂av| 国产精品全国免费观看高清 | 一本久久综合亚洲鲁鲁五月天| 久久aⅴ国产欧美74aaa| 免费国产亚洲视频| 日韩中文字幕亚洲一区二区va在线 | 成人午夜私人影院| 粉嫩一区二区三区在线看| 国内精品久久久久影院一蜜桃| 日韩国产在线观看| 久久国产精品99久久久久久老狼| 亚洲成人一区在线| 婷婷综合在线观看| 久久国产精品99久久人人澡| 国产精品一区二区三区四区| 成人avav在线| 欧美日韩另类国产亚洲欧美一级| 欧美日韩精品三区| 久久久精品欧美丰满| 一区二区中文视频| 午夜欧美在线一二页| 六月丁香婷婷久久| 99re亚洲国产精品| 欧美色涩在线第一页| 2021中文字幕一区亚洲| 国产精品国产精品国产专区不片 | 日本欧美大码aⅴ在线播放| 激情图区综合网| 欧美日韩免费视频| 国产日韩亚洲欧美综合| 亚欧色一区w666天堂| 国产一区二区成人久久免费影院| youjizz国产精品| 日韩精品一区国产麻豆| 亚洲综合视频在线| 丁香六月综合激情| 久久综合色天天久久综合图片| 亚洲精品一卡二卡| 丁香亚洲综合激情啪啪综合| 91精品国产免费| 午夜精品久久久久| 色美美综合视频| 亚洲激情校园春色| 成人一级黄色片| 中文字幕欧美国产| 精品无人码麻豆乱码1区2区| 欧美一区二区三区日韩视频| 一卡二卡三卡日韩欧美| 一本一道久久a久久精品| 国产精品欧美一区喷水| 国产成人免费9x9x人网站视频| 精品久久久久一区| 国产一区二区在线影院| 中文字幕精品三区| 99国产精品国产精品毛片| 亚洲乱码中文字幕| 欧美视频三区在线播放| 奇米在线7777在线精品| 欧美成人精品二区三区99精品| 久久er99精品| 日本一区二区三级电影在线观看 | 国产精品免费视频网站| 91蝌蚪porny九色| 亚洲亚洲人成综合网络| 欧美精品一区二区三| 成人美女视频在线看| 日韩国产精品91| 欧美激情一区二区三区在线| 欧美三级中文字幕| 精品一区二区三区免费视频| 成人欧美一区二区三区黑人麻豆| 在线视频欧美精品| 国产精品影视网| 亚洲综合一区在线| 26uuu另类欧美| 欧美午夜寂寞影院| 成人小视频免费观看| 极品少妇xxxx偷拍精品少妇| 亚洲精品视频一区二区| 久久日韩粉嫩一区二区三区 | 欧美在线观看禁18| 成人在线一区二区三区| 国产麻豆一精品一av一免费 | 日韩欧美美女一区二区三区| 在线观看成人免费视频| av在线不卡免费看| 国产精品12区| 成人国产免费视频| 成人午夜激情视频| 波多野结衣精品在线| www.亚洲在线|