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

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

?? appenderskeleton.cs

?? 詳細講述了數據庫編程
?? CS
?? 第 1 頁 / 共 2 頁
字號:
#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.IO;
using System.Collections;

using log4net.Filter;
using log4net.Util;
using log4net.Layout;
using log4net.Core;

namespace log4net.Appender
{
	/// <summary>
	/// Abstract base class implementation of <see cref="IAppender"/>. 
	/// </summary>
	/// <remarks>
	/// <para>
	/// This class provides the code for common functionality, such 
	/// as support for threshold filtering and support for general filters.
	/// </para>
	/// <para>
	/// Appenders can also implement the <see cref="IOptionHandler"/> interface. Therefore
	/// they would require that the <see cref="IOptionHandler.ActivateOptions()"/> method
	/// be called after the appenders properties have been configured.
	/// </para>
	/// </remarks>
	/// <author>Nicko Cadell</author>
	/// <author>Gert Driesen</author>
	public abstract class AppenderSkeleton : IAppender, IBulkAppender, IOptionHandler
	{
		#region Protected Instance Constructors

		/// <summary>
		/// Default constructor
		/// </summary>
		/// <remarks>
		/// <para>Empty default constructor</para>
		/// </remarks>
		protected AppenderSkeleton()
		{
			m_errorHandler = new OnlyOnceErrorHandler(this.GetType().Name);
		}

		#endregion Protected Instance Constructors

		#region Finalizer

		/// <summary>
		/// Finalizes this appender by calling the implementation's 
		/// <see cref="Close"/> method.
		/// </summary>
		/// <remarks>
		/// <para>
		/// If this appender has not been closed then the <c>Finalize</c> method
		/// will call <see cref="Close"/>.
		/// </para>
		/// </remarks>
		~AppenderSkeleton() 
		{
			// An appender might be closed then garbage collected. 
			// There is no point in closing twice.
			if (!m_closed) 
			{
				LogLog.Debug("AppenderSkeleton: Finalizing appender named ["+m_name+"].");
				Close();
			}
		}

		#endregion Finalizer

		#region Public Instance Properties

		/// <summary>
		/// Gets or sets the threshold <see cref="Level"/> of this appender.
		/// </summary>
		/// <value>
		/// The threshold <see cref="Level"/> of the appender. 
		/// </value>
		/// <remarks>
		/// <para>
		/// All log events with lower level than the threshold level are ignored 
		/// by the appender.
		/// </para>
		/// <para>
		/// In configuration files this option is specified by setting the
		/// value of the <see cref="Threshold"/> option to a level
		/// string, such as "DEBUG", "INFO" and so on.
		/// </para>
		/// </remarks>
		public Level Threshold 
		{
			get { return m_threshold; }
			set { m_threshold = value; }
		}

		/// <summary>
		/// Gets or sets the <see cref="IErrorHandler"/> for this appender.
		/// </summary>
		/// <value>The <see cref="IErrorHandler"/> of the appender</value>
		/// <remarks>
		/// <para>
		/// The <see cref="AppenderSkeleton"/> provides a default 
		/// implementation for the <see cref="ErrorHandler"/> property. 
		/// </para>
		/// </remarks>
		virtual public IErrorHandler ErrorHandler 
		{
			get { return this.m_errorHandler; }
			set 
			{
				lock(this) 
				{
					if (value == null) 
					{
						// We do not throw exception here since the cause is probably a
						// bad config file.
						LogLog.Warn("AppenderSkeleton: You have tried to set a null error-handler.");
					} 
					else 
					{
						m_errorHandler = value;
					}
				}
			}
		}

		/// <summary>
		/// The filter chain.
		/// </summary>
		/// <value>The head of the filter chain filter chain.</value>
		/// <remarks>
		/// <para>
		/// Returns the head Filter. The Filters are organized in a linked list
		/// and so all Filters on this Appender are available through the result.
		/// </para>
		/// </remarks>
		virtual public IFilter FilterHead
		{
			get { return m_headFilter; }
		}

		/// <summary>
		/// Gets or sets the <see cref="ILayout"/> for this appender.
		/// </summary>
		/// <value>The layout of the appender.</value>
		/// <remarks>
		/// <para>
		/// See <see cref="RequiresLayout"/> for more information.
		/// </para>
		/// </remarks>
		/// <seealso cref="RequiresLayout"/>
		virtual public ILayout Layout 
		{
			get { return m_layout; }
			set { m_layout = value; }
		}

		#endregion

		#region Implementation of IOptionHandler

		/// <summary>
		/// Initialize the appender based on the options set
		/// </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>
		/// </remarks>
		virtual public void ActivateOptions() 
		{
		}

		#endregion Implementation of IOptionHandler

		#region Implementation of IAppender

		/// <summary>
		/// Gets or sets the name of this appender.
		/// </summary>
		/// <value>The name of the appender.</value>
		/// <remarks>
		/// <para>
		/// The name uniquely identifies the appender.
		/// </para>
		/// </remarks>
		public string Name 
		{
			get { return m_name; }
			set { m_name = value; }
		}

		/// <summary>
		/// Closes the appender and release resources.
		/// </summary>
		/// <remarks>
		/// <para>
		/// Release any resources allocated within the appender such as file handles, 
		/// network connections, etc.
		/// </para>
		/// <para>
		/// It is a programming error to append to a closed appender.
		/// </para>
		/// <para>
		/// This method cannot be overridden by subclasses. This method 
		/// delegates the closing of the appender to the <see cref="OnClose"/>
		/// method which must be overridden in the subclass.
		/// </para>
		/// </remarks>
		public void Close()
		{
			// This lock prevents the appender being closed while it is still appending
			lock(this)
			{
				if (!m_closed)
				{
					OnClose();
					m_closed = true;
				}
			}
		}

		/// <summary>
		/// Performs threshold checks and invokes filters before 
		/// delegating actual logging to the subclasses specific 
		/// <see cref="Append(LoggingEvent)"/> method.
		/// </summary>
		/// <param name="loggingEvent">The event to log.</param>
		/// <remarks>
		/// <para>
		/// This method cannot be overridden by derived classes. A
		/// derived class should override the <see cref="Append(LoggingEvent)"/> method
		/// which is called by this method.
		/// </para>
		/// <para>
		/// The implementation of this method is as follows:
		/// </para>
		/// <para>
		/// <list type="bullet">
		///		<item>
		///			<description>
		///			Checks that the severity of the <paramref name="loggingEvent"/>
		///			is greater than or equal to the <see cref="Threshold"/> of this
		///			appender.</description>
		///		</item>
		///		<item>
		///			<description>
		///			Checks that the <see cref="IFilter"/> chain accepts the 
		///			<paramref name="loggingEvent"/>.
		///			</description>
		///		</item>
		///		<item>
		///			<description>
		///			Calls <see cref="PreAppendCheck()"/> and checks that 
		///			it returns <c>true</c>.</description>
		///		</item>
		/// </list>
		/// </para>
		/// <para>
		/// If all of the above steps succeed then the <paramref name="loggingEvent"/>
		/// will be passed to the abstract <see cref="Append(LoggingEvent)"/> method.
		/// </para>
		/// </remarks>
		public void DoAppend(LoggingEvent loggingEvent) 
		{
			// This lock is absolutely critical for correct formatting
			// of the message in a multi-threaded environment.  Without
			// this, the message may be broken up into elements from
			// multiple thread contexts (like get the wrong thread ID).

			lock(this)
			{
				if (m_closed)
				{
					ErrorHandler.Error("Attempted to append to closed appender named ["+m_name+"].");
					return;
				}

				// prevent re-entry
				if (m_recursiveGuard)
				{
					return;
				}

				try
				{
					m_recursiveGuard = true;

					if (FilterEvent(loggingEvent) && PreAppendCheck())
					{
						this.Append(loggingEvent);
					}
				}
				catch(Exception ex)
				{
					ErrorHandler.Error("Failed in DoAppend", ex);
				}
#if !MONO && !NET_2_0
				// on .NET 2.0 (and higher) and Mono (all profiles), 
				// exceptions that do not derive from System.Exception will be
				// wrapped in a RuntimeWrappedException by the runtime, and as
				// such will be catched by the catch clause above
				catch
				{
					// Catch handler for non System.Exception types
					ErrorHandler.Error("Failed in DoAppend (unknown exception)");
				}
#endif
				finally
				{
					m_recursiveGuard = false;
				}
			}
		}

		#endregion Implementation of IAppender

		#region Implementation of IBulkAppender

		/// <summary>
		/// Performs threshold checks and invokes filters before 
		/// delegating actual logging to the subclasses specific 
		/// <see cref="Append(LoggingEvent[])"/> method.
		/// </summary>
		/// <param name="loggingEvents">The array of events to log.</param>
		/// <remarks>
		/// <para>
		/// This method cannot be overridden by derived classes. A
		/// derived class should override the <see cref="Append(LoggingEvent[])"/> method
		/// which is called by this method.
		/// </para>
		/// <para>
		/// The implementation of this method is as follows:
		/// </para>
		/// <para>
		/// <list type="bullet">
		///		<item>
		///			<description>
		///			Checks that the severity of the <paramref name="loggingEvent"/>
		///			is greater than or equal to the <see cref="Threshold"/> of this
		///			appender.</description>
		///		</item>
		///		<item>
		///			<description>
		///			Checks that the <see cref="IFilter"/> chain accepts the 
		///			<paramref name="loggingEvent"/>.
		///			</description>
		///		</item>
		///		<item>
		///			<description>
		///			Calls <see cref="PreAppendCheck()"/> and checks that 
		///			it returns <c>true</c>.</description>
		///		</item>
		/// </list>
		/// </para>
		/// <para>
		/// If all of the above steps succeed then the <paramref name="loggingEvents"/>
		/// will be passed to the <see cref="Append(LoggingEvent[])"/> method.
		/// </para>
		/// </remarks>
		public void DoAppend(LoggingEvent[] loggingEvents) 
		{
			// This lock is absolutely critical for correct formatting
			// of the message in a multi-threaded environment.  Without
			// this, the message may be broken up into elements from
			// multiple thread contexts (like get the wrong thread ID).

			lock(this)
			{
				if (m_closed)
				{
					ErrorHandler.Error("Attempted to append to closed appender named ["+m_name+"].");
					return;
				}

				// prevent re-entry
				if (m_recursiveGuard)
				{
					return;
				}

				try
				{
					m_recursiveGuard = true;

					ArrayList filteredEvents = new ArrayList(loggingEvents.Length);

					foreach(LoggingEvent loggingEvent in loggingEvents)
					{
						if (FilterEvent(loggingEvent))
						{
							filteredEvents.Add(loggingEvent);
						}
					}

					if (filteredEvents.Count > 0 && PreAppendCheck())
					{
						this.Append((LoggingEvent[])filteredEvents.ToArray(typeof(LoggingEvent)));
					}
				}
				catch(Exception ex)
				{
					ErrorHandler.Error("Failed in Bulk DoAppend", ex);
				}
#if !MONO && !NET_2_0
				// on .NET 2.0 (and higher) and Mono (all profiles), 
				// exceptions that do not derive from System.Exception will be
				// wrapped in a RuntimeWrappedException by the runtime, and as
				// such will be catched by the catch clause above
				catch
				{
					// Catch handler for non System.Exception types
					ErrorHandler.Error("Failed in Bulk DoAppend (unknown exception)");
				}
#endif
				finally

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲国产精品久久艾草纯爱| bt欧美亚洲午夜电影天堂| 亚洲bt欧美bt精品777| 日韩伦理电影网| 亚洲色图欧美偷拍| 亚洲精品亚洲人成人网| 一区二区三区自拍| 亚洲成人精品一区| 午夜精品久久久| 日韩国产成人精品| 精品一区二区日韩| 国产麻豆一精品一av一免费| 高清国产一区二区三区| 99久久精品国产麻豆演员表| 一本色道久久综合狠狠躁的推荐 | 99视频精品全部免费在线| 大桥未久av一区二区三区中文| 国产高清久久久| 91丝袜国产在线播放| 欧美午夜精品理论片a级按摩| 在线不卡一区二区| 日韩精品一区二区三区在线播放 | 欧美丝袜丝交足nylons| 欧美日韩在线电影| 欧美一区二区在线视频| 26uuu成人网一区二区三区| 国产精品免费视频观看| 亚洲激情综合网| 日韩高清不卡在线| 国产一区二区视频在线| 色婷婷久久久久swag精品| 欧美丰满嫩嫩电影| 久久先锋影音av| 综合久久久久综合| 首页综合国产亚洲丝袜| 国产精品一卡二卡在线观看| 91一区一区三区| 67194成人在线观看| 国产情人综合久久777777| 亚洲自拍偷拍网站| 国产在线精品不卡| 欧美综合视频在线观看| 日韩精品中午字幕| **欧美大码日韩| 全部av―极品视觉盛宴亚洲| 成人在线综合网站| 欧美日本国产一区| 国产精品热久久久久夜色精品三区 | 中文字幕一区在线| 首页国产欧美日韩丝袜| 不卡一区在线观看| 56国语精品自产拍在线观看| 国产亚洲一区二区三区| 亚洲国产乱码最新视频| 国产成人午夜电影网| 欧美网站一区二区| 日本一二三四高清不卡| 秋霞午夜鲁丝一区二区老狼| 色综合视频在线观看| 久久天天做天天爱综合色| 一区二区三区在线不卡| 国产成人在线电影| 日韩一级欧美一级| 一二三四区精品视频| 国产成人精品免费在线| 欧美一二三在线| 亚洲777理论| 91在线精品秘密一区二区| 久久综合色婷婷| 日韩精彩视频在线观看| 色8久久人人97超碰香蕉987| 国产欧美日韩一区二区三区在线观看 | 亚洲欧美激情小说另类| 国产一区日韩二区欧美三区| 88在线观看91蜜桃国自产| 亚洲男人的天堂av| 懂色av一区二区三区蜜臀| 欧美一级专区免费大片| 亚洲高清三级视频| 日本丶国产丶欧美色综合| 国产精品久久毛片a| 国产一区二三区| 日韩精品在线一区二区| 日产国产欧美视频一区精品 | 成人免费在线播放视频| 国产麻豆精品一区二区| 欧美一区二区久久| 亚洲不卡av一区二区三区| 色欧美片视频在线观看在线视频| 国产日韩v精品一区二区| 久久 天天综合| 欧美电影免费观看高清完整版在| 无码av中文一区二区三区桃花岛| 欧美色视频在线观看| 中文字幕五月欧美| 处破女av一区二区| 国产午夜精品一区二区三区四区| 蜜臀久久99精品久久久久久9| 538在线一区二区精品国产| 亚洲va在线va天堂| 欧美日本乱大交xxxxx| 偷窥少妇高潮呻吟av久久免费| 欧美日韩一级视频| 亚洲午夜免费视频| 欧美日韩一二区| 日韩高清中文字幕一区| 日韩丝袜美女视频| 极品少妇一区二区三区精品视频 | 日韩av二区在线播放| 日韩一区二区免费在线电影| 久久精品国产在热久久| 日韩一区二区免费电影| 国产在线播放一区| 国产精品久久看| 91高清在线观看| 婷婷激情综合网| 日韩欧美在线123| 国产精品一品视频| 亚洲视频在线观看三级| 欧美亚洲日本国产| 石原莉奈在线亚洲二区| 337p粉嫩大胆色噜噜噜噜亚洲| 国产成人丝袜美腿| 1000部国产精品成人观看| 在线精品观看国产| 日韩高清国产一区在线| 久久久国产午夜精品| heyzo一本久久综合| 亚洲一区二区三区爽爽爽爽爽| 制服丝袜在线91| 懂色av中文一区二区三区| 亚洲宅男天堂在线观看无病毒| 欧美久久免费观看| 国产美女视频91| 综合欧美亚洲日本| 日韩一级高清毛片| 成人免费av资源| 亚洲成av人片一区二区| 国产亚洲欧美一区在线观看| 91免费视频网| 蜜臀av亚洲一区中文字幕| 国产精品三级在线观看| 欧美精品在线观看一区二区| 国产精品自拍三区| 亚洲第一成年网| 久久久久国产精品麻豆ai换脸 | 91在线看国产| 蓝色福利精品导航| 中文字幕一区二区三区色视频| 欧美日本一区二区三区四区| 国产高清不卡二三区| 亚洲成a人v欧美综合天堂下载| 国产视频一区二区在线观看| 欧美亚洲自拍偷拍| 夫妻av一区二区| 青青草97国产精品免费观看| 国产精品传媒入口麻豆| 日韩欧美一区在线| 色综合久久中文综合久久牛| 狠狠色丁香九九婷婷综合五月| 亚洲免费观看高清完整版在线观看| 日韩午夜在线播放| 在线视频你懂得一区二区三区| 美脚の诱脚舐め脚责91 | 秋霞午夜av一区二区三区| 中文字幕一区二区视频| 欧美不卡一区二区| 欧美在线免费视屏| 国产91精品一区二区麻豆亚洲| 日韩精品亚洲一区| 1024亚洲合集| 国产欧美视频一区二区| 日韩欧美一区中文| 欧美乱妇20p| 色老汉一区二区三区| 国产91精品在线观看| 精品在线亚洲视频| 视频在线观看一区| 一区二区理论电影在线观看| 中文字幕的久久| 国产色爱av资源综合区| 欧美一卡2卡3卡4卡| 欧美区在线观看| 在线亚洲一区二区| 91一区一区三区| 99久久精品国产一区| av资源站一区| 国产成人免费视频一区| 国产一区二区三区免费播放| 蜜臀av一区二区在线免费观看| 亚洲444eee在线观看| 亚洲国产精品一区二区久久恐怖片| 国产精品久久久久久妇女6080| 国产偷国产偷亚洲高清人白洁 | 激情综合网最新| 日韩国产一区二| 日韩国产高清影视| 免费国产亚洲视频| 美国欧美日韩国产在线播放| 日韩成人午夜电影|