diff --git a/.vs/ICSSoft.FromERP/v16/.suo b/.vs/ICSSoft.FromERP/v16/.suo index 8268e81..95e0e7b 100644 Binary files a/.vs/ICSSoft.FromERP/v16/.suo and b/.vs/ICSSoft.FromERP/v16/.suo differ diff --git a/ICSSoft.FromERP/ICSHelper.cs b/ICSSoft.FromERP/Data/ICSHelper.cs similarity index 100% rename from ICSSoft.FromERP/ICSHelper.cs rename to ICSSoft.FromERP/Data/ICSHelper.cs diff --git a/ICSSoft.FromERP/ICSSoft.FromERP.csproj b/ICSSoft.FromERP/ICSSoft.FromERP.csproj index a4b06a1..0484405 100644 --- a/ICSSoft.FromERP/ICSSoft.FromERP.csproj +++ b/ICSSoft.FromERP/ICSSoft.FromERP.csproj @@ -26,7 +26,7 @@ true full false - ..\ICSSoft.Test\bin\Debug\ + ..\Root\ DEBUG;TRACE prompt 4 @@ -114,7 +114,7 @@ - + @@ -142,6 +142,8 @@ + + @@ -168,6 +170,7 @@ + diff --git a/ICSSoft.FromERP/Model/金杨/CapInputDto.cs b/ICSSoft.FromERP/Model/金杨/CapInputDto.cs new file mode 100644 index 0000000..d669786 --- /dev/null +++ b/ICSSoft.FromERP/Model/金杨/CapInputDto.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ICSSoft.FromERP.Model +{ + public class CapInputDto + { + /// + /// 车间编号 + /// + public string WorkshopID { get; set; } + /// + /// 设备编号 + /// + public string EquipmentID { get; set; } + /// + /// 产品信息 + /// + public string ProductNo { get; set; } + /// + /// 批次号 + /// + public string LotNo { get; set; } + /// + /// 数据采集时间 + /// + public string CollectionTime { get; set; } + /// + /// 内阻值 + /// + public double ParamValue_Resistance { get; set; } + /// + /// 高度值 + /// + public double ParamValue_Height { get; set; } + /// + /// 备注预留 + /// + public string Msg { get; set; } + } +} diff --git a/ICSSoft.FromERP/Model/金杨/ResponseInfoDto.cs b/ICSSoft.FromERP/Model/金杨/ResponseInfoDto.cs new file mode 100644 index 0000000..79b8283 --- /dev/null +++ b/ICSSoft.FromERP/Model/金杨/ResponseInfoDto.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ICSSoft.FromERP.Model +{ + public class ResponseInfoDto + { + /// + /// 响应时间 + /// + public string ResponseTime { get; set; } + /// + /// 上传结果,OK为上传成功 + /// + public string Result { get; set; } + } +} diff --git a/ICSSoft.FromERP/SyncCas_Jinyang.cs b/ICSSoft.FromERP/SyncCas_Jinyang.cs new file mode 100644 index 0000000..81648f6 --- /dev/null +++ b/ICSSoft.FromERP/SyncCas_Jinyang.cs @@ -0,0 +1,104 @@ +using ICSSoft.FromERP.Model; +using Newtonsoft.Json; +using Quartz; +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ICSSoft.FromERP +{ + /// + /// 数采上传(金杨) + /// + public class SyncCas_Jinyang : IJob + { + private static object key = new object(); + private static log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); + public void Execute(IJobExecutionContext context) + { + try + { + lock (key) + { + log.Info("开始……………………………………………………………………"); + Execute(); + log.Info("结束……………………………………………………………………"); + } + } + catch (Exception ex) + { + log.Error(ex.ToString()); + } + } + + public void Execute() + { + try + { + string conStr = ICSHelper.GetConnectString(); + string Namespace = this.GetType().Namespace; + //string Class = this.GetType().Name; + DataTable dt = ICSHelper.GetERPDB(conStr); + foreach (DataRow dr in dt.Rows) + { + var dtNowBegin = new DateTime(2000, 1, 1, 0, 0, 0);//默认开始时间 + var dtNow = DateTime.Now; + string erpName = ICSHelper.GetConfigString()["ERPDB"]; + string TenantId = dr["TenantId"].ToString();//mes 组织 + string TenantCode = dr["TenantCode"].ToString(); + string ErpId = dr["ErpID"].ToString(); //erpID + string Class = this.GetType().Name + TenantCode; + erpName = string.Format(erpName, TenantId); + + string sql0 = " SELECT top 1 ModifyDate FROM ICSERPTime where ClassName='" + Class + "'"; + var lastDate = ICSHelper.ExecuteScalar(conStr, sql0).ToDateOrNull(); + if (!lastDate.HasValue) + { + lastDate = dtNowBegin; + } + + string sql = @" select '" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "' as MTIME into #TempVendor "; + sql = ICSHelper.Time(Namespace, Class, TenantId, sql, "#TempVendor"); + sql += "DROP TABLE #TempVendor"; + ICSHelper.ExecuteDate(conStr, sql); + + + var input = new CapInputDto(); + input.WorkshopID = ""; + input.EquipmentID = ""; + input.ProductNo = ""; + input.LotNo = ""; + input.CollectionTime = ""; + input.ParamValue_Resistance = 12; + input.ParamValue_Height = 12; + input.Msg = ""; + + var inputObj = JsonConvert.SerializeObject(input); + string url = ICSHelper.GetConfigString()["WeiMasErpUrl"] + @"/BasicAssistingService/FromWeMec/APIVenderToMES"; + + var result = HttpHelper.HttpClientPost(url, inputObj).Result; + if (result.Result == "OK") + { + + + + + // insertSql += "DROP TABLE #tempFromErp4Vendor"; + //ICSHelper.ExecuteDate(conStr, insertSql); + } + else + { + throw new Exception(result.Result); + } + } + } + catch (Exception ex) + { + log.Error(ex.ToString()); + } + } + } +} diff --git a/ICSSoft.FromERP/SyncCustomer_WeiMas.cs b/ICSSoft.FromERP/SyncCustomer_WeiMas.cs index 13c2300..1249ff5 100644 --- a/ICSSoft.FromERP/SyncCustomer_WeiMas.cs +++ b/ICSSoft.FromERP/SyncCustomer_WeiMas.cs @@ -14,7 +14,7 @@ namespace ICSSoft.FromERP /// /// 客户档案(威迈) /// - public class SyncCustomer_WeiMas + public class SyncCustomer_WeiMas : IJob { private static object key = new object(); diff --git a/Root/App.config b/Root/App.config new file mode 100644 index 0000000..4c4ab2f --- /dev/null +++ b/Root/App.config @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Root/ICSSoft.FromERP.dll b/Root/ICSSoft.FromERP.dll index 6a0ec34..db6fc0a 100644 Binary files a/Root/ICSSoft.FromERP.dll and b/Root/ICSSoft.FromERP.dll differ diff --git a/Root/ICSSoft.FromERP.dll.config b/Root/ICSSoft.FromERP.dll.config index eeb2f00..4c4ab2f 100644 --- a/Root/ICSSoft.FromERP.dll.config +++ b/Root/ICSSoft.FromERP.dll.config @@ -1,15 +1,29 @@ - + + + + + + + + + + + - + + + + + - + diff --git a/Root/ICSSoft.FromERP.pdb b/Root/ICSSoft.FromERP.pdb index 2b7e586..1d4aca7 100644 Binary files a/Root/ICSSoft.FromERP.pdb and b/Root/ICSSoft.FromERP.pdb differ diff --git a/Root/Newtonsoft.Json.dll b/Root/Newtonsoft.Json.dll index 7af125a..cfee60e 100644 Binary files a/Root/Newtonsoft.Json.dll and b/Root/Newtonsoft.Json.dll differ diff --git a/Root/System.IO.dll b/Root/System.IO.dll new file mode 100644 index 0000000..c33120c Binary files /dev/null and b/Root/System.IO.dll differ diff --git a/Root/System.Net.Http.dll b/Root/System.Net.Http.dll index 3127021..899bf5e 100644 Binary files a/Root/System.Net.Http.dll and b/Root/System.Net.Http.dll differ diff --git a/Root/System.Runtime.dll b/Root/System.Runtime.dll new file mode 100644 index 0000000..3f12010 Binary files /dev/null and b/Root/System.Runtime.dll differ diff --git a/Root/log4net.dll b/Root/log4net.dll index 93fb476..79b27e2 100644 Binary files a/Root/log4net.dll and b/Root/log4net.dll differ diff --git a/Root/log4net.xml b/Root/log4net.xml index df56743..e3d2991 100644 --- a/Root/log4net.xml +++ b/Root/log4net.xml @@ -55,38 +55,38 @@ An example configuration to log to the above table: - - - - + + + + - - - + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + @@ -96,2460 +96,2618 @@ Gert Driesen Lance Nehring - + + + Initializes a new instance of the class. + + + Public default constructor to initialize a new instance of this class. + + + - Abstract base class implementation of that - buffers events in a fixed size buffer. + Gets or sets the database connection string that is used to connect to + the database. + + The database connection string used to connect to the database. + - This base class should be used by appenders that need to buffer a - number of events before logging them. For example the - buffers events and then submits the entire contents of the buffer to - the underlying database in one go. - - - Subclasses should override the - method to deliver the buffered events. - - The BufferingAppenderSkeleton maintains a fixed size cyclic - buffer of events. The size of the buffer is set using - the property. - - A is used to inspect - each event as it arrives in the appender. If the - triggers, then the current buffer is sent immediately - (see ). Otherwise the event - is stored in the buffer. For example, an evaluator can be used to - deliver the events immediately when an ERROR event arrives. - - - The buffering appender can be configured in a mode. - By default the appender is NOT lossy. When the buffer is full all - the buffered events are sent with . - If the property is set to true then the - buffer will not be sent when it is full, and new events arriving - in the appender will overwrite the oldest event in the buffer. - In lossy mode the buffer will only be sent when the - triggers. This can be useful behavior when you need to know about - ERROR events but not about events with a lower level, configure an - evaluator that will trigger when an ERROR event arrives, the whole - buffer will be sent which gives a history of events leading up to - the ERROR event. + The connections string is specific to the connection type. + See for more information. - Nicko Cadell - Gert Driesen + Connection string for MS Access via ODBC: + "DSN=MS Access Database;UID=admin;PWD=;SystemDB=C:\data\System.mdw;SafeTransactions = 0;FIL=MS Access;DriverID = 25;DBQ=C:\data\train33.mdb" + + Another connection string for MS Access via ODBC: + "Driver={Microsoft Access Driver (*.mdb)};DBQ=C:\Work\cvs_root\log4net-1.2\access.mdb;UID=;PWD=;" + + Connection string for MS Access via OLE DB: + "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Work\cvs_root\log4net-1.2\access.mdb;User Id=;Password=;" + - + - Abstract base class implementation of . + The appSettings key from App.Config that contains the connection string. + + + + + The connectionStrings key from App.Config that contains the connection string. + + + This property requires at least .NET 2.0. + + + + + Gets or sets the type name of the connection + that should be created. + + The type name of the connection. + - This class provides the code for common functionality, such - as support for threshold filtering and support for general filters. + The type name of the ADO.NET provider to use. - Appenders can also implement the interface. Therefore - they would require that the method - be called after the appenders properties have been configured. + The default is to use the OLE DB provider. - Nicko Cadell - Gert Driesen + Use the OLE DB Provider. This is the default value. + System.Data.OleDb.OleDbConnection, System.Data, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Use the MS SQL Server Provider. + System.Data.SqlClient.SqlConnection, System.Data, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Use the ODBC Provider. + Microsoft.Data.Odbc.OdbcConnection,Microsoft.Data.Odbc,version=1.0.3300.0,publicKeyToken=b77a5c561934e089,culture=neutral + This is an optional package that you can download from + http://msdn.microsoft.com/downloads + search for ODBC .NET Data Provider. + + Use the Oracle Provider. + System.Data.OracleClient.OracleConnection, System.Data.OracleClient, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + This is an optional package that you can download from + http://msdn.microsoft.com/downloads + search for .NET Managed Provider for Oracle. + - + - Implement this interface for your own strategies for printing log statements. + Gets or sets the command text that is used to insert logging events + into the database. + + The command text used to insert logging events into the database. + - Implementors should consider extending the - class which provides a default implementation of this interface. + Either the text of the prepared statement or the + name of the stored procedure to execute to write into + the database. - Appenders can also implement the interface. Therefore - they would require that the method - be called after the appenders properties have been configured. + The property determines if + this text is a prepared statement or a stored procedure. + + + If this property is not set, the command text is retrieved by invoking + . - Nicko Cadell - Gert Driesen - + - Closes the appender and releases resources. + Gets or sets the command type to execute. + + The command type to execute. + - Releases any resources allocated within the appender such as file handles, - network connections, etc. + This value may be either (System.Data.CommandType.Text) to specify + that the is a prepared statement to execute, + or (System.Data.CommandType.StoredProcedure) to specify that the + property is the name of a stored procedure + to execute. - It is a programming error to append to a closed appender. + The default value is (System.Data.CommandType.Text). - + - Log the logging event in Appender specific way. + Should transactions be used to insert logging events in the database. - The event to log + + true if transactions should be used to insert logging events in + the database, otherwise false. The default value is true. + - This method is called to log a message into this appender. + Gets or sets a value that indicates whether transactions should be used + to insert logging events in the database. + + + When set a single transaction will be used to insert the buffered events + into the database. Otherwise each event will be inserted without using + an explicit transaction. - + - Gets or sets the name of this appender. + Gets or sets the used to call the NetSend method. - The name of the appender. + + The used to call the NetSend method. + - The name uniquely identifies the appender. + + Unless a specified here for this appender + the is queried for the + security context to use. The default behavior is to use the security context + of the current thread. + - + - Interface for appenders that support bulk logging. + Should this appender try to reconnect to the database on error. + + true if the appender should try to reconnect to the database after an + error has occurred, otherwise false. The default value is false, + i.e. not to try to reconnect. + - This interface extends the interface to - support bulk logging of objects. Appenders - should only implement this interface if they can bulk log efficiently. + The default behaviour is for the appender not to try to reconnect to the + database if an error occurs. Subsequent logging events are discarded. + + + To force the appender to attempt to reconnect to the database set this + property to true. + + When the appender attempts to connect to the database there may be a + delay of up to the connection timeout specified in the connection string. + This delay will block the calling application's thread. + Until the connection can be reestablished this potential delay may occur multiple times. + - Nicko Cadell - + - Log the array of logging events in Appender specific way. + Gets or sets the underlying . - The events to log + + The underlying . + - - This method is called to log an array of events into this appender. - + creates a to insert + logging events into a database. Classes deriving from + can use this property to get or set this . Use the + underlying returned from if + you require access beyond that which provides. - + - Interface used to delay activate a configured object. + Initialize the appender based on the options set - This allows an object to defer activation of its options until all - options have been set. This is required for components which have - related options that remain ambiguous until all are set. + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. - If a component implements this interface then the method - must be called by the container after its all the configured properties have been set - and before the component can be used. + If any of the configuration properties are modified then + must be called again. - Nicko Cadell - + - Activate the options that were previously set with calls to properties. + Override the parent method to close the database - This allows an object to defer activation of its options until all - options have been set. This is required for components which have - related options that remain ambiguous until all are set. - - - If a component implements this interface then this method must be called - after its properties have been set before the component can be used. + Closes the database command and database connection. - - - Interface that can be implemented by Appenders that buffer logging data and expose a method. - - - + - Flushes any buffered log data. + Inserts the events into the database. + The events to insert into the database. - Appenders that implement the method must do so in a thread-safe manner: it can be called concurrently with - the method. - Typically this is done by locking on the Appender instance, e.g.: - - - + Insert all the events specified in the + array into the database. + + + + + Adds a parameter to the command. + + The parameter to add to the command. + - The parameter is only relevant for appenders that process logging events asynchronously, - such as . + Adds a parameter to the ordered list of command parameters. - The maximum time to wait for logging events to be flushed. - True if all logging events were flushed successfully, else false. - + - Initial buffer size + Writes the events to the database using the transaction specified. + The transaction that the events will be executed under. + The array of events to insert into the database. + + + The transaction argument can be null if the appender has been + configured not to use transactions. See + property for more information. + + - + - Maximum buffer size before it is recycled + Prepare entire database command object to be executed. + The command to prepare. - + - Default constructor + Formats the log message into database statement text. + The event being logged. - Empty default constructor + This method can be overridden by subclasses to provide + more control over the format of the database statement. + + Text that can be passed to a . + - + - Finalizes this appender by calling the implementation's - method. + Creates an instance used to connect to the database. - - If this appender has not been closed then the Finalize method - will call . - + This method is called whenever a new IDbConnection is needed (i.e. when a reconnect is necessary). + The of the object. + The connectionString output from the ResolveConnectionString method. + An instance with a valid connection string. - + - Initialize the appender based on the options set + Resolves the connection string from the ConnectionString, ConnectionStringName, or AppSettingsKey + property. - - This is part of the delayed object - activation scheme. The method must - be called on this object after the configuration properties have - been set. Until is called this - object is in an undefined state and must not be used. - - - If any of the configuration properties are modified then - must be called again. - + ConnectiongStringName is only supported on .NET 2.0 and higher. + Additional information describing the connection string. + A connection string used to connect to the database. - + - Closes the appender and release resources. + Retrieves the class type of the ADO.NET provider. - Release any resources allocated within the appender such as file handles, - network connections, etc. - - - It is a programming error to append to a closed appender. + Gets the Type of the ADO.NET provider to use to connect to the + database. This method resolves the type specified in the + property. - This method cannot be overridden by subclasses. This method - delegates the closing of the appender to the - method which must be overridden in the subclass. + Subclasses can override this method to return a different type + if necessary. + The of the ADO.NET provider - + - Performs threshold checks and invokes filters before - delegating actual logging to the subclasses specific - method. + Connects to the database. + + + + + Cleanup the existing connection. - The event to log. - - This method cannot be overridden by derived classes. A - derived class should override the method - which is called by this method. - - - The implementation of this method is as follows: - - - - - - Checks that the severity of the - is greater than or equal to the of this - appender. - - - - Checks that the chain accepts the - . - - - - - Calls and checks that - it returns true. - - - - - If all of the above steps succeed then the - will be passed to the abstract method. - + Calls the IDbConnection's method. - + - Performs threshold checks and invokes filters before - delegating actual logging to the subclasses specific - method. + The list of objects. - The array of events to log. - This method cannot be overridden by derived classes. A - derived class should override the method - which is called by this method. - - - The implementation of this method is as follows: - - - - - - Checks that the severity of the - is greater than or equal to the of this - appender. - - - - Checks that the chain accepts the - . - - - - - Calls and checks that - it returns true. - - - - - If all of the above steps succeed then the - will be passed to the method. + The list of objects. - + - Test if the logging event should we output by this appender + The security context to use for privileged calls + + + + + The that will be used + to insert logging events into a database. + + + + + Database connection string. + + + + + The appSettings key from App.Config that contains the connection string. + + + + + The connectionStrings key from App.Config that contains the connection string. + + + + + String type name of the type name. + + + + + The text of the command. + + + + + The command type. + + + + + Indicates whether to use transactions when writing to the database. + + + + + Indicates whether to reconnect when a connection is lost. + + + + + The fully qualified type of the AdoNetAppender class. - the event to test - true if the event should be output, false if the event should be ignored - - This method checks the logging event against the threshold level set - on this appender and also against the filters specified on this - appender. - - - The implementation of this method is as follows: - - - - - - Checks that the severity of the - is greater than or equal to the of this - appender. - - - - Checks that the chain accepts the - . - - - - + Used by the internal logger to record the Type of the + log message. - + - Adds a filter to the end of the filter chain. + Parameter type used by the . - the filter to add to this appender - The Filters are organized in a linked list. + This class provides the basic database parameter properties + as defined by the interface. - - Setting this property causes the new filter to be pushed onto the - back of the filter chain. + This type can be subclassed to provide database specific + functionality. The two methods that are called externally are + and . - + - Clears the filter list for this appender. + Initializes a new instance of the class. - - Clears the filter list for this appender. - + Default constructor for the AdoNetAppenderParameter class. - + - Checks if the message level is below this appender's threshold. + Gets or sets the name of this parameter. - to test against. + + The name of this parameter. + - If there is no threshold set, then the return value is always true. - + The name of this parameter. The parameter name + must match up to a named parameter to the SQL stored procedure + or prepared statement. + - - true if the meets the - requirements of this appender. - - + - Is called when the appender is closed. Derived classes should override - this method if resources need to be released. + Gets or sets the database type for this parameter. + + The database type for this parameter. + - Releases any resources allocated within the appender such as file handles, - network connections, etc. + The database type for this parameter. This property should + be set to the database type from the + enumeration. See . - It is a programming error to append to a closed appender. + This property is optional. If not specified the ADO.NET provider + will attempt to infer the type from the value. + - + - Subclasses of should implement this method - to perform actual logging. + Gets or sets the precision for this parameter. - The event to append. + + The precision for this parameter. + - A subclass must implement this method to perform - logging of the . - - This method will be called by - if all the conditions listed for that method are met. + The maximum number of digits used to represent the Value. - To restrict the logging of events in the appender - override the method. + This property is optional. If not specified the ADO.NET provider + will attempt to infer the precision from the value. + - + - Append a bulk array of logging events. + Gets or sets the scale for this parameter. - the array of logging events + + The scale for this parameter. + - This base class implementation calls the - method for each element in the bulk array. + The number of decimal places to which Value is resolved. - A sub class that can better process a bulk array of events should - override this method in addition to . + This property is optional. If not specified the ADO.NET provider + will attempt to infer the scale from the value. + - + - Called before as a precondition. + Gets or sets the size for this parameter. + + The size for this parameter. + - This method is called by - before the call to the abstract method. + The maximum size, in bytes, of the data within the column. - This method can be overridden in a subclass to extend the checks - made before the event is passed to the method. + This property is optional. If not specified the ADO.NET provider + will attempt to infer the size from the value. - A subclass should ensure that they delegate this call to - this base class if it is overridden. + For BLOB data types like VARCHAR(max) it may be impossible to infer the value automatically, use -1 as the size in this case. - true if the call to should proceed. + - + - Renders the to a string. + Gets or sets the to use to + render the logging event into an object for this + parameter. - The event to render. - The event rendered as a string. + + The used to render the + logging event into an object for this parameter. + - Helper method to render a to - a string. This appender must have a - set to render the to - a string. - - If there is exception data in the logging event and - the layout does not process the exception, this method - will append the exception text to the rendered string. + The that renders the value for this + parameter. - Where possible use the alternative version of this method - . - That method streams the rendering onto an existing Writer - which can give better performance if the caller already has - a open and ready for writing. + The can be used to adapt + any into a + for use in the property. - + - Renders the to a string. + Prepare the specified database command object. - The event to render. - The TextWriter to write the formatted event to + The command to prepare. - Helper method to render a to - a string. This appender must have a - set to render the to - a string. - - If there is exception data in the logging event and - the layout does not process the exception, this method - will append the exception text to the rendered string. - - - Use this method in preference to - where possible. If, however, the caller needs to render the event - to a string then does - provide an efficient mechanism for doing so. + Prepares the database command object by adding + this parameter to its collection of parameters. - - - Flushes any buffered log data. - - - This implementation doesn't flush anything and always returns true - - True if all logging events were flushed successfully, else false. - - - - The layout of this appender. - - - See for more information. - - - - - The name of this appender. - - - See for more information. - - - + - The level threshold of this appender. + Renders the logging event and set the parameter value in the command. + The command containing the parameter. + The event to be rendered. - There is no level threshold filtering by default. - - - See for more information. + Renders the logging event using this parameters layout + object. Sets the value of the parameter on the command object. - + - It is assumed and enforced that errorHandler is never null. + The name of this parameter. - - - It is assumed and enforced that errorHandler is never null. - - - See for more information. - - - + - The first filter in the filter chain. + The database type for this parameter. - - - Set to null initially. - - - See for more information. - - - + - The last filter in the filter chain. + Flag to infer type rather than use the DbType - - See for more information. - - + - Flag indicating if this appender is closed. + The precision for this parameter. - - See for more information. - - + - The guard prevents an appender from repeatedly calling its own DoAppend method + The scale for this parameter. - + - StringWriter used to render events + The size for this parameter. - + - The fully qualified type of the AppenderSkeleton class. + The to use to render the + logging event into an object for this parameter. - - Used by the internal logger to record the Type of the - log message. - - + - Gets or sets the threshold of this appender. + Appends logging events to the terminal using ANSI color escape sequences. - - The threshold of the appender. - - All log events with lower level than the threshold level are ignored - by the appender. + AnsiColorTerminalAppender appends log events to the standard output stream + or the error output stream using a layout specified by the + user. It also allows the color of a specific level of message to be set. + + This appender expects the terminal to understand the VT100 control set + in order to interpret the color codes. If the terminal or console does not + understand the control codes the behavior is not defined. + - In configuration files this option is specified by setting the - value of the option to a level - string, such as "DEBUG", "INFO" and so on. + By default, all output is written to the console's standard output stream. + The property can be set to direct the output to the + error stream. - - - - - Gets or sets the for this appender. - - The of the appender - - The provides a default - implementation for the property. - - - - - - The filter chain. - - The head of the filter chain filter chain. - + NOTE: This appender writes each message to the System.Console.Out or + System.Console.Error that is set at the time the event is appended. + Therefore it is possible to programmatically redirect the output of this appender + (for example NUnit does this to capture program output). While this is the desired + behavior of this appender it may have security implications in your application. + - Returns the head Filter. The Filters are organized in a linked list - and so all Filters on this Appender are available through the result. + When configuring the ANSI colored terminal appender, a mapping should be + specified to map a logging level to a color. For example: + + + + + + + + + + + + + + + The Level is the standard log4net logging level and ForeColor and BackColor can be any + of the following values: + + Blue + Green + Red + White + Yellow + Purple + Cyan + + These color values cannot be combined together to make new colors. + + + The attributes can be any combination of the following: + + Brightforeground is brighter + Dimforeground is dimmer + Underscoremessage is underlined + Blinkforeground is blinking (does not work on all terminals) + Reverseforeground and background are reversed + Hiddenoutput is hidden + Strikethroughmessage has a line through it + + While any of these attributes may be combined together not all combinations + work well together, for example setting both Bright and Dim attributes makes + no sense. + Patrick Wagstrom + Nicko Cadell - + - Gets or sets the for this appender. + The enum of possible display attributes - The layout of the appender. - See for more information. + The following flags can be combined together to + form the ANSI color attributes. - + - + - Gets or sets the name of this appender. + text is bright + + + + + text is dim + + + + + text is underlined + + + + + text is blinking - The name of the appender. - - The name uniquely identifies the appender. - + Not all terminals support this attribute - + - Tests if this appender requires a to be set. + text and background colors are reversed + + + + + text is hidden + + + + + text is displayed with a strikethrough + + + + + text color is light + + + + + The enum of possible foreground or background color values for + use with the color mapping method - In the rather exceptional case, where the appender - implementation admits a layout but can also work without it, - then the appender should return true. - - - This default implementation always returns false. + The output can be in one for the following ANSI colors. - - true if the appender requires a layout object, otherwise false. - + - + - The default buffer size. + color is black + + + + + color is red + + + + + color is green + + + + + color is yellow + + + + + color is blue + + + + + color is magenta + + + + + color is cyan + + + + + color is white + + + + + Initializes a new instance of the class. - The default size of the cyclic buffer used to store events. - This is set to 512 by default. + The instance of the class is set up to write + to the standard output stream. - + - Initializes a new instance of the class. + Target is the value of the console output stream. + + Target is the value of the console output stream. + This is either "Console.Out" or "Console.Error". + - Protected default constructor to allow subclassing. + Target is the value of the console output stream. + This is either "Console.Out" or "Console.Error". - + - Initializes a new instance of the class. + Add a mapping of level to color - the events passed through this appender must be - fixed by the time that they arrive in the derived class' SendBuffer method. + The mapping to add - Protected constructor to allow subclassing. - - - The should be set if the subclass - expects the events delivered to be fixed even if the - is set to zero, i.e. when no buffering occurs. + Add a mapping to this appender. + Each mapping defines the foreground and background colours + for a level. - - - Flushes any buffered log data. - - The maximum time to wait for logging events to be flushed. - True if all logging events were flushed successfully, else false. - - + - Flush the currently buffered events + This method is called by the method. + The event to log. - Flushes any events that have been buffered. + Writes the event to the console. - If the appender is buffering in mode then the contents - of the buffer will NOT be flushed to the appender. + The format of the output will depend on the appender's layout. - + - Flush the currently buffered events + This appender requires a to be set. - set to true to flush the buffer of lossy events + true - Flushes events that have been buffered. If is - false then events will only be flushed if this buffer is non-lossy mode. - - - If the appender is buffering in mode then the contents - of the buffer will only be flushed if is true. - In this case the contents of the buffer will be tested against the - and if triggering will be output. All other buffered - events will be discarded. - - - If is true then the buffer will always - be emptied by calling this method. + This appender requires a to be set. - + - Initialize the appender based on the options set + Initialize the options for this appender - This is part of the delayed object - activation scheme. The method must - be called on this object after the configuration properties have - been set. Until is called this - object is in an undefined state and must not be used. - - - If any of the configuration properties are modified then - must be called again. + Initialize the level to color mappings set on this appender. - + - Close this appender instance. + The to use when writing to the Console + standard output stream. - Close this appender instance. If this appender is marked - as not then the remaining events in - the buffer must be sent when the appender is closed. + The to use when writing to the Console + standard output stream. - + - This method is called by the method. + The to use when writing to the Console + standard error output stream. - the event to log - Stores the in the cyclic buffer. - - - The buffer will be sent (i.e. passed to the - method) if one of the following conditions is met: - - - - The cyclic buffer is full and this appender is - marked as not lossy (see ) - - - An is set and - it is triggered for the - specified. - - - - Before the event is stored in the buffer it is fixed - (see ) to ensure that - any data referenced by the event will be valid when the buffer - is processed. + The to use when writing to the Console + standard error output stream. - + - Sends the contents of the buffer. + Flag to write output to the error stream rather than the standard output stream + + + + + Mapping from level object to color value + + + + + Ansi code to reset terminal + + + + + A class to act as a mapping between the level that a logging call is made at and + the color it should be displayed as. - The first logging event. - The buffer containing the events that need to be send. - The subclass must override . + Defines the mapping between a level and the color it should be displayed in. - + - Sends the events. + The mapped foreground color for the specified level - The events that need to be send. - The subclass must override this method to process the buffered events. + Required property. + The mapped foreground color for the specified level - + - The size of the cyclic buffer used to hold the logging events. + The mapped background color for the specified level - Set to by default. + + Required property. + The mapped background color for the specified level + - + - The cyclic buffer used to store the logging events. + The color attributes for the specified level + + + Required property. + The color attributes for the specified level + + - + - The triggering event evaluator that causes the buffer to be sent immediately. + Initialize the options for the object - The object that is used to determine if an event causes the entire - buffer to be sent immediately. This field can be null, which - indicates that event triggering is not to be done. The evaluator - can be set using the property. If this appender - has the ( property) set to - true then an must be set. + + Combine the and together + and append the attributes. + - + - Indicates if the appender should overwrite events in the cyclic buffer - when it becomes full, or if the buffer should be flushed when the - buffer is full. + The combined , and + suitable for setting the ansi terminal color. - - If this field is set to true then an must - be set. - - + - The triggering event evaluator filters discarded events. + A strongly-typed collection of objects. - - The object that is used to determine if an event that is discarded should - really be discarded or if it should be sent to the appenders. - This field can be null, which indicates that all discarded events will - be discarded. - + Nicko Cadell - + - Value indicating which fields in the event should be fixed + Supports type-safe iteration over a . - - By default all fields are fixed - + - + - The events delivered to the subclass must be fixed. + Gets the current element in the collection. - + - Gets or sets a value that indicates whether the appender is lossy. + Advances the enumerator to the next element in the collection. - - true if the appender is lossy, otherwise false. The default is false. - - - - This appender uses a buffer to store logging events before - delivering them. A triggering event causes the whole buffer - to be send to the remote sink. If the buffer overruns before - a triggering event then logging events could be lost. Set - to false to prevent logging events - from being lost. - - If is set to true then an - must be specified. - + + true if the enumerator was successfully advanced to the next element; + false if the enumerator has passed the end of the collection. + + + The collection was modified after the enumerator was created. + - + - Gets or sets the size of the cyclic buffer used to hold the - logging events. + Sets the enumerator to its initial position, before the first element in the collection. - - The size of the cyclic buffer used to hold the logging events. - - - - The option takes a positive integer - representing the maximum number of logging events to collect in - a cyclic buffer. When the is reached, - oldest events are deleted as new events are added to the - buffer. By default the size of the cyclic buffer is 512 events. - - - If the is set to a value less than - or equal to 1 then no buffering will occur. The logging event - will be delivered synchronously (depending on the - and properties). Otherwise the event will - be buffered. - - - + - Gets or sets the that causes the - buffer to be sent immediately. + Creates a read-only wrapper for a AppenderCollection instance. - - The that causes the buffer to be - sent immediately. - - - - The evaluator will be called for each event that is appended to this - appender. If the evaluator triggers then the current buffer will - immediately be sent (see ). - - If is set to true then an - must be specified. - + list to create a readonly wrapper arround + + An AppenderCollection wrapper that is read-only. + - + - Gets or sets the value of the to use. + An empty readonly static AppenderCollection - - The value of the to use. - - - - The evaluator will be called for each event that is discarded from this - appender. If the evaluator triggers then the current buffer will immediately - be sent (see ). - - - + - Gets or sets a value indicating if only part of the logging event data - should be fixed. + Initializes a new instance of the AppenderCollection class + that is empty and has the default initial capacity. - - true if the appender should only fix part of the logging event - data, otherwise false. The default is false. - - - - Setting this property to true will cause only part of the - event data to be fixed and serialized. This will improve performance. - - - See for more information. - - - + - Gets or sets a the fields that will be fixed in the event + Initializes a new instance of the AppenderCollection class + that has the specified initial capacity. - - The event fields that will be fixed before the event is buffered - - - - The logging event needs to have certain thread specific values - captured before it can be buffered. See - for details. - - - + + The number of elements that the new AppenderCollection is initially capable of storing. + - - - Initializes a new instance of the class. + + + Initializes a new instance of the AppenderCollection class + that contains elements copied from the specified AppenderCollection. - - Public default constructor to initialize a new instance of this class. - + The AppenderCollection whose elements are copied to the new collection. - + - Initialize the appender based on the options set + Initializes a new instance of the AppenderCollection class + that contains elements copied from the specified array. - - - This is part of the delayed object - activation scheme. The method must - be called on this object after the configuration properties have - been set. Until is called this - object is in an undefined state and must not be used. - - - If any of the configuration properties are modified then - must be called again. - - + The array whose elements are copied to the new list. - + - Override the parent method to close the database + Initializes a new instance of the AppenderCollection class + that contains elements copied from the specified collection. - - - Closes the database command and database connection. - - + The collection whose elements are copied to the new list. - + - Inserts the events into the database. + Type visible only to our subclasses + Used to access protected constructor - The events to insert into the database. - - - Insert all the events specified in the - array into the database. - - + - + - Adds a parameter to the command. + A value - The parameter to add to the command. - - - Adds a parameter to the ordered list of command parameters. - - - + - Writes the events to the database using the transaction specified. + Allow subclasses to avoid our default constructors - The transaction that the events will be executed under. - The array of events to insert into the database. - - - The transaction argument can be null if the appender has been - configured not to use transactions. See - property for more information. - - + + - + - Formats the log message into database statement text. + Gets the number of elements actually contained in the AppenderCollection. - The event being logged. - - This method can be overridden by subclasses to provide - more control over the format of the database statement. - - - Text that can be passed to a . - - + - Creates an instance used to connect to the database. + Copies the entire AppenderCollection to a one-dimensional + array. - - This method is called whenever a new IDbConnection is needed (i.e. when a reconnect is necessary). - - The of the object. - The connectionString output from the ResolveConnectionString method. - An instance with a valid connection string. + The one-dimensional array to copy to. - + - Resolves the connection string from the ConnectionString, ConnectionStringName, or AppSettingsKey - property. + Copies the entire AppenderCollection to a one-dimensional + array, starting at the specified index of the target array. - - ConnectiongStringName is only supported on .NET 2.0 and higher. - - Additional information describing the connection string. - A connection string used to connect to the database. + The one-dimensional array to copy to. + The zero-based index in at which copying begins. - + - Retrieves the class type of the ADO.NET provider. + Gets a value indicating whether access to the collection is synchronized (thread-safe). - - - Gets the Type of the ADO.NET provider to use to connect to the - database. This method resolves the type specified in the - property. - - - Subclasses can override this method to return a different type - if necessary. - - - The of the ADO.NET provider + false, because the backing type is an array, which is never thread-safe. - + - Connects to the database. - + Gets an object that can be used to synchronize access to the collection. + - + - Cleanup the existing connection. + Gets or sets the at the specified index. - - Calls the IDbConnection's method. - + The zero-based index of the element to get or set. + + is less than zero + -or- + is equal to or greater than . + - + - The list of objects. + Adds a to the end of the AppenderCollection. - - - The list of objects. - - + The to be added to the end of the AppenderCollection. + The index at which the value has been added. - + - The security context to use for privileged calls + Removes all elements from the AppenderCollection. - + - The that will be used - to insert logging events into a database. + Creates a shallow copy of the . + A new with a shallow copy of the collection data. - + - Database connection string. + Determines whether a given is in the AppenderCollection. + The to check for. + true if is found in the AppenderCollection; otherwise, false. - + - The appSettings key from App.Config that contains the connection string. + Returns the zero-based index of the first occurrence of a + in the AppenderCollection. + The to locate in the AppenderCollection. + + The zero-based index of the first occurrence of + in the entire AppenderCollection, if found; otherwise, -1. + - + - The connectionStrings key from App.Config that contains the connection string. + Inserts an element into the AppenderCollection at the specified index. + The zero-based index at which should be inserted. + The to insert. + + is less than zero + -or- + is equal to or greater than . + - + - String type name of the type name. + Removes the first occurrence of a specific from the AppenderCollection. + The to remove from the AppenderCollection. + + The specified was not found in the AppenderCollection. + - + - The text of the command. + Removes the element at the specified index of the AppenderCollection. + The zero-based index of the element to remove. + + is less than zero + -or- + is equal to or greater than . + - + - The command type. + Gets a value indicating whether the collection has a fixed size. + true if the collection has a fixed size; otherwise, false. The default is false - + - Indicates whether to use transactions when writing to the database. + Gets a value indicating whether the IList is read-only. + true if the collection is read-only; otherwise, false. The default is false - + - Indicates whether to reconnect when a connection is lost. + Returns an enumerator that can iterate through the AppenderCollection. + An for the entire AppenderCollection. - + - The fully qualified type of the AdoNetAppender class. + Gets or sets the number of elements the AppenderCollection can contain. - - Used by the internal logger to record the Type of the - log message. - - + - Gets or sets the database connection string that is used to connect to - the database. + Adds the elements of another AppenderCollection to the current AppenderCollection. - - The database connection string used to connect to the database. - - - - The connections string is specific to the connection type. - See for more information. - - - Connection string for MS Access via ODBC: - "DSN=MS Access Database;UID=admin;PWD=;SystemDB=C:\data\System.mdw;SafeTransactions = 0;FIL=MS Access;DriverID = 25;DBQ=C:\data\train33.mdb" - - Another connection string for MS Access via ODBC: - "Driver={Microsoft Access Driver (*.mdb)};DBQ=C:\Work\cvs_root\log4net-1.2\access.mdb;UID=;PWD=;" - - Connection string for MS Access via OLE DB: - "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Work\cvs_root\log4net-1.2\access.mdb;User Id=;Password=;" - + The AppenderCollection whose elements should be added to the end of the current AppenderCollection. + The new of the AppenderCollection. - + - The appSettings key from App.Config that contains the connection string. + Adds the elements of a array to the current AppenderCollection. + The array whose elements should be added to the end of the AppenderCollection. + The new of the AppenderCollection. - + - The connectionStrings key from App.Config that contains the connection string. + Adds the elements of a collection to the current AppenderCollection. - - This property requires at least .NET 2.0. - + The collection whose elements should be added to the end of the AppenderCollection. + The new of the AppenderCollection. - + - Gets or sets the type name of the connection - that should be created. + Sets the capacity to the actual number of elements. + + + + + Return the collection elements as an array + + the array + + + + is less than zero + -or- + is equal to or greater than . + + + + + is less than zero + -or- + is equal to or greater than . + + + + + Supports simple iteration over a . + + + + + + Initializes a new instance of the Enumerator class. + + + + + + Gets the current element in the collection. + + + + + Advances the enumerator to the next element in the collection. + + + true if the enumerator was successfully advanced to the next element; + false if the enumerator has passed the end of the collection. + + + The collection was modified after the enumerator was created. + + + + + Sets the enumerator to its initial position, before the first element in the collection. + + + + + + + + Abstract base class implementation of . - - The type name of the connection. - - The type name of the ADO.NET provider to use. + This class provides the code for common functionality, such + as support for threshold filtering and support for general filters. - The default is to use the OLE DB provider. + Appenders can also implement the interface. Therefore + they would require that the method + be called after the appenders properties have been configured. - Use the OLE DB Provider. This is the default value. - System.Data.OleDb.OleDbConnection, System.Data, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - Use the MS SQL Server Provider. - System.Data.SqlClient.SqlConnection, System.Data, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - Use the ODBC Provider. - Microsoft.Data.Odbc.OdbcConnection,Microsoft.Data.Odbc,version=1.0.3300.0,publicKeyToken=b77a5c561934e089,culture=neutral - This is an optional package that you can download from - http://msdn.microsoft.com/downloads - search for ODBC .NET Data Provider. - - Use the Oracle Provider. - System.Data.OracleClient.OracleConnection, System.Data.OracleClient, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - This is an optional package that you can download from - http://msdn.microsoft.com/downloads - search for .NET Managed Provider for Oracle. - + Nicko Cadell + Gert Driesen - + - Gets or sets the command text that is used to insert logging events - into the database. + Default constructor - - The command text used to insert logging events into the database. - - - Either the text of the prepared statement or the - name of the stored procedure to execute to write into - the database. - - - The property determines if - this text is a prepared statement or a stored procedure. - - - If this property is not set, the command text is retrieved by invoking - . - + Empty default constructor - + - Gets or sets the command type to execute. + Finalizes this appender by calling the implementation's + method. - - The command type to execute. - - This value may be either (System.Data.CommandType.Text) to specify - that the is a prepared statement to execute, - or (System.Data.CommandType.StoredProcedure) to specify that the - property is the name of a stored procedure - to execute. - - - The default value is (System.Data.CommandType.Text). + If this appender has not been closed then the Finalize method + will call . - + - Should transactions be used to insert logging events in the database. + Gets or sets the threshold of this appender. - true if transactions should be used to insert logging events in - the database, otherwise false. The default value is true. + The threshold of the appender. - Gets or sets a value that indicates whether transactions should be used - to insert logging events in the database. + All log events with lower level than the threshold level are ignored + by the appender. - When set a single transaction will be used to insert the buffered events - into the database. Otherwise each event will be inserted without using - an explicit transaction. + In configuration files this option is specified by setting the + value of the option to a level + string, such as "DEBUG", "INFO" and so on. - + - Gets or sets the used to call the NetSend method. + Gets or sets the for this appender. - - The used to call the NetSend method. - + The of the appender - Unless a specified here for this appender - the is queried for the - security context to use. The default behavior is to use the security context - of the current thread. + The provides a default + implementation for the property. - + - Should this appender try to reconnect to the database on error. + The filter chain. - - true if the appender should try to reconnect to the database after an - error has occurred, otherwise false. The default value is false, - i.e. not to try to reconnect. - + The head of the filter chain filter chain. - The default behaviour is for the appender not to try to reconnect to the - database if an error occurs. Subsequent logging events are discarded. - - - To force the appender to attempt to reconnect to the database set this - property to true. + Returns the head Filter. The Filters are organized in a linked list + and so all Filters on this Appender are available through the result. - - When the appender attempts to connect to the database there may be a - delay of up to the connection timeout specified in the connection string. - This delay will block the calling application's thread. - Until the connection can be reestablished this potential delay may occur multiple times. - - + - Gets or sets the underlying . + Gets or sets the for this appender. - - The underlying . - + The layout of the appender. - creates a to insert - logging events into a database. Classes deriving from - can use this property to get or set this . Use the - underlying returned from if - you require access beyond that which provides. + + See for more information. + + - + - Parameter type used by the . + Initialize the appender based on the options set - This class provides the basic database parameter properties - as defined by the interface. + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. - This type can be subclassed to provide database specific - functionality. The two methods that are called externally are - and . + + If any of the configuration properties are modified then + must be called again. - + - Initializes a new instance of the class. + Gets or sets the name of this appender. + The name of the appender. - Default constructor for the AdoNetAppenderParameter class. + + The name uniquely identifies the appender. + - + - Prepare the specified database command object. + Closes the appender and release resources. - The command to prepare. - Prepares the database command object by adding - this parameter to its collection of parameters. + Release any resources allocated within the appender such as file handles, + network connections, etc. + + + It is a programming error to append to a closed appender. + + + This method cannot be overridden by subclasses. This method + delegates the closing of the appender to the + method which must be overridden in the subclass. - + - Renders the logging event and set the parameter value in the command. + Performs threshold checks and invokes filters before + delegating actual logging to the subclasses specific + method. - The command containing the parameter. - The event to be rendered. + The event to log. - Renders the logging event using this parameters layout - object. Sets the value of the parameter on the command object. + This method cannot be overridden by derived classes. A + derived class should override the method + which is called by this method. + + + The implementation of this method is as follows: + + + + + + Checks that the severity of the + is greater than or equal to the of this + appender. + + + + Checks that the chain accepts the + . + + + + + Calls and checks that + it returns true. + + + + + If all of the above steps succeed then the + will be passed to the abstract method. - - - The name of this parameter. - - - - - The database type for this parameter. - - - - - Flag to infer type rather than use the DbType - - - + - The precision for this parameter. + Performs threshold checks and invokes filters before + delegating actual logging to the subclasses specific + method. + The array of events to log. + + + This method cannot be overridden by derived classes. A + derived class should override the method + which is called by this method. + + + The implementation of this method is as follows: + + + + + + Checks that the severity of the + is greater than or equal to the of this + appender. + + + + Checks that the chain accepts the + . + + + + + Calls and checks that + it returns true. + + + + + If all of the above steps succeed then the + will be passed to the method. + + - + - The scale for this parameter. + Test if the logging event should we output by this appender + the event to test + true if the event should be output, false if the event should be ignored + + + This method checks the logging event against the threshold level set + on this appender and also against the filters specified on this + appender. + + + The implementation of this method is as follows: + + + + + + Checks that the severity of the + is greater than or equal to the of this + appender. + + + + Checks that the chain accepts the + . + + + + + - + - The size for this parameter. + Adds a filter to the end of the filter chain. + the filter to add to this appender + + + The Filters are organized in a linked list. + + + Setting this property causes the new filter to be pushed onto the + back of the filter chain. + + - + - The to use to render the - logging event into an object for this parameter. + Clears the filter list for this appender. + + + Clears the filter list for this appender. + + - + - Gets or sets the name of this parameter. + Checks if the message level is below this appender's threshold. - - The name of this parameter. - + to test against. - The name of this parameter. The parameter name - must match up to a named parameter to the SQL stored procedure - or prepared statement. + If there is no threshold set, then the return value is always true. + + true if the meets the + requirements of this appender. + - + - Gets or sets the database type for this parameter. + Is called when the appender is closed. Derived classes should override + this method if resources need to be released. - - The database type for this parameter. - - The database type for this parameter. This property should - be set to the database type from the - enumeration. See . + Releases any resources allocated within the appender such as file handles, + network connections, etc. - This property is optional. If not specified the ADO.NET provider - will attempt to infer the type from the value. + It is a programming error to append to a closed appender. - - + - Gets or sets the precision for this parameter. + Subclasses of should implement this method + to perform actual logging. - - The precision for this parameter. - + The event to append. - The maximum number of digits used to represent the Value. + A subclass must implement this method to perform + logging of the . + + This method will be called by + if all the conditions listed for that method are met. - This property is optional. If not specified the ADO.NET provider - will attempt to infer the precision from the value. + To restrict the logging of events in the appender + override the method. - - + - Gets or sets the scale for this parameter. + Append a bulk array of logging events. - - The scale for this parameter. - + the array of logging events - The number of decimal places to which Value is resolved. + This base class implementation calls the + method for each element in the bulk array. - This property is optional. If not specified the ADO.NET provider - will attempt to infer the scale from the value. + A sub class that can better process a bulk array of events should + override this method in addition to . - - + - Gets or sets the size for this parameter. + Called before as a precondition. - - The size for this parameter. - - The maximum size, in bytes, of the data within the column. + This method is called by + before the call to the abstract method. - This property is optional. If not specified the ADO.NET provider - will attempt to infer the size from the value. + This method can be overridden in a subclass to extend the checks + made before the event is passed to the method. - For BLOB data types like VARCHAR(max) it may be impossible to infer the value automatically, use -1 as the size in this case. + A subclass should ensure that they delegate this call to + this base class if it is overridden. - + true if the call to should proceed. - + - Gets or sets the to use to - render the logging event into an object for this - parameter. + Renders the to a string. - - The used to render the - logging event into an object for this parameter. - + The event to render. + The event rendered as a string. - The that renders the value for this - parameter. + Helper method to render a to + a string. This appender must have a + set to render the to + a string. + + If there is exception data in the logging event and + the layout does not process the exception, this method + will append the exception text to the rendered string. - The can be used to adapt - any into a - for use in the property. + Where possible use the alternative version of this method + . + That method streams the rendering onto an existing Writer + which can give better performance if the caller already has + a open and ready for writing. - + - Appends logging events to the terminal using ANSI color escape sequences. + Renders the to a string. + The event to render. + The TextWriter to write the formatted event to - AnsiColorTerminalAppender appends log events to the standard output stream - or the error output stream using a layout specified by the - user. It also allows the color of a specific level of message to be set. + Helper method to render a to + a string. This appender must have a + set to render the to + a string. - - This appender expects the terminal to understand the VT100 control set - in order to interpret the color codes. If the terminal or console does not - understand the control codes the behavior is not defined. - - - By default, all output is written to the console's standard output stream. - The property can be set to direct the output to the - error stream. + If there is exception data in the logging event and + the layout does not process the exception, this method + will append the exception text to the rendered string. - NOTE: This appender writes each message to the System.Console.Out or - System.Console.Error that is set at the time the event is appended. - Therefore it is possible to programmatically redirect the output of this appender - (for example NUnit does this to capture program output). While this is the desired - behavior of this appender it may have security implications in your application. + Use this method in preference to + where possible. If, however, the caller needs to render the event + to a string then does + provide an efficient mechanism for doing so. + + + + + Tests if this appender requires a to be set. + + - When configuring the ANSI colored terminal appender, a mapping should be - specified to map a logging level to a color. For example: - - - - - - - - - - - - - - - The Level is the standard log4net logging level and ForeColor and BackColor can be any - of the following values: - - Blue - Green - Red - White - Yellow - Purple - Cyan - - These color values cannot be combined together to make new colors. + In the rather exceptional case, where the appender + implementation admits a layout but can also work without it, + then the appender should return true. - The attributes can be any combination of the following: - - Brightforeground is brighter - Dimforeground is dimmer - Underscoremessage is underlined - Blinkforeground is blinking (does not work on all terminals) - Reverseforeground and background are reversed - Hiddenoutput is hidden - Strikethroughmessage has a line through it - - While any of these attributes may be combined together not all combinations - work well together, for example setting both Bright and Dim attributes makes - no sense. + This default implementation always returns false. - Patrick Wagstrom - Nicko Cadell + + true if the appender requires a layout object, otherwise false. + - + - The to use when writing to the Console - standard output stream. + Flushes any buffered log data. - - The to use when writing to the Console - standard output stream. - + This implementation doesn't flush anything and always returns true + True if all logging events were flushed successfully, else false. - + - The to use when writing to the Console - standard error output stream. + The layout of this appender. - - The to use when writing to the Console - standard error output stream. - + See for more information. - - - Ansi code to reset terminal - - - + - Initializes a new instance of the class. + The name of this appender. - The instance of the class is set up to write - to the standard output stream. + See for more information. - + - Add a mapping of level to color + The level threshold of this appender. - The mapping to add - Add a mapping to this appender. - Each mapping defines the foreground and background colours - for a level. + There is no level threshold filtering by default. + + + See for more information. - + - This method is called by the method. + It is assumed and enforced that errorHandler is never null. - The event to log. - Writes the event to the console. + It is assumed and enforced that errorHandler is never null. - The format of the output will depend on the appender's layout. + See for more information. - + - Initialize the options for this appender + The first filter in the filter chain. - Initialize the level to color mappings set on this appender. + Set to null initially. - - - - - Flag to write output to the error stream rather than the standard output stream - - - - - Mapping from level object to color value - - - - - Target is the value of the console output stream. - - - Target is the value of the console output stream. - This is either "Console.Out" or "Console.Error". - - - Target is the value of the console output stream. - This is either "Console.Out" or "Console.Error". + See for more information. - + - This appender requires a to be set. + The last filter in the filter chain. - true - - This appender requires a to be set. - + See for more information. - + - The enum of possible display attributes + Flag indicating if this appender is closed. - - The following flags can be combined together to - form the ANSI color attributes. - + See for more information. - - - - - text is bright - - - - - text is dim - - + - text is underlined + The guard prevents an appender from repeatedly calling its own DoAppend method - + - text is blinking + StringWriter used to render events - - Not all terminals support this attribute - - + - text and background colors are reversed + Initial buffer size - + - text is hidden + Maximum buffer size before it is recycled - + - text is displayed with a strikethrough + The fully qualified type of the AppenderSkeleton class. + + Used by the internal logger to record the Type of the + log message. + - + - text color is light + + Appends log events to the ASP.NET system. + + + + Diagnostic information and tracing messages that you specify are appended to the output + of the page that is sent to the requesting browser. Optionally, you can view this information + from a separate trace viewer (Trace.axd) that displays trace information for every page in a + given application. + + + Trace statements are processed and displayed only when tracing is enabled. You can control + whether tracing is displayed to a page, to the trace viewer, or both. + + + The logging event is passed to the or + method depending on the level of the logging event. + The event's logger name is the default value for the category parameter of the Write/Warn method. + + + Nicko Cadell + Gert Driesen + Ron Grabowski - + - The enum of possible foreground or background color values for - use with the color mapping method + Initializes a new instance of the class. - The output can be in one for the following ANSI colors. + Default constructor. - - + - color is black + Write the logging event to the ASP.NET trace + the event to log + + + Write the logging event to the ASP.NET trace + HttpContext.Current.Trace + (). + + - + - color is red + This appender requires a to be set. + true + + + This appender requires a to be set. + + - + - color is green + The category parameter sent to the Trace method. + + + Defaults to %logger which will use the logger name of the current + as the category parameter. + + + + - + - color is yellow + Defaults to %logger - + - color is blue + Abstract base class implementation of that + buffers events in a fixed size buffer. - - + + + This base class should be used by appenders that need to buffer a + number of events before logging them. + For example the + buffers events and then submits the entire contents of the buffer to + the underlying database in one go. + + + Subclasses should override the + method to deliver the buffered events. + + The BufferingAppenderSkeleton maintains a fixed size cyclic + buffer of events. The size of the buffer is set using + the property. + + A is used to inspect + each event as it arrives in the appender. If the + triggers, then the current buffer is sent immediately + (see ). Otherwise the event + is stored in the buffer. For example, an evaluator can be used to + deliver the events immediately when an ERROR event arrives. + + + The buffering appender can be configured in a mode. + By default the appender is NOT lossy. When the buffer is full all + the buffered events are sent with . + If the property is set to true then the + buffer will not be sent when it is full, and new events arriving + in the appender will overwrite the oldest event in the buffer. + In lossy mode the buffer will only be sent when the + triggers. This can be useful behavior when you need to know about + ERROR events but not about events with a lower level, configure an + evaluator that will trigger when an ERROR event arrives, the whole + buffer will be sent which gives a history of events leading up to + the ERROR event. + + + Nicko Cadell + Gert Driesen + + - color is magenta + Initializes a new instance of the class. + + + Protected default constructor to allow subclassing. + + - + - color is cyan + Initializes a new instance of the class. + the events passed through this appender must be + fixed by the time that they arrive in the derived class' SendBuffer method. + + + Protected constructor to allow subclassing. + + + The should be set if the subclass + expects the events delivered to be fixed even if the + is set to zero, i.e. when no buffering occurs. + + - + - color is white + Gets or sets a value that indicates whether the appender is lossy. + + true if the appender is lossy, otherwise false. The default is false. + + + + This appender uses a buffer to store logging events before + delivering them. A triggering event causes the whole buffer + to be send to the remote sink. If the buffer overruns before + a triggering event then logging events could be lost. Set + to false to prevent logging events + from being lost. + + If is set to true then an + must be specified. + - + - A class to act as a mapping between the level that a logging call is made at and - the color it should be displayed as. + Gets or sets the size of the cyclic buffer used to hold the + logging events. + + The size of the cyclic buffer used to hold the logging events. + - Defines the mapping between a level and the color it should be displayed in. + The option takes a positive integer + representing the maximum number of logging events to collect in + a cyclic buffer. When the is reached, + oldest events are deleted as new events are added to the + buffer. By default the size of the cyclic buffer is 512 events. + + + If the is set to a value less than + or equal to 1 then no buffering will occur. The logging event + will be delivered synchronously (depending on the + and properties). Otherwise the event will + be buffered. - + - An entry in the + Gets or sets the that causes the + buffer to be sent immediately. + + The that causes the buffer to be + sent immediately. + - This is an abstract base class for types that are stored in the - object. + The evaluator will be called for each event that is appended to this + appender. If the evaluator triggers then the current buffer will + immediately be sent (see ). + If is set to true then an + must be specified. - Nicko Cadell - + - Default protected constructor + Gets or sets the value of the to use. + + The value of the to use. + - Default protected constructor + The evaluator will be called for each event that is discarded from this + appender. If the evaluator triggers then the current buffer will immediately + be sent (see ). - + - Initialize any options defined on this entry + Gets or sets a value indicating if only part of the logging event data + should be fixed. + + true if the appender should only fix part of the logging event + data, otherwise false. The default is false. + - Should be overridden by any classes that need to initialise based on their options + Setting this property to true will cause only part of the + event data to be fixed and serialized. This will improve performance. + + + See for more information. - + - The level that is the key for this mapping + Gets or sets a the fields that will be fixed in the event - The that is the key for this mapping + The event fields that will be fixed before the event is buffered - Get or set the that is the key for this - mapping subclass. + The logging event needs to have certain thread specific values + captured before it can be buffered. See + for details. + - + - Initialize the options for the object + Flushes any buffered log data. + + The maximum time to wait for logging events to be flushed. + True if all logging events were flushed successfully, else false. + + + + Flush the currently buffered events - Combine the and together - and append the attributes. + Flushes any events that have been buffered. + + + If the appender is buffering in mode then the contents + of the buffer will NOT be flushed to the appender. - + - The mapped foreground color for the specified level + Flush the currently buffered events + set to true to flush the buffer of lossy events - Required property. - The mapped foreground color for the specified level + Flushes events that have been buffered. If is + false then events will only be flushed if this buffer is non-lossy mode. + + + If the appender is buffering in mode then the contents + of the buffer will only be flushed if is true. + In this case the contents of the buffer will be tested against the + and if triggering will be output. All other buffered + events will be discarded. + + + If is true then the buffer will always + be emptied by calling this method. - + - The mapped background color for the specified level + Initialize the appender based on the options set - Required property. - The mapped background color for the specified level + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. - + - The color attributes for the specified level + Close this appender instance. - Required property. - The color attributes for the specified level + Close this appender instance. If this appender is marked + as not then the remaining events in + the buffer must be sent when the appender is closed. - + - The combined , and - suitable for setting the ansi terminal color. + This method is called by the method. + the event to log + + + Stores the in the cyclic buffer. + + + The buffer will be sent (i.e. passed to the + method) if one of the following conditions is met: + + + + The cyclic buffer is full and this appender is + marked as not lossy (see ) + + + An is set and + it is triggered for the + specified. + + + + Before the event is stored in the buffer it is fixed + (see ) to ensure that + any data referenced by the event will be valid when the buffer + is processed. + + - + - A strongly-typed collection of objects. + Sends the contents of the buffer. - Nicko Cadell + The first logging event. + The buffer containing the events that need to be send. + + + The subclass must override . + + - + - Creates a read-only wrapper for a AppenderCollection instance. + Sends the events. - list to create a readonly wrapper arround - - An AppenderCollection wrapper that is read-only. - + The events that need to be send. + + + The subclass must override this method to process the buffered events. + + - + - An empty readonly static AppenderCollection + The default buffer size. + + The default size of the cyclic buffer used to store events. + This is set to 512 by default. + - + - Initializes a new instance of the AppenderCollection class - that is empty and has the default initial capacity. + The size of the cyclic buffer used to hold the logging events. + + Set to by default. + - + - Initializes a new instance of the AppenderCollection class - that has the specified initial capacity. + The cyclic buffer used to store the logging events. - - The number of elements that the new AppenderCollection is initially capable of storing. - - + - Initializes a new instance of the AppenderCollection class - that contains elements copied from the specified AppenderCollection. + The triggering event evaluator that causes the buffer to be sent immediately. - The AppenderCollection whose elements are copied to the new collection. + + The object that is used to determine if an event causes the entire + buffer to be sent immediately. This field can be null, which + indicates that event triggering is not to be done. The evaluator + can be set using the property. If this appender + has the ( property) set to + true then an must be set. + - + - Initializes a new instance of the AppenderCollection class - that contains elements copied from the specified array. + Indicates if the appender should overwrite events in the cyclic buffer + when it becomes full, or if the buffer should be flushed when the + buffer is full. - The array whose elements are copied to the new list. + + If this field is set to true then an must + be set. + - + - Initializes a new instance of the AppenderCollection class - that contains elements copied from the specified collection. + The triggering event evaluator filters discarded events. - The collection whose elements are copied to the new list. + + The object that is used to determine if an event that is discarded should + really be discarded or if it should be sent to the appenders. + This field can be null, which indicates that all discarded events will + be discarded. + - + - Allow subclasses to avoid our default constructors + Value indicating which fields in the event should be fixed - - + + By default all fields are fixed + - + - Copies the entire AppenderCollection to a one-dimensional - array. + The events delivered to the subclass must be fixed. - The one-dimensional array to copy to. - + - Copies the entire AppenderCollection to a one-dimensional - array, starting at the specified index of the target array. + Buffers events and then forwards them to attached appenders. - The one-dimensional array to copy to. - The zero-based index in at which copying begins. + + + The events are buffered in this appender until conditions are + met to allow the appender to deliver the events to the attached + appenders. See for the + conditions that cause the buffer to be sent. + + The forwarding appender can be used to specify different + thresholds and filters for the same appender at different locations + within the hierarchy. + + + Nicko Cadell + Gert Driesen - + - Adds a to the end of the AppenderCollection. + Initializes a new instance of the class. - The to be added to the end of the AppenderCollection. - The index at which the value has been added. + + + Default constructor. + + - + - Removes all elements from the AppenderCollection. + Closes the appender and releases resources. + + + Releases any resources allocated within the appender such as file handles, + network connections, etc. + + + It is a programming error to append to a closed appender. + + - + - Creates a shallow copy of the . + Send the events. - A new with a shallow copy of the collection data. + The events that need to be send. + + + Forwards the events to the attached appenders. + + - + - Determines whether a given is in the AppenderCollection. + Adds an to the list of appenders of this + instance. - The to check for. - true if is found in the AppenderCollection; otherwise, false. + The to add to this appender. + + + If the specified is already in the list of + appenders, then it won't be added again. + + - + - Returns the zero-based index of the first occurrence of a - in the AppenderCollection. + Gets the appenders contained in this appender as an + . - The to locate in the AppenderCollection. + + If no appenders can be found, then an + is returned. + - The zero-based index of the first occurrence of - in the entire AppenderCollection, if found; otherwise, -1. + A collection of the appenders in this appender. - - - Inserts an element into the AppenderCollection at the specified index. - - The zero-based index at which should be inserted. - The to insert. - - is less than zero - -or- - is equal to or greater than . - - - - - Removes the first occurrence of a specific from the AppenderCollection. - - The to remove from the AppenderCollection. - - The specified was not found in the AppenderCollection. - - - + - Removes the element at the specified index of the AppenderCollection. + Looks for the appender with the specified name. - The zero-based index of the element to remove. - - is less than zero - -or- - is equal to or greater than . - + The name of the appender to lookup. + + The appender with the specified name, or null. + + + + Get the named appender attached to this buffering appender. + + - + - Returns an enumerator that can iterate through the AppenderCollection. + Removes all previously added appenders from this appender. - An for the entire AppenderCollection. + + + This is useful when re-reading configuration information. + + - + - Adds the elements of another AppenderCollection to the current AppenderCollection. + Removes the specified appender from the list of appenders. - The AppenderCollection whose elements should be added to the end of the current AppenderCollection. - The new of the AppenderCollection. + The appender to remove. + The appender removed from the list + + The appender removed is not closed. + If you are discarding the appender you must call + on the appender removed. + - + - Adds the elements of a array to the current AppenderCollection. + Removes the appender with the specified name from the list of appenders. - The array whose elements should be added to the end of the AppenderCollection. - The new of the AppenderCollection. + The name of the appender to remove. + The appender removed from the list + + The appender removed is not closed. + If you are discarding the appender you must call + on the appender removed. + - + - Adds the elements of a collection to the current AppenderCollection. + Implementation of the interface - The collection whose elements should be added to the end of the AppenderCollection. - The new of the AppenderCollection. - + - Sets the capacity to the actual number of elements. + Appends logging events to the console. + + + ColoredConsoleAppender appends log events to the standard output stream + or the error output stream using a layout specified by the + user. It also allows the color of a specific type of message to be set. + + + By default, all output is written to the console's standard output stream. + The property can be set to direct the output to the + error stream. + + + NOTE: This appender writes directly to the application's attached console + not to the System.Console.Out or System.Console.Error TextWriter. + The System.Console.Out and System.Console.Error streams can be + programmatically redirected (for example NUnit does this to capture program output). + This appender will ignore these redirections because it needs to use Win32 + API calls to colorize the output. To respect these redirections the + must be used. + + + When configuring the colored console appender, mapping should be + specified to map a logging level to a color. For example: + + + + + + + + + + + + + + The Level is the standard log4net logging level and ForeColor and BackColor can be any + combination of the following values: + + Blue + Green + Red + White + Yellow + Purple + Cyan + HighIntensity + + + + Rick Hobbs + Nicko Cadell - - - Return the collection elements as an array - - the array - - - - is less than zero - -or- - is equal to or greater than . - - - - - is less than zero - -or- - is equal to or greater than . - - - - - Gets the number of elements actually contained in the AppenderCollection. - - - - - Gets a value indicating whether access to the collection is synchronized (thread-safe). - - false, because the backing type is an array, which is never thread-safe. - - - - Gets an object that can be used to synchronize access to the collection. - - - - - Gets or sets the at the specified index. - - The zero-based index of the element to get or set. - - is less than zero - -or- - is equal to or greater than . - - - - - Gets a value indicating whether the collection has a fixed size. - - true if the collection has a fixed size; otherwise, false. The default is false - - - - Gets a value indicating whether the IList is read-only. - - true if the collection is read-only; otherwise, false. The default is false - - + - Gets or sets the number of elements the AppenderCollection can contain. + The enum of possible color values for use with the color mapping method + + + The following flags can be combined together to + form the colors. + + + - + - Supports type-safe iteration over a . + color is blue - - + - Advances the enumerator to the next element in the collection. + color is green - - true if the enumerator was successfully advanced to the next element; - false if the enumerator has passed the end of the collection. - - - The collection was modified after the enumerator was created. - - + - Sets the enumerator to its initial position, before the first element in the collection. + color is red - + - Gets the current element in the collection. + color is white - + - Type visible only to our subclasses - Used to access protected constructor + color is yellow - - + - A value + color is purple - + - Supports simple iteration over a . + color is cyan - - + - Initializes a new instance of the Enumerator class. + color is intensified - - + - Advances the enumerator to the next element in the collection. + Initializes a new instance of the class. - - true if the enumerator was successfully advanced to the next element; - false if the enumerator has passed the end of the collection. - - - The collection was modified after the enumerator was created. - + + The instance of the class is set up to write + to the standard output stream. + - + - Sets the enumerator to its initial position, before the first element in the collection. + Initializes a new instance of the class + with the specified layout. + the layout to use for this appender + + The instance of the class is set up to write + to the standard output stream. + - + - Gets the current element in the collection. + Initializes a new instance of the class + with the specified layout. + the layout to use for this appender + flag set to true to write to the console error stream + + When is set to true, output is written to + the standard error output stream. Otherwise, output is written to the standard + output stream. + - - - - + - - Appends log events to the ASP.NET system. - + Target is the value of the console output stream. + This is either "Console.Out" or "Console.Error". + + Target is the value of the console output stream. + This is either "Console.Out" or "Console.Error". + - Diagnostic information and tracing messages that you specify are appended to the output - of the page that is sent to the requesting browser. Optionally, you can view this information - from a separate trace viewer (Trace.axd) that displays trace information for every page in a - given application. - - - Trace statements are processed and displayed only when tracing is enabled. You can control - whether tracing is displayed to a page, to the trace viewer, or both. - - - The logging event is passed to the or - method depending on the level of the logging event. - The event's logger name is the default value for the category parameter of the Write/Warn method. + Target is the value of the console output stream. + This is either "Console.Out" or "Console.Error". - Nicko Cadell - Gert Driesen - Ron Grabowski - + - Initializes a new instance of the class. + Add a mapping of level to color - done by the config file + The mapping to add - Default constructor. + Add a mapping to this appender. + Each mapping defines the foreground and background colors + for a level. - + - Write the logging event to the ASP.NET trace + This method is called by the method. - the event to log + The event to log. - Write the logging event to the ASP.NET trace - HttpContext.Current.Trace - (). + Writes the event to the console. + + + The format of the output will depend on the appender's layout. - - - Defaults to %logger - - - + This appender requires a to be set. @@ -2560,1616 +2718,1382 @@ - + - The category parameter sent to the Trace method. + Initialize the options for this appender - Defaults to %logger which will use the logger name of the current - as the category parameter. + Initialize the level to color mappings set on this appender. - - - + - Buffers events and then forwards them to attached appenders. + The to use when writing to the Console + standard output stream. - The events are buffered in this appender until conditions are - met to allow the appender to deliver the events to the attached - appenders. See for the - conditions that cause the buffer to be sent. - - The forwarding appender can be used to specify different - thresholds and filters for the same appender at different locations - within the hierarchy. + The to use when writing to the Console + standard output stream. - Nicko Cadell - Gert Driesen - + - Interface for attaching appenders to objects. + The to use when writing to the Console + standard error output stream. - Interface for attaching, removing and retrieving appenders. + The to use when writing to the Console + standard error output stream. - Nicko Cadell - Gert Driesen - + - Attaches an appender. + Flag to write output to the error stream rather than the standard output stream + + + + + Mapping from level object to color value + + + + + The console output stream writer to write to - The appender to add. - Add the specified appender. The implementation may - choose to allow or deny duplicate appenders. + This writer is not thread safe. - + - Gets an attached appender with the specified name. + A class to act as a mapping between the level that a logging call is made at and + the color it should be displayed as. - The name of the appender to get. - - The appender with the name specified, or null if no appender with the - specified name is found. - - Returns an attached appender with the specified. - If no appender with the specified name is found null will be - returned. + Defines the mapping between a level and the color it should be displayed in. - + - Removes all attached appenders. + The mapped foreground color for the specified level - Removes and closes all attached appenders + Required property. + The mapped foreground color for the specified level. - + - Removes the specified appender from the list of attached appenders. + The mapped background color for the specified level - The appender to remove. - The appender removed from the list - The appender removed is not closed. - If you are discarding the appender you must call - on the appender removed. + Required property. + The mapped background color for the specified level. - + - Removes the appender with the specified name from the list of appenders. + Initialize the options for the object - The name of the appender to remove. - The appender removed from the list - The appender removed is not closed. - If you are discarding the appender you must call - on the appender removed. + Combine the and together. - + - Gets all attached appenders. + The combined and suitable for + setting the console color. + + + + + Appends logging events to the console. - - A collection of attached appenders. - - Gets a collection of attached appenders. - If there are no attached appenders the - implementation should return an empty - collection rather than null. + ConsoleAppender appends log events to the standard output stream + or the error output stream using a layout specified by the + user. + + + By default, all output is written to the console's standard output stream. + The property can be set to direct the output to the + error stream. + + + NOTE: This appender writes each message to the System.Console.Out or + System.Console.Error that is set at the time the event is appended. + Therefore it is possible to programmatically redirect the output of this appender + (for example NUnit does this to capture program output). While this is the desired + behavior of this appender it may have security implications in your application. + Nicko Cadell + Gert Driesen - + - Initializes a new instance of the class. + Initializes a new instance of the class. - - Default constructor. - + The instance of the class is set up to write + to the standard output stream. - + - Closes the appender and releases resources. + Initializes a new instance of the class + with the specified layout. + the layout to use for this appender - - Releases any resources allocated within the appender such as file handles, - network connections, etc. - - - It is a programming error to append to a closed appender. - + The instance of the class is set up to write + to the standard output stream. - + - Send the events. + Initializes a new instance of the class + with the specified layout. - The events that need to be send. + the layout to use for this appender + flag set to true to write to the console error stream + + When is set to true, output is written to + the standard error output stream. Otherwise, output is written to the standard + output stream. + + + + + Target is the value of the console output stream. + This is either "Console.Out" or "Console.Error". + + + Target is the value of the console output stream. + This is either "Console.Out" or "Console.Error". + - Forwards the events to the attached appenders. + Target is the value of the console output stream. + This is either "Console.Out" or "Console.Error". - + - Adds an to the list of appenders of this - instance. + This method is called by the method. - The to add to this appender. + The event to log. - If the specified is already in the list of - appenders, then it won't be added again. + Writes the event to the console. + + + The format of the output will depend on the appender's layout. - + - Looks for the appender with the specified name. + This appender requires a to be set. - The name of the appender to lookup. - - The appender with the specified name, or null. - + true - Get the named appender attached to this buffering appender. + This appender requires a to be set. - + - Removes all previously added appenders from this appender. + The to use when writing to the Console + standard output stream. - This is useful when re-reading configuration information. + The to use when writing to the Console + standard output stream. - + - Removes the specified appender from the list of appenders. + The to use when writing to the Console + standard error output stream. - The appender to remove. - The appender removed from the list - The appender removed is not closed. - If you are discarding the appender you must call - on the appender removed. + + The to use when writing to the Console + standard error output stream. + - + - Removes the appender with the specified name from the list of appenders. + Appends log events to the system. - The name of the appender to remove. - The appender removed from the list - The appender removed is not closed. - If you are discarding the appender you must call - on the appender removed. + + The application configuration file can be used to control what listeners + are actually used. See the MSDN documentation for the + class for details on configuring the + debug system. + + + Events are written using the + method. The event's logger name is passed as the value for the category name to the Write method. + + Nicko Cadell - + - Implementation of the interface + Initializes a new instance of the . + + + Default constructor. + + - + - Gets the appenders contained in this appender as an - . + Initializes a new instance of the + with a specified layout. + The layout to use with this appender. - If no appenders can be found, then an - is returned. + + Obsolete constructor. + - - A collection of the appenders in this appender. - - + - Appends logging events to the console. + Gets or sets a value that indicates whether the appender will + flush at the end of each write. + The default behavior is to flush at the end of each + write. If the option is set tofalse, then the underlying + stream can defer writing to physical medium to a later time. + - ColoredConsoleAppender appends log events to the standard output stream - or the error output stream using a layout specified by the - user. It also allows the color of a specific type of message to be set. - - - By default, all output is written to the console's standard output stream. - The property can be set to direct the output to the - error stream. - - - NOTE: This appender writes directly to the application's attached console - not to the System.Console.Out or System.Console.Error TextWriter. - The System.Console.Out and System.Console.Error streams can be - programmatically redirected (for example NUnit does this to capture program output). - This appender will ignore these redirections because it needs to use Win32 - API calls to colorize the output. To respect these redirections the - must be used. + Avoiding the flush operation at the end of each append results + in a performance gain of 10 to 20 percent. However, there is safety + trade-off involved in skipping flushing. Indeed, when flushing is + skipped, then it is likely that the last few log events will not + be recorded on disk when the application exits. This is a high + price to pay even for a 20% performance gain. + + + + + Formats the category parameter sent to the Debug method. + + - When configuring the colored console appender, mapping should be - specified to map a logging level to a color. For example: + Defaults to a with %logger as the pattern which will use the logger name of the current + as the category parameter. - - - - - - - - - - - - The Level is the standard log4net logging level and ForeColor and BackColor can be any - combination of the following values: - - Blue - Green - Red - White - Yellow - Purple - Cyan - HighIntensity - - + - Rick Hobbs - Nicko Cadell - + - The to use when writing to the Console - standard output stream. + Flushes any buffered log data. + + The maximum time to wait for logging events to be flushed. + True if all logging events were flushed successfully, else false. + + + + Writes the logging event to the system. + The event to log. - The to use when writing to the Console - standard output stream. + Writes the logging event to the system. + If is true then the + is called. - + - + - The to use when writing to the Console - standard error output stream. + This appender requires a to be set. + true - The to use when writing to the Console - standard error output stream. + This appender requires a to be set. - + - Initializes a new instance of the class. + Immediate flush means that the underlying writer or output stream + will be flushed at the end of each append operation. - The instance of the class is set up to write - to the standard output stream. + + Immediate flush is slower but ensures that each append request is + actually written. If is set to + false, then there is a good chance that the last few + logs events are not actually written to persistent media if and + when the application crashes. + + + The default value is true. - + - Initializes a new instance of the class - with the specified layout. + Defaults to a with %logger as the pattern. - the layout to use for this appender - - The instance of the class is set up to write - to the standard output stream. - - + - Initializes a new instance of the class - with the specified layout. + Writes events to the system event log. - the layout to use for this appender - flag set to true to write to the console error stream - When is set to true, output is written to - the standard error output stream. Otherwise, output is written to the standard - output stream. + + The appender will fail if you try to write using an event source that doesn't exist unless it is running with local administrator privileges. + See also http://logging.apache.org/log4net/release/faq.html#trouble-EventLog + + + The EventID of the event log entry can be + set using the EventID property () + on the . + + + The Category of the event log entry can be + set using the Category property () + on the . + + + There is a limit of 32K characters for an event log message + + + When configuring the EventLogAppender a mapping can be + specified to map a logging level to an event log entry type. For example: + + + <mapping> + <level value="ERROR" /> + <eventLogEntryType value="Error" /> + </mapping> + <mapping> + <level value="DEBUG" /> + <eventLogEntryType value="Information" /> + </mapping> + + + The Level is the standard log4net logging level and eventLogEntryType can be any value + from the enum, i.e.: + + Erroran error event + Warninga warning event + Informationan informational event + + + Aspi Havewala + Douglas de la Torre + Nicko Cadell + Gert Driesen + Thomas Voss - + - Add a mapping of level to color - done by the config file + Initializes a new instance of the class. - The mapping to add - Add a mapping to this appender. - Each mapping defines the foreground and background colors - for a level. + Default constructor. - + - This method is called by the method. + Initializes a new instance of the class + with the specified . - The event to log. + The to use with this appender. - Writes the event to the console. - - - The format of the output will depend on the appender's layout. + Obsolete constructor. - + - Initialize the options for this appender + The name of the log where messages will be stored. + + The string name of the log where messages will be stored. + - - Initialize the level to color mappings set on this appender. + This is the name of the log as it appears in the Event Viewer + tree. The default value is to log into the Application + log, this is where most applications write their events. However + if you need a separate log for your application (or applications) + then you should set the appropriately. + This should not be used to distinguish your event log messages + from those of other applications, the + property should be used to distinguish events. This property should be + used to group together events into a single log. - + - Flag to write output to the error stream rather than the standard output stream + Property used to set the Application name. This appears in the + event logs when logging. + + The string used to distinguish events from different sources. + + + Sets the event log source property. + - + - Mapping from level object to color value + This property is used to return the name of the computer to use + when accessing the event logs. Currently, this is the current + computer, denoted by a dot "." + + The string name of the machine holding the event log that + will be logged into. + + + This property cannot be changed. It is currently set to '.' + i.e. the local machine. This may be changed in future. + - + - The console output stream writer to write to + Add a mapping of level to - done by the config file + The mapping to add - This writer is not thread safe. + Add a mapping to this appender. + Each mapping defines the event log entry type for a level. - + - Target is the value of the console output stream. - This is either "Console.Out" or "Console.Error". + Gets or sets the used to write to the EventLog. - Target is the value of the console output stream. - This is either "Console.Out" or "Console.Error". + The used to write to the EventLog. - Target is the value of the console output stream. - This is either "Console.Out" or "Console.Error". + The system security context used to write to the EventLog. + + + Unless a specified here for this appender + the is queried for the + security context to use. The default behavior is to use the security context + of the current thread. - + - This appender requires a to be set. + Gets or sets the EventId to use unless one is explicitly specified via the LoggingEvent's properties. - true - This appender requires a to be set. + The EventID of the event log entry will normally be + set using the EventID property () + on the . + This property provides the fallback value which defaults to 0. - + - The enum of possible color values for use with the color mapping method + Gets or sets the Category to use unless one is explicitly specified via the LoggingEvent's properties. - The following flags can be combined together to - form the colors. - + The Category of the event log entry will normally be + set using the Category property () + on the . + This property provides the fallback value which defaults to 0. + - - - - - color is blue - - - - - color is green - - - - - color is red - - - - - color is white - - - - - color is yellow - - - - - color is purple - - - - - color is cyan - - - - color is intensified - - - + - A class to act as a mapping between the level that a logging call is made at and - the color it should be displayed as. + Initialize the appender based on the options set - Defines the mapping between a level and the color it should be displayed in. + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. - + - Initialize the options for the object + Create an event log source - - Combine the and together. - + Uses different API calls under NET_2_0 - + - The mapped foreground color for the specified level + This method is called by the + method. + the event to log + Writes the event to the system event log using the + . + + If the event has an EventID property (see ) + set then this integer will be used as the event log event id. + - Required property. - The mapped foreground color for the specified level. + There is a limit of 32K characters for an event log message - + - The mapped background color for the specified level + This appender requires a to be set. + true - Required property. - The mapped background color for the specified level. + This appender requires a to be set. - - - The combined and suitable for - setting the console color. - - - + - Appends logging events to the console. + Get the equivalent for a + the Level to convert to an EventLogEntryType + The equivalent for a - - ConsoleAppender appends log events to the standard output stream - or the error output stream using a layout specified by the - user. - - - By default, all output is written to the console's standard output stream. - The property can be set to direct the output to the - error stream. - - - NOTE: This appender writes each message to the System.Console.Out or - System.Console.Error that is set at the time the event is appended. - Therefore it is possible to programmatically redirect the output of this appender - (for example NUnit does this to capture program output). While this is the desired - behavior of this appender it may have security implications in your application. - + Because there are fewer applicable + values to use in logging levels than there are in the + this is a one way mapping. There is + a loss of information during the conversion. - Nicko Cadell - Gert Driesen - + - The to use when writing to the Console - standard output stream. + The log name is the section in the event logs where the messages + are stored. - - - The to use when writing to the Console - standard output stream. - - - + - The to use when writing to the Console - standard error output stream. + Name of the application to use when logging. This appears in the + application column of the event log named by . - - - The to use when writing to the Console - standard error output stream. - - - + - Initializes a new instance of the class. + The name of the machine which holds the event log. This is + currently only allowed to be '.' i.e. the current machine. - - The instance of the class is set up to write - to the standard output stream. - - + - Initializes a new instance of the class - with the specified layout. + Mapping from level object to EventLogEntryType - the layout to use for this appender - - The instance of the class is set up to write - to the standard output stream. - - + - Initializes a new instance of the class - with the specified layout. + The security context to use for privileged calls - the layout to use for this appender - flag set to true to write to the console error stream - - When is set to true, output is written to - the standard error output stream. Otherwise, output is written to the standard - output stream. - - + - This method is called by the method. + The event ID to use unless one is explicitly specified via the LoggingEvent's properties. - The event to log. - - - Writes the event to the console. - - - The format of the output will depend on the appender's layout. - - - + - Target is the value of the console output stream. - This is either "Console.Out" or "Console.Error". + The event category to use unless one is explicitly specified via the LoggingEvent's properties. - - Target is the value of the console output stream. - This is either "Console.Out" or "Console.Error". - - - - Target is the value of the console output stream. - This is either "Console.Out" or "Console.Error". - - - + - This appender requires a to be set. + A class to act as a mapping between the level that a logging call is made at and + the color it should be displayed as. - true - This appender requires a to be set. + Defines the mapping between a level and its event log entry type. - + - Appends log events to the system. + The for this entry - The application configuration file can be used to control what listeners - are actually used. See the MSDN documentation for the - class for details on configuring the - debug system. - - - Events are written using the - method. The event's logger name is passed as the value for the category name to the Write method. + Required property. + The for this entry - Nicko Cadell - + - Initializes a new instance of the . + The fully qualified type of the EventLogAppender class. - - Default constructor. - + Used by the internal logger to record the Type of the + log message. - + - Initializes a new instance of the - with a specified layout. + The maximum size supported by default. - The layout to use with this appender. - - Obsolete constructor. - + http://msdn.microsoft.com/en-us/library/xzwc042w(v=vs.100).aspx + The 32766 documented max size is two bytes shy of 32K (I'm assuming 32766 + may leave space for a two byte null terminator of #0#0). The 32766 max + length is what the .NET 4.0 source code checks for, but this is WRONG! + Strings with a length > 31839 on Windows Vista or higher can CORRUPT + the event log! See: System.Diagnostics.EventLogInternal.InternalWriteEvent() + for the use of the 32766 max size. - + - Flushes any buffered log data. + The maximum size supported by a windows operating system that is vista + or newer. - The maximum time to wait for logging events to be flushed. - True if all logging events were flushed successfully, else false. + + See ReportEvent API: + http://msdn.microsoft.com/en-us/library/aa363679(VS.85).aspx + ReportEvent's lpStrings parameter: + "A pointer to a buffer containing an array of + null-terminated strings that are merged into the message before Event Viewer + displays the string to the user. This parameter must be a valid pointer + (or NULL), even if wNumStrings is zero. Each string is limited to 31,839 characters." + + Going beyond the size of 31839 will (at some point) corrupt the event log on Windows + Vista or higher! It may succeed for a while...but you will eventually run into the + error: "System.ComponentModel.Win32Exception : A device attached to the system is + not functioning", and the event log will then be corrupt (I was able to corrupt + an event log using a length of 31877 on Windows 7). + + The max size for Windows Vista or higher is documented here: + http://msdn.microsoft.com/en-us/library/xzwc042w(v=vs.100).aspx. + Going over this size may succeed a few times but the buffer will overrun and + eventually corrupt the log (based on testing). + + The maxEventMsgSize size is based on the max buffer size of the lpStrings parameter of the ReportEvent API. + The documented max size for EventLog.WriteEntry for Windows Vista and higher is 31839, but I'm leaving room for a + terminator of #0#0, as we cannot see the source of ReportEvent (though we could use an API monitor to examine the + buffer, given enough time). + - + - Writes the logging event to the system. + The maximum size that the operating system supports for + a event log message. - The event to log. - - Writes the logging event to the system. - If is true then the - is called. - + Used to determine the maximum string length that can be written + to the operating system event log and eventually truncate a string + that exceeds the limits. - + - Immediate flush means that the underlying writer or output stream - will be flushed at the end of each append operation. + This method determines the maximum event log message size allowed for + the current environment. + + + + + + Appends logging events to a file. - Immediate flush is slower but ensures that each append request is - actually written. If is set to - false, then there is a good chance that the last few - logs events are not actually written to persistent media if and - when the application crashes. + Logging events are sent to the file specified by + the property. - The default value is true. + The file can be opened in either append or overwrite mode + by specifying the property. + If the file path is relative it is taken as relative from + the application base directory. The file encoding can be + specified by setting the property. + + + The layout's and + values will be written each time the file is opened and closed + respectively. If the property is + then the file may contain multiple copies of the header and footer. + + + This appender will first try to open the file for writing when + is called. This will typically be during configuration. + If the file cannot be opened for writing the appender will attempt + to open the file again each time a message is logged to the appender. + If the file cannot be opened for writing when a message is logged then + the message will be discarded by this appender. + + + The supports pluggable file locking models via + the property. + The default behavior, implemented by + is to obtain an exclusive write lock on the file until this appender is closed. + The alternative models only hold a + write lock while the appender is writing a logging event () + or synchronize by using a named system wide Mutex (). + + + All locking strategies have issues and you should seriously consider using a different strategy that + avoids having multiple processes logging to the same file. + + Nicko Cadell + Gert Driesen + Rodrigo B. de Oliveira + Douglas de la Torre + Niall Daley - + - Defaults to a with %logger as the pattern. + Write only that uses the + to manage access to an underlying resource. - + - Gets or sets a value that indicates whether the appender will - flush at the end of each write. + True asynchronous writes are not supported, the implementation forces a synchronous write. - - The default behavior is to flush at the end of each - write. If the option is set tofalse, then the underlying - stream can defer writing to physical medium to a later time. - - - Avoiding the flush operation at the end of each append results - in a performance gain of 10 to 20 percent. However, there is safety - trade-off involved in skipping flushing. Indeed, when flushing is - skipped, then it is likely that the last few log events will not - be recorded on disk when the application exits. This is a high - price to pay even for a 20% performance gain. - - - + - Formats the category parameter sent to the Debug method. + Locking model base class - Defaults to a with %logger as the pattern which will use the logger name of the current - as the category parameter. + Base class for the locking models available to the derived loggers. - - - + - This appender requires a to be set. + Open the output file - true + The filename to use + Whether to append to the file, or overwrite + The encoding to use - This appender requires a to be set. + Open the file specified and prepare for logging. + No writes will be made until is called. + Must be called before any calls to , + and . - + - Writes events to the system event log. + Close the file - The appender will fail if you try to write using an event source that doesn't exist unless it is running with local administrator privileges. - See also http://logging.apache.org/log4net/release/faq.html#trouble-EventLog - - - The EventID of the event log entry can be - set using the EventID property () - on the . - - - The Category of the event log entry can be - set using the Category property () - on the . - - - There is a limit of 32K characters for an event log message - - - When configuring the EventLogAppender a mapping can be - specified to map a logging level to an event log entry type. For example: - - - <mapping> - <level value="ERROR" /> - <eventLogEntryType value="Error" /> - </mapping> - <mapping> - <level value="DEBUG" /> - <eventLogEntryType value="Information" /> - </mapping> - - - The Level is the standard log4net logging level and eventLogEntryType can be any value - from the enum, i.e.: - - Erroran error event - Warninga warning event - Informationan informational event - + Close the file. No further writes will be made. - Aspi Havewala - Douglas de la Torre - Nicko Cadell - Gert Driesen - Thomas Voss - + + + Initializes all resources used by this locking model. + + + - Initializes a new instance of the class. + Disposes all resources that were initialized by this locking model. + + + + + Acquire the lock on the file + A stream that is ready to be written to. - Default constructor. + Acquire the lock on the file in preparation for writing to it. + Return a stream pointing to the file. + must be called to release the lock on the output file. - + - Initializes a new instance of the class - with the specified . + Release the lock on the file - The to use with this appender. - Obsolete constructor. + Release the lock on the file. No further writes will be made to the + stream until is called again. - + - Add a mapping of level to - done by the config file + Gets or sets the for this LockingModel - The mapping to add + + The for this LockingModel + - Add a mapping to this appender. - Each mapping defines the event log entry type for a level. + The file appender this locking model is attached to and working on + behalf of. + + + The file appender is used to locate the security context and the error handler to use. + + + The value of this property will be set before is + called. - + - Initialize the appender based on the options set + Helper method that creates a FileStream under CurrentAppender's SecurityContext. - This is part of the delayed object - activation scheme. The method must - be called on this object after the configuration properties have - been set. Until is called this - object is in an undefined state and must not be used. + Typically called during OpenFile or AcquireLock. - If any of the configuration properties are modified then - must be called again. + If the directory portion of the does not exist, it is created + via Directory.CreateDirecctory. + + + + - + - Create an event log source + Helper method to close under CurrentAppender's SecurityContext. - Uses different API calls under NET_2_0 + Does not set to null. + - + - This method is called by the - method. + Hold an exclusive lock on the output file - the event to log - Writes the event to the system event log using the - . - - If the event has an EventID property (see ) - set then this integer will be used as the event log event id. - - There is a limit of 32K characters for an event log message + Open the file once for writing and hold it open until is called. + Maintains an exclusive lock on the file during this time. - + - Get the equivalent for a + Open the file specified and prepare for logging. - the Level to convert to an EventLogEntryType - The equivalent for a + The filename to use + Whether to append to the file, or overwrite + The encoding to use - Because there are fewer applicable - values to use in logging levels than there are in the - this is a one way mapping. There is - a loss of information during the conversion. + + Open the file specified and prepare for logging. + No writes will be made until is called. + Must be called before any calls to , + and . + - - - The log name is the section in the event logs where the messages - are stored. - - - - - Name of the application to use when logging. This appears in the - application column of the event log named by . - - - + - The name of the machine which holds the event log. This is - currently only allowed to be '.' i.e. the current machine. + Close the file + + + Close the file. No further writes will be made. + + - + - Mapping from level object to EventLogEntryType + Acquire the lock on the file + A stream that is ready to be written to. + + + Does nothing. The lock is already taken + + - + - The security context to use for privileged calls + Release the lock on the file + + + Does nothing. The lock will be released when the file is closed. + + - + - The event ID to use unless one is explicitly specified via the LoggingEvent's properties. + Initializes all resources used by this locking model. - + - The event category to use unless one is explicitly specified via the LoggingEvent's properties. + Disposes all resources that were initialized by this locking model. - + - The fully qualified type of the EventLogAppender class. + Acquires the file lock for each write - Used by the internal logger to record the Type of the - log message. + + Opens the file once for each / cycle, + thus holding the lock for the minimal amount of time. This method of locking + is considerably slower than but allows + other processes to move/delete the log file whilst logging continues. + - + - The maximum size supported by default. + Prepares to open the file when the first message is logged. + The filename to use + Whether to append to the file, or overwrite + The encoding to use - http://msdn.microsoft.com/en-us/library/xzwc042w(v=vs.100).aspx - The 32766 documented max size is two bytes shy of 32K (I'm assuming 32766 - may leave space for a two byte null terminator of #0#0). The 32766 max - length is what the .NET 4.0 source code checks for, but this is WRONG! - Strings with a length > 31839 on Windows Vista or higher can CORRUPT - the event log! See: System.Diagnostics.EventLogInternal.InternalWriteEvent() - for the use of the 32766 max size. + + Open the file specified and prepare for logging. + No writes will be made until is called. + Must be called before any calls to , + and . + - + - The maximum size supported by a windows operating system that is vista - or newer. + Close the file - See ReportEvent API: - http://msdn.microsoft.com/en-us/library/aa363679(VS.85).aspx - ReportEvent's lpStrings parameter: - "A pointer to a buffer containing an array of - null-terminated strings that are merged into the message before Event Viewer - displays the string to the user. This parameter must be a valid pointer - (or NULL), even if wNumStrings is zero. Each string is limited to 31,839 characters." - - Going beyond the size of 31839 will (at some point) corrupt the event log on Windows - Vista or higher! It may succeed for a while...but you will eventually run into the - error: "System.ComponentModel.Win32Exception : A device attached to the system is - not functioning", and the event log will then be corrupt (I was able to corrupt - an event log using a length of 31877 on Windows 7). - - The max size for Windows Vista or higher is documented here: - http://msdn.microsoft.com/en-us/library/xzwc042w(v=vs.100).aspx. - Going over this size may succeed a few times but the buffer will overrun and - eventually corrupt the log (based on testing). - - The maxEventMsgSize size is based on the max buffer size of the lpStrings parameter of the ReportEvent API. - The documented max size for EventLog.WriteEntry for Windows Vista and higher is 31839, but I'm leaving room for a - terminator of #0#0, as we cannot see the source of ReportEvent (though we could use an API monitor to examine the - buffer, given enough time). + + Close the file. No further writes will be made. + - + - The maximum size that the operating system supports for - a event log message. + Acquire the lock on the file + A stream that is ready to be written to. - Used to determine the maximum string length that can be written - to the operating system event log and eventually truncate a string - that exceeds the limits. + + Acquire the lock on the file in preparation for writing to it. + Return a stream pointing to the file. + must be called to release the lock on the output file. + - - - This method determines the maximum event log message size allowed for - the current environment. - - - - + - The name of the log where messages will be stored. + Release the lock on the file - - The string name of the log where messages will be stored. - - This is the name of the log as it appears in the Event Viewer - tree. The default value is to log into the Application - log, this is where most applications write their events. However - if you need a separate log for your application (or applications) - then you should set the appropriately. - This should not be used to distinguish your event log messages - from those of other applications, the - property should be used to distinguish events. This property should be - used to group together events into a single log. + + Release the lock on the file. No further writes will be made to the + stream until is called again. - + - Property used to set the Application name. This appears in the - event logs when logging. + Initializes all resources used by this locking model. - - The string used to distinguish events from different sources. - - - Sets the event log source property. - - + - This property is used to return the name of the computer to use - when accessing the event logs. Currently, this is the current - computer, denoted by a dot "." + Disposes all resources that were initialized by this locking model. - - The string name of the machine holding the event log that - will be logged into. - - - This property cannot be changed. It is currently set to '.' - i.e. the local machine. This may be changed in future. - - + - Gets or sets the used to write to the EventLog. + Provides cross-process file locking. - - The used to write to the EventLog. - + Ron Grabowski + Steve Wranovsky + + + + Open the file specified and prepare for logging. + + The filename to use + Whether to append to the file, or overwrite + The encoding to use - The system security context used to write to the EventLog. - - - Unless a specified here for this appender - the is queried for the - security context to use. The default behavior is to use the security context - of the current thread. + Open the file specified and prepare for logging. + No writes will be made until is called. + Must be called before any calls to , + - and . - + - Gets or sets the EventId to use unless one is explicitly specified via the LoggingEvent's properties. + Close the file - The EventID of the event log entry will normally be - set using the EventID property () - on the . - This property provides the fallback value which defaults to 0. + Close the file. No further writes will be made. - + - Gets or sets the Category to use unless one is explicitly specified via the LoggingEvent's properties. + Acquire the lock on the file + A stream that is ready to be written to. - The Category of the event log entry will normally be - set using the Category property () - on the . - This property provides the fallback value which defaults to 0. + Does nothing. The lock is already taken - + - This appender requires a to be set. + Releases the lock and allows others to acquire a lock. + + + + + Initializes all resources used by this locking model. + + + + + Disposes all resources that were initialized by this locking model. + + + + + Hold no lock on the output file - true - This appender requires a to be set. + Open the file once and hold it open until is called. + Maintains no lock on the file during this time. - + - A class to act as a mapping between the level that a logging call is made at and - the color it should be displayed as. + Open the file specified and prepare for logging. + The filename to use + Whether to append to the file, or overwrite + The encoding to use - Defines the mapping between a level and its event log entry type. + Open the file specified and prepare for logging. + No writes will be made until is called. + Must be called before any calls to , + and . - + - The for this entry + Close the file - Required property. - The for this entry + Close the file. No further writes will be made. - + - Appends logging events to a file. + Acquire the lock on the file + A stream that is ready to be written to. - Logging events are sent to the file specified by - the property. - - - The file can be opened in either append or overwrite mode - by specifying the property. - If the file path is relative it is taken as relative from - the application base directory. The file encoding can be - specified by setting the property. - - - The layout's and - values will be written each time the file is opened and closed - respectively. If the property is - then the file may contain multiple copies of the header and footer. - - - This appender will first try to open the file for writing when - is called. This will typically be during configuration. - If the file cannot be opened for writing the appender will attempt - to open the file again each time a message is logged to the appender. - If the file cannot be opened for writing when a message is logged then - the message will be discarded by this appender. - - - The supports pluggable file locking models via - the property. - The default behavior, implemented by - is to obtain an exclusive write lock on the file until this appender is closed. - The alternative models only hold a - write lock while the appender is writing a logging event () - or synchronize by using a named system wide Mutex (). - - - All locking strategies have issues and you should seriously consider using a different strategy that - avoids having multiple processes logging to the same file. + Does nothing. The lock is already taken - Nicko Cadell - Gert Driesen - Rodrigo B. de Oliveira - Douglas de la Torre - Niall Daley - + - Sends logging events to a . + Release the lock on the file - An Appender that writes to a . - - - This appender may be used stand alone if initialized with an appropriate - writer, however it is typically used as a base class for an appender that - can open a to write to. + Does nothing. The lock will be released when the file is closed. - Nicko Cadell - Gert Driesen - Douglas de la Torre - + + + Initializes all resources used by this locking model. + + + + + Disposes all resources that were initialized by this locking model. + + + + + Default locking model (when no locking model was configured) + + + + + Specify default locking model + + Type of LockingModel + + - Initializes a new instance of the class. + Default constructor - Default constructor. + Default constructor - + - Initializes a new instance of the class and - sets the output destination to a new initialized - with the specified . + Construct a new appender using the layout, file and append mode. - The layout to use with this appender. - The to output to. + the layout to use with this appender + the full path to the file to write to + flag to indicate if the file should be appended to Obsolete constructor. - + - Initializes a new instance of the class and sets - the output destination to the specified . + Construct a new appender using the layout and file specified. + The file will be appended to. - The layout to use with this appender - The to output to - - The must have been previously opened. - + the layout to use with this appender + the full path to the file to write to Obsolete constructor. - + - This method determines if there is a sense in attempting to append. + Gets or sets the path to the file that logging will be written to. + + The path to the file that logging will be written to. + - This method checks if an output target has been set and if a - layout has been set. + If the path is relative it is taken as relative from + the application base directory. - false if any of the preconditions fail. - + - This method is called by the - method. + Gets or sets a flag that indicates whether the file should be + appended to or overwritten. - The event to log. + + Indicates whether the file should be appended to or overwritten. + - Writes a log statement to the output stream if the output stream exists - and is writable. - - - The format of the output will depend on the appender's layout. + If the value is set to false then the file will be overwritten, if + it is set to true then the file will be appended to. + The default value is true. - + - This method is called by the - method. + Gets or sets used to write to the file. - The array of events to log. + + The used to write to the file. + - This method writes all the bulk logged events to the output writer - before flushing the stream. + The default encoding set is + which is the encoding for the system's current ANSI code page. - + - Close this appender instance. The underlying stream or writer is also closed. + Gets or sets the used to write to the file. + + The used to write to the file. + - Closed appenders cannot be reused. + + Unless a specified here for this appender + the is queried for the + security context to use. The default behavior is to use the security context + of the current thread. + - + - Writes the footer and closes the underlying . + Gets or sets the used to handle locking of the file. + + The used to lock the file. + - Writes the footer and closes the underlying . + Gets or sets the used to handle locking of the file. + + + There are three built in locking models, , and . + The first locks the file from the start of logging to the end, the + second locks only for the minimal amount of time when logging each message + and the last synchronizes processes using a named system wide Mutex. + + + The default locking model is the . - + - Closes the underlying . + Activate the options on the file appender. - Closes the underlying . + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + This will cause the file to be opened. - + - Clears internal references to the underlying - and other variables. + Closes any previously opened file and calls the parent's . - Subclasses can override this method for an alternate closing behavior. + Resets the filename and the file stream. - + - Writes a footer as produced by the embedded layout's property. + Close this appender instance. The underlying stream or writer is also closed. + + + + + Called to initialize the file writer - Writes a footer as produced by the embedded layout's property. + Will be called for each logged message until the file is + successfully opened. - + - Writes a header produced by the embedded layout's property. + This method is called by the + method. + The event to log. - Writes a header produced by the embedded layout's property. + Writes a log statement to the output stream if the output stream exists + and is writable. + + + The format of the output will depend on the appender's layout. - + - Called to allow a subclass to lazily initialize the writer + This method is called by the + method. - - - This method is called when an event is logged and the or - have not been set. This allows a subclass to - attempt to initialize the writer multiple times. - - - - - - This is the where logging events - will be written to. - - - - - Immediate flush means that the underlying - or output stream will be flushed at the end of each append operation. - - - - Immediate flush is slower but ensures that each append request is - actually written. If is set to - false, then there is a good chance that the last few - logging events are not actually persisted if and when the application - crashes. - - - The default value is true. - - - - - - The fully qualified type of the TextWriterAppender class. - - - Used by the internal logger to record the Type of the - log message. - - - - - Flushes any buffered log data. - - The maximum time to wait for logging events to be flushed. - True if all logging events were flushed successfully, else false. - - - - Gets or set whether the appender will flush at the end - of each append operation. - - - - The default behavior is to flush at the end of each - append operation. - - - If this option is set to false, then the underlying - stream can defer persisting the logging event to a later - time. - - - - Avoiding the flush operation at the end of each append results in - a performance gain of 10 to 20 percent. However, there is safety - trade-off involved in skipping flushing. Indeed, when flushing is - skipped, then it is likely that the last few log events will not - be recorded on disk when the application exits. This is a high - price to pay even for a 20% performance gain. - - - - - Sets the where the log output will go. - - - - The specified must be open and writable. - - - The will be closed when the appender - instance is closed. - - - Note: Logging to an unopened will fail. - - - - - - Gets or set the and the underlying - , if any, for this appender. - - - The for this appender. - - - - - This appender requires a to be set. - - true - - - This appender requires a to be set. - - - - - - Gets or sets the where logging events - will be written to. - - - The where logging events are written. - - - - This is the where logging events - will be written to. - - - - - - Default constructor - - - - Default constructor - - - - - - Construct a new appender using the layout, file and append mode. - - the layout to use with this appender - the full path to the file to write to - flag to indicate if the file should be appended to - - - Obsolete constructor. - - - - - - Construct a new appender using the layout and file specified. - The file will be appended to. - - the layout to use with this appender - the full path to the file to write to - - - Obsolete constructor. - - - - - - Activate the options on the file appender. - - - - This is part of the delayed object - activation scheme. The method must - be called on this object after the configuration properties have - been set. Until is called this - object is in an undefined state and must not be used. - - - If any of the configuration properties are modified then - must be called again. - - - This will cause the file to be opened. - - - - - - Closes any previously opened file and calls the parent's . - - - - Resets the filename and the file stream. - - - - - - Close this appender instance. The underlying stream or writer is also closed. - - - - - Called to initialize the file writer - - - - Will be called for each logged message until the file is - successfully opened. - - - - - - This method is called by the - method. - - The event to log. - - - Writes a log statement to the output stream if the output stream exists - and is writable. - - - The format of the output will depend on the appender's layout. - - - - - - This method is called by the - method. - - The array of events to log. + The array of events to log. Acquires the output file locks once before writing all the events to @@ -4333,642 +4257,487 @@ log message. - + - Gets or sets the path to the file that logging will be written to. + This appender forwards logging events to attached appenders. - - The path to the file that logging will be written to. - - If the path is relative it is taken as relative from - the application base directory. + The forwarding appender can be used to specify different thresholds + and filters for the same appender at different locations within the hierarchy. + Nicko Cadell + Gert Driesen - + - Gets or sets a flag that indicates whether the file should be - appended to or overwritten. + Initializes a new instance of the class. - - Indicates whether the file should be appended to or overwritten. - - If the value is set to false then the file will be overwritten, if - it is set to true then the file will be appended to. + Default constructor. - The default value is true. - + - Gets or sets used to write to the file. - - - The used to write to the file. - - - - The default encoding set is - which is the encoding for the system's current ANSI code page. - - - - - - Gets or sets the used to write to the file. - - - The used to write to the file. - - - - Unless a specified here for this appender - the is queried for the - security context to use. The default behavior is to use the security context - of the current thread. - - - - - - Gets or sets the used to handle locking of the file. + Closes the appender and releases resources. - - The used to lock the file. - - Gets or sets the used to handle locking of the file. - - - There are three built in locking models, , and . - The first locks the file from the start of logging to the end, the - second locks only for the minimal amount of time when logging each message - and the last synchronizes processes using a named system wide Mutex. + Releases any resources allocated within the appender such as file handles, + network connections, etc. - The default locking model is the . + It is a programming error to append to a closed appender. - - - Write only that uses the - to manage access to an underlying resource. - - - - - True asynchronous writes are not supported, the implementation forces a synchronous write. - - - + - Exception base type for log4net. + Forward the logging event to the attached appenders + The event to log. - This type extends . It - does not add any new functionality but does differentiate the - type of exception being thrown. + Delivers the logging event to all the attached appenders. - Nicko Cadell - Gert Driesen - + - Constructor + Forward the logging events to the attached appenders + The array of events to log. - Initializes a new instance of the class. + Delivers the logging events to all the attached appenders. - + - Constructor + Adds an to the list of appenders of this + instance. - A message to include with the exception. + The to add to this appender. - Initializes a new instance of the class with - the specified message. + If the specified is already in the list of + appenders, then it won't be added again. - + - Constructor + Gets the appenders contained in this appender as an + . - A message to include with the exception. - A nested exception to include. - - Initializes a new instance of the class - with the specified message and inner exception. - + If no appenders can be found, then an + is returned. + + A collection of the appenders in this appender. + - + - Serialization constructor + Looks for the appender with the specified name. - The that holds the serialized object data about the exception being thrown. - The that contains contextual information about the source or destination. + The name of the appender to lookup. + + The appender with the specified name, or null. + - Initializes a new instance of the class - with serialized data. + Get the named appender attached to this appender. - + - Locking model base class + Removes all previously added appenders from this appender. - Base class for the locking models available to the derived loggers. + This is useful when re-reading configuration information. - + - Open the output file + Removes the specified appender from the list of appenders. - The filename to use - Whether to append to the file, or overwrite - The encoding to use + The appender to remove. + The appender removed from the list - - Open the file specified and prepare for logging. - No writes will be made until is called. - Must be called before any calls to , - and . - + The appender removed is not closed. + If you are discarding the appender you must call + on the appender removed. - + - Close the file + Removes the appender with the specified name from the list of appenders. + The name of the appender to remove. + The appender removed from the list - - Close the file. No further writes will be made. - + The appender removed is not closed. + If you are discarding the appender you must call + on the appender removed. - - - Initializes all resources used by this locking model. - - - + - Disposes all resources that were initialized by this locking model. + Implementation of the interface - + - Acquire the lock on the file + Implement this interface for your own strategies for printing log statements. - A stream that is ready to be written to. - Acquire the lock on the file in preparation for writing to it. - Return a stream pointing to the file. - must be called to release the lock on the output file. + Implementors should consider extending the + class which provides a default implementation of this interface. - - - - - Release the lock on the file - - - Release the lock on the file. No further writes will be made to the - stream until is called again. + Appenders can also implement the interface. Therefore + they would require that the method + be called after the appenders properties have been configured. + Nicko Cadell + Gert Driesen - + - Helper method that creates a FileStream under CurrentAppender's SecurityContext. + Closes the appender and releases resources. - Typically called during OpenFile or AcquireLock. + Releases any resources allocated within the appender such as file handles, + network connections, etc. - If the directory portion of the does not exist, it is created - via Directory.CreateDirecctory. + It is a programming error to append to a closed appender. - - - - - + - Helper method to close under CurrentAppender's SecurityContext. + Log the logging event in Appender specific way. + The event to log - Does not set to null. + + This method is called to log a message into this appender. + - - + - Gets or sets the for this LockingModel + Gets or sets the name of this appender. - - The for this LockingModel - + The name of the appender. - - The file appender this locking model is attached to and working on - behalf of. - - - The file appender is used to locate the security context and the error handler to use. - - - The value of this property will be set before is - called. - + The name uniquely identifies the appender. - + - Hold an exclusive lock on the output file + Interface for appenders that support bulk logging. - Open the file once for writing and hold it open until is called. - Maintains an exclusive lock on the file during this time. + This interface extends the interface to + support bulk logging of objects. Appenders + should only implement this interface if they can bulk log efficiently. + Nicko Cadell - + - Open the file specified and prepare for logging. + Log the array of logging events in Appender specific way. - The filename to use - Whether to append to the file, or overwrite - The encoding to use + The events to log - Open the file specified and prepare for logging. - No writes will be made until is called. - Must be called before any calls to , - and . + This method is called to log an array of events into this appender. - + - Close the file + Interface that can be implemented by Appenders that buffer logging data and expose a method. - - - Close the file. No further writes will be made. - - - + - Acquire the lock on the file + Flushes any buffered log data. - A stream that is ready to be written to. - - Does nothing. The lock is already taken + Appenders that implement the method must do so in a thread-safe manner: it can be called concurrently with + the method. + + Typically this is done by locking on the Appender instance, e.g.: + + + - - - - - Release the lock on the file - - - Does nothing. The lock will be released when the file is closed. + The parameter is only relevant for appenders that process logging events asynchronously, + such as . + The maximum time to wait for logging events to be flushed. + True if all logging events were flushed successfully, else false. - - - Initializes all resources used by this locking model. - - - - - Disposes all resources that were initialized by this locking model. - - - + - Acquires the file lock for each write + Logs events to a local syslog service. + + This appender uses the POSIX libc library functions openlog, syslog, and closelog. + If these functions are not available on the local system then this appender will not work! + - Opens the file once for each / cycle, - thus holding the lock for the minimal amount of time. This method of locking - is considerably slower than but allows - other processes to move/delete the log file whilst logging continues. + The functions openlog, syslog, and closelog are specified in SUSv2 and + POSIX 1003.1-2001 standards. These are used to log messages to the local syslog service. + + + This appender talks to a local syslog service. If you need to log to a remote syslog + daemon and you cannot configure your local syslog service to do this you may be + able to use the to log via UDP. + + + Syslog messages must have a facility and and a severity. The severity + is derived from the Level of the logging event. + The facility must be chosen from the set of defined syslog + values. The facilities list is predefined + and cannot be extended. + + + An identifier is specified with each log message. This can be specified + by setting the property. The identity (also know + as the tag) must not contain white space. The default value for the + identity is the application name (from ). + Rob Lyon + Nicko Cadell - + - Prepares to open the file when the first message is logged. + syslog severities - The filename to use - Whether to append to the file, or overwrite - The encoding to use - Open the file specified and prepare for logging. - No writes will be made until is called. - Must be called before any calls to , - and . + The log4net Level maps to a syslog severity using the + method and the + class. The severity is set on . - + - Close the file + system is unusable - - - Close the file. No further writes will be made. - - - + - Acquire the lock on the file + action must be taken immediately - A stream that is ready to be written to. - - - Acquire the lock on the file in preparation for writing to it. - Return a stream pointing to the file. - must be called to release the lock on the output file. - - - + - Release the lock on the file + critical conditions - - - Release the lock on the file. No further writes will be made to the - stream until is called again. - - - + - Initializes all resources used by this locking model. + error conditions - + - Disposes all resources that were initialized by this locking model. + warning conditions - + - Provides cross-process file locking. + normal but significant condition - Ron Grabowski - Steve Wranovsky - + - Open the file specified and prepare for logging. + informational - The filename to use - Whether to append to the file, or overwrite - The encoding to use - - - Open the file specified and prepare for logging. - No writes will be made until is called. - Must be called before any calls to , - - and . - - - + - Close the file + debug-level messages - - - Close the file. No further writes will be made. - - - + - Acquire the lock on the file + syslog facilities - A stream that is ready to be written to. - Does nothing. The lock is already taken + The syslog facility defines which subsystem the logging comes from. + This is set on the property. - + - Releases the lock and allows others to acquire a lock. + kernel messages - + - Initializes all resources used by this locking model. + random user-level messages - + - Disposes all resources that were initialized by this locking model. + mail system - + - This appender forwards logging events to attached appenders. + system daemons - - - The forwarding appender can be used to specify different thresholds - and filters for the same appender at different locations within the hierarchy. - - - Nicko Cadell - Gert Driesen - + - Initializes a new instance of the class. + security/authorization messages - - - Default constructor. - - - + - Closes the appender and releases resources. + messages generated internally by syslogd - - - Releases any resources allocated within the appender such as file handles, - network connections, etc. - - - It is a programming error to append to a closed appender. - - - + - Forward the logging event to the attached appenders + line printer subsystem - The event to log. - - - Delivers the logging event to all the attached appenders. - - - + - Forward the logging events to the attached appenders + network news subsystem - The array of events to log. - - - Delivers the logging events to all the attached appenders. - - - + - Adds an to the list of appenders of this - instance. + UUCP subsystem - The to add to this appender. - - - If the specified is already in the list of - appenders, then it won't be added again. - - - + - Looks for the appender with the specified name. + clock (cron/at) daemon - The name of the appender to lookup. - - The appender with the specified name, or null. - - - - Get the named appender attached to this appender. - - - + - Removes all previously added appenders from this appender. + security/authorization messages (private) - - - This is useful when re-reading configuration information. - - - + - Removes the specified appender from the list of appenders. + ftp daemon - The appender to remove. - The appender removed from the list - - The appender removed is not closed. - If you are discarding the appender you must call - on the appender removed. - - + - Removes the appender with the specified name from the list of appenders. + NTP subsystem - The name of the appender to remove. - The appender removed from the list - - The appender removed is not closed. - If you are discarding the appender you must call - on the appender removed. - - + - Implementation of the interface + log audit - + - Gets the appenders contained in this appender as an - . + log alert + + + + + clock daemon + + + + + reserved for local use + + + + + reserved for local use + + + + + reserved for local use + + + + + reserved for local use + + + + + reserved for local use + + + + + reserved for local use + + + + + reserved for local use + + + + + reserved for local use + + + + + Initializes a new instance of the class. - If no appenders can be found, then an - is returned. + This instance of the class is set up to write + to a local syslog service. - - A collection of the appenders in this appender. - - + - Logs events to a local syslog service. + Message identity - - This appender uses the POSIX libc library functions openlog, syslog, and closelog. - If these functions are not available on the local system then this appender will not work! - - - The functions openlog, syslog, and closelog are specified in SUSv2 and - POSIX 1003.1-2001 standards. These are used to log messages to the local syslog service. - - - This appender talks to a local syslog service. If you need to log to a remote syslog - daemon and you cannot configure your local syslog service to do this you may be - able to use the to log via UDP. - - - Syslog messages must have a facility and and a severity. The severity - is derived from the Level of the logging event. - The facility must be chosen from the set of defined syslog - values. The facilities list is predefined - and cannot be extended. - An identifier is specified with each log message. This can be specified by setting the property. The identity (also know @@ -4976,16 +4745,15 @@ identity is the application name (from ). - Rob Lyon - Nicko Cadell - + - Initializes a new instance of the class. + Syslog facility - This instance of the class is set up to write - to a local syslog service. + Set to one of the values. The list of + facilities is predefined and cannot be extended. The default value + is . @@ -5041,6 +4809,17 @@ + + + This appender requires a to be set. + + true + + + This appender requires a to be set. + + + Translates a log4net level to a syslog severity. @@ -5107,488 +4886,302 @@ Close descriptor used to write to system logger. - + - Message identity + A class to act as a mapping between the level that a logging call is made at and + the syslog severity that is should be logged at. - An identifier is specified with each log message. This can be specified - by setting the property. The identity (also know - as the tag) must not contain white space. The default value for the - identity is the application name (from ). + A class to act as a mapping between the level that a logging call is made at and + the syslog severity that is should be logged at. - + - Syslog facility + The mapped syslog severity for the specified level - Set to one of the values. The list of - facilities is predefined and cannot be extended. The default value - is . + + Required property. + The mapped syslog severity for the specified level + - + - This appender requires a to be set. + Appends colorful logging events to the console, using the .NET 2 + built-in capabilities. - true - This appender requires a to be set. + ManagedColoredConsoleAppender appends log events to the standard output stream + or the error output stream using a layout specified by the + user. It also allows the color of a specific type of message to be set. + + + By default, all output is written to the console's standard output stream. + The property can be set to direct the output to the + error stream. + + + When configuring the colored console appender, mappings should be + specified to map logging levels to colors. For example: + + + + + + + + + + + + + + + + + + + + + + The Level is the standard log4net logging level while + ForeColor and BackColor are the values of + enumeration. + + + Based on the ColoredConsoleAppender + Rick Hobbs + Nicko Cadell + Pavlos Touboulidis - + - syslog severities + Initializes a new instance of the class. - - The log4net Level maps to a syslog severity using the - method and the - class. The severity is set on . - + The instance of the class is set up to write + to the standard output stream. - + - system is unusable + Target is the value of the console output stream. + This is either "Console.Out" or "Console.Error". + + Target is the value of the console output stream. + This is either "Console.Out" or "Console.Error". + + + + Target is the value of the console output stream. + This is either "Console.Out" or "Console.Error". + + - + - action must be taken immediately + Add a mapping of level to color - done by the config file + The mapping to add + + + Add a mapping to this appender. + Each mapping defines the foreground and background colors + for a level. + + - + - critical conditions + This method is called by the method. + The event to log. + + + Writes the event to the console. + + + The format of the output will depend on the appender's layout. + + - + - error conditions + This appender requires a to be set. + true + + + This appender requires a to be set. + + - + - warning conditions + Initialize the options for this appender + + + Initialize the level to color mappings set on this appender. + + - - - normal but significant condition - - - - - informational - - - - - debug-level messages - - - + - syslog facilities + The to use when writing to the Console + standard output stream. - The syslog facility defines which subsystem the logging comes from. - This is set on the property. + The to use when writing to the Console + standard output stream. - - - kernel messages - - - - - random user-level messages - - - - - mail system - - - - - system daemons - - - - - security/authorization messages - - - - - messages generated internally by syslogd - - - - - line printer subsystem - - - - - network news subsystem - - - - - UUCP subsystem - - - - - clock (cron/at) daemon - - - - - security/authorization messages (private) - - - - - ftp daemon - - - - - NTP subsystem - - - - - log audit - - - - - log alert - - - - - clock daemon - - - - - reserved for local use - - - - - reserved for local use - - - - - reserved for local use - - - - - reserved for local use - - - - - reserved for local use - - - + - reserved for local use + The to use when writing to the Console + standard error output stream. + + + The to use when writing to the Console + standard error output stream. + + - + - reserved for local use + Flag to write output to the error stream rather than the standard output stream - + - reserved for local use + Mapping from level object to color value - + A class to act as a mapping between the level that a logging call is made at and - the syslog severity that is should be logged at. + the color it should be displayed as. - A class to act as a mapping between the level that a logging call is made at and - the syslog severity that is should be logged at. + Defines the mapping between a level and the color it should be displayed in. - + - The mapped syslog severity for the specified level + The mapped foreground color for the specified level Required property. - The mapped syslog severity for the specified level + The mapped foreground color for the specified level. - + - Appends colorful logging events to the console, using the .NET 2 - built-in capabilities. + The mapped background color for the specified level - ManagedColoredConsoleAppender appends log events to the standard output stream - or the error output stream using a layout specified by the - user. It also allows the color of a specific type of message to be set. + Required property. + The mapped background color for the specified level. + + + + + Stores logging events in an array. + + - By default, all output is written to the console's standard output stream. - The property can be set to direct the output to the - error stream. + The memory appender stores all the logging events + that are appended in an in-memory array. - When configuring the colored console appender, mappings should be - specified to map logging levels to colors. For example: + Use the method to get + and clear the current list of events that have been appended. - - - - - - - - - - - - - - - - - - - - The Level is the standard log4net logging level while - ForeColor and BackColor are the values of - enumeration. + Use the method to get the current + list of events that have been appended. Note there is a + race-condition when calling and + in pairs, you better use in that case. - Based on the ColoredConsoleAppender + Use the method to clear the + current list of events. Note there is a + race-condition when calling and + in pairs, you better use in that case. - Rick Hobbs + Julian Biddle Nicko Cadell - Pavlos Touboulidis + Gert Driesen - + - The to use when writing to the Console - standard output stream. + Initializes a new instance of the class. - The to use when writing to the Console - standard output stream. + Default constructor. - + - The to use when writing to the Console - standard error output stream. + Gets the events that have been logged. + The events that have been logged - The to use when writing to the Console - standard error output stream. + Gets the events that have been logged. - + - Initializes a new instance of the class. + Gets or sets a value indicating whether only part of the logging event + data should be fixed. + + true if the appender should only fix part of the logging event + data, otherwise false. The default is false. + - The instance of the class is set up to write - to the standard output stream. + + Setting this property to true will cause only part of the event + data to be fixed and stored in the appender, hereby improving performance. + + + See for more information. + - + - Add a mapping of level to color - done by the config file + Gets or sets the fields that will be fixed in the event - The mapping to add - Add a mapping to this appender. - Each mapping defines the foreground and background colors - for a level. - - - - - - This method is called by the method. - - The event to log. - - - Writes the event to the console. - - - The format of the output will depend on the appender's layout. - - - - - - Initialize the options for this appender - - - - Initialize the level to color mappings set on this appender. - - - - - - Flag to write output to the error stream rather than the standard output stream - - - - - Mapping from level object to color value - - - - - Target is the value of the console output stream. - This is either "Console.Out" or "Console.Error". - - - Target is the value of the console output stream. - This is either "Console.Out" or "Console.Error". - - - - Target is the value of the console output stream. - This is either "Console.Out" or "Console.Error". - - - - - - This appender requires a to be set. - - true - - - This appender requires a to be set. - - - - - - A class to act as a mapping between the level that a logging call is made at and - the color it should be displayed as. - - - - Defines the mapping between a level and the color it should be displayed in. - - - - - - The mapped foreground color for the specified level - - - - Required property. - The mapped foreground color for the specified level. - - - - - - The mapped background color for the specified level - - - - Required property. - The mapped background color for the specified level. - - - - - - Stores logging events in an array. - - - - The memory appender stores all the logging events - that are appended in an in-memory array. - - - Use the method to get - and clear the current list of events that have been appended. - - - Use the method to get the current - list of events that have been appended. Note there is a - race-condition when calling and - in pairs, you better use in that case. - - - Use the method to clear the - current list of events. Note there is a - race-condition when calling and - in pairs, you better use in that case. - - - Julian Biddle - Nicko Cadell - Gert Driesen - - - - Initializes a new instance of the class. - - - - Default constructor. - - - - - - Gets the events that have been logged. - - The events that have been logged - - - Gets the events that have been logged. + The logging event needs to have certain thread specific values + captured before it can be buffered. See + for details. @@ -5633,41 +5226,10 @@ By default all fields are fixed - - - Gets or sets a value indicating whether only part of the logging event - data should be fixed. - - - true if the appender should only fix part of the logging event - data, otherwise false. The default is false. - - - - Setting this property to true will cause only part of the event - data to be fixed and stored in the appender, hereby improving performance. - - - See for more information. - - - - - - Gets or sets the fields that will be fixed in the event - - - - The logging event needs to have certain thread specific values - captured before it can be buffered. See - for details. - - - Logs entries by sending network messages using the - native function. + native function. @@ -5746,7 +5308,7 @@ Note : security restrictions apply for sending - network messages, see + network messages, see for more information. @@ -5758,9 +5320,9 @@ - - - + + + @@ -5795,6 +5357,60 @@ The default constructor initializes all fields to their default values. + + + Gets or sets the sender of the message. + + + The sender of the message. + + + If this property is not specified, the message is sent from the local computer. + + + + + Gets or sets the message alias to which the message should be sent. + + + The recipient of the message. + + + This property should always be specified in order to send a message. + + + + + Gets or sets the DNS or NetBIOS name of the remote server on which the function is to execute. + + + DNS or NetBIOS name of the remote server on which the function is to execute. + + + + For Windows NT 4.0 and earlier, the string should begin with \\. + + + If this property is not specified, the local computer is used. + + + + + + Gets or sets the used to call the NetSend method. + + + The used to call the NetSend method. + + + + Unless a specified here for this appender + the is queried for the + security context to use. The default behavior is to use the security context + of the current thread. + + + Initialize the appender based on the options set. @@ -5812,10 +5428,10 @@ must be called again. - The appender will be ignored if no was specified. + The appender will be ignored if no was specified. - The required property was not specified. + The required property was not specified. @@ -5828,6 +5444,17 @@ + + + This appender requires a to be set. + + true + + + This appender requires a to be set. + + + Sends a buffer of information to a registered message alias. @@ -5884,74 +5511,9 @@ - + - Gets or sets the sender of the message. - - - The sender of the message. - - - If this property is not specified, the message is sent from the local computer. - - - - - Gets or sets the message alias to which the message should be sent. - - - The recipient of the message. - - - This property should always be specified in order to send a message. - - - - - Gets or sets the DNS or NetBIOS name of the remote server on which the function is to execute. - - - DNS or NetBIOS name of the remote server on which the function is to execute. - - - - For Windows NT 4.0 and earlier, the string should begin with \\. - - - If this property is not specified, the local computer is used. - - - - - - Gets or sets the used to call the NetSend method. - - - The used to call the NetSend method. - - - - Unless a specified here for this appender - the is queried for the - security context to use. The default behavior is to use the security context - of the current thread. - - - - - - This appender requires a to be set. - - true - - - This appender requires a to be set. - - - - - - Appends log events to the OutputDebugString system. + Appends log events to the OutputDebugString system. @@ -5968,7 +5530,7 @@ - Initializes a new instance of the class. + Initializes a new instance of the class. @@ -5987,25 +5549,25 @@ - + - Stub for OutputDebugString native method + This appender requires a to be set. - the string to output + true - Stub for OutputDebugString native method + This appender requires a to be set. - + - This appender requires a to be set. + Stub for OutputDebugString native method - true + the string to output - This appender requires a to be set. + Stub for OutputDebugString native method @@ -6051,370 +5613,223 @@ Rob Lyon Nicko Cadell - - - Sends logging events as connectionless UDP datagrams to a remote host or a - multicast group using an . - - - - UDP guarantees neither that messages arrive, nor that they arrive in the correct order. - - - To view the logging results, a custom application can be developed that listens for logging - events. - - - When decoding events send via this appender remember to use the same encoding - to decode the events as was used to send the events. See the - property to specify the encoding to use. - - - - This example shows how to log receive logging events that are sent - on IP address 244.0.0.1 and port 8080 to the console. The event is - encoded in the packet as a unicode string and it is decoded as such. - - IPEndPoint remoteEndPoint = new IPEndPoint(IPAddress.Any, 0); - UdpClient udpClient; - byte[] buffer; - string loggingEvent; - - try - { - udpClient = new UdpClient(8080); - - while(true) - { - buffer = udpClient.Receive(ref remoteEndPoint); - loggingEvent = System.Text.Encoding.Unicode.GetString(buffer); - Console.WriteLine(loggingEvent); - } - } - catch(Exception e) - { - Console.WriteLine(e.ToString()); - } - - - Dim remoteEndPoint as IPEndPoint - Dim udpClient as UdpClient - Dim buffer as Byte() - Dim loggingEvent as String - - Try - remoteEndPoint = new IPEndPoint(IPAddress.Any, 0) - udpClient = new UdpClient(8080) - - While True - buffer = udpClient.Receive(ByRef remoteEndPoint) - loggingEvent = System.Text.Encoding.Unicode.GetString(buffer) - Console.WriteLine(loggingEvent) - Wend - Catch e As Exception - Console.WriteLine(e.ToString()) - End Try - - - An example configuration section to log information using this appender to the - IP 224.0.0.1 on port 8080: - - - - - - - - - - Gert Driesen - Nicko Cadell - - + - Initializes a new instance of the class. + Syslog port 514 - - The default constructor initializes all fields to their default values. - - + - Initialize the appender based on the options set. + syslog severities - This is part of the delayed object - activation scheme. The method must - be called on this object after the configuration properties have - been set. Until is called this - object is in an undefined state and must not be used. - - - If any of the configuration properties are modified then - must be called again. - - - The appender will be ignored if no was specified or - an invalid remote or local TCP port number was specified. + The syslog severities. - The required property was not specified. - The TCP port number assigned to or is less than or greater than . - + - This method is called by the method. + system is unusable - The event to log. - - - Sends the event using an UDP datagram. - - - Exceptions are passed to the . - - - + - Closes the UDP connection and releases all resources associated with - this instance. + action must be taken immediately - - - Disables the underlying and releases all managed - and unmanaged resources associated with the . - - - + + + critical conditions + + + + + error conditions + + + + + warning conditions + + + + + normal but significant condition + + + + + informational + + + + + debug-level messages + + + - Initializes the underlying connection. + syslog facilities - The underlying is initialized and binds to the - port number from which you intend to communicate. - - - Exceptions are passed to the . + The syslog facilities - + - The IP address of the remote host or multicast group to which - the logging event will be sent. + kernel messages - + - The TCP port number of the remote host or multicast group to - which the logging event will be sent. + random user-level messages - + - The cached remote endpoint to which the logging events will be sent. + mail system - + - The TCP port number from which the will communicate. + system daemons - + - The instance that will be used for sending the - logging events. + security/authorization messages - + - The encoding to use for the packet. + messages generated internally by syslogd - + - Gets or sets the IP address of the remote host or multicast group to which - the underlying should sent the logging event. + line printer subsystem - - The IP address of the remote host or multicast group to which the logging event - will be sent. - - - - Multicast addresses are identified by IP class D addresses (in the range 224.0.0.0 to - 239.255.255.255). Multicast packets can pass across different networks through routers, so - it is possible to use multicasts in an Internet scenario as long as your network provider - supports multicasting. - - - Hosts that want to receive particular multicast messages must register their interest by joining - the multicast group. Multicast messages are not sent to networks where no host has joined - the multicast group. Class D IP addresses are used for multicast groups, to differentiate - them from normal host addresses, allowing nodes to easily detect if a message is of interest. - - - Static multicast addresses that are needed globally are assigned by IANA. A few examples are listed in the table below: - - - - - IP Address - Description - - - 224.0.0.1 - - - Sends a message to all system on the subnet. - - - - - 224.0.0.2 - - - Sends a message to all routers on the subnet. - - - - - 224.0.0.12 - - - The DHCP server answers messages on the IP address 224.0.0.12, but only on a subnet. - - - - - - - A complete list of actually reserved multicast addresses and their owners in the ranges - defined by RFC 3171 can be found at the IANA web site. - - - The address range 239.0.0.0 to 239.255.255.255 is reserved for administrative scope-relative - addresses. These addresses can be reused with other local groups. Routers are typically - configured with filters to prevent multicast traffic in this range from flowing outside - of the local network. - - - + - Gets or sets the TCP port number of the remote host or multicast group to which - the underlying should sent the logging event. + network news subsystem - - An integer value in the range to - indicating the TCP port number of the remote host or multicast group to which the logging event - will be sent. - - - The underlying will send messages to this TCP port number - on the remote host or multicast group. - - The value specified is less than or greater than . - + - Gets or sets the TCP port number from which the underlying will communicate. + UUCP subsystem - - An integer value in the range to - indicating the TCP port number from which the underlying will communicate. - - - - The underlying will bind to this port for sending messages. - - - Setting the value to 0 (the default) will cause the udp client not to bind to - a local port. - - - The value specified is less than or greater than . - + - Gets or sets used to write the packets. + clock (cron/at) daemon - - The used to write the packets. - - - - The used to write the packets. - - - + - Gets or sets the underlying . + security/authorization messages (private) - - The underlying . - - - creates a to send logging events - over a network. Classes deriving from can use this - property to get or set this . Use the underlying - returned from if you require access beyond that which - provides. - - + - Gets or sets the cached remote endpoint to which the logging events should be sent. + ftp daemon - - The cached remote endpoint to which the logging events will be sent. - - - The method will initialize the remote endpoint - with the values of the and - properties. - - + - This appender requires a to be set. + NTP subsystem - true - - - This appender requires a to be set. - - - + - Syslog port 514 + log audit - + - Initial buffer size + log alert - + - Maximum buffer size before it is recycled + clock daemon + + + + + reserved for local use + + + + + reserved for local use + + + + + reserved for local use + + + + + reserved for local use + + + + + reserved for local use + + + + + reserved for local use + + + + + reserved for local use + + + + + reserved for local use - Initializes a new instance of the class. + Initializes a new instance of the class. - This instance of the class is set up to write + This instance of the class is set up to write to a remote syslog daemon. + + + Message identity + + + + An identifier is specified with each log message. This can be specified + by setting the property. The identity (also know + as the tag) must not contain white space. The default value for the + identity is the application name (from ). + + + + + + Syslog facility + + + Set to one of the values. The list of + facilities is predefined and cannot be extended. The default value + is . + + Add a mapping of level to severity @@ -6440,6 +5855,14 @@ + + + Appends the rendered message to the buffer + + rendered message + index of the current character in the message + buffer + Initialize the options for this appender @@ -6490,235 +5913,42 @@ Mapping from level object to syslog severity - + - Message identity + Initial buffer size - - - An identifier is specified with each log message. This can be specified - by setting the property. The identity (also know - as the tag) must not contain white space. The default value for the - identity is the application name (from ). - - - + - Syslog facility + Maximum buffer size before it is recycled - - Set to one of the values. The list of - facilities is predefined and cannot be extended. The default value - is . - - + - syslog severities + A class to act as a mapping between the level that a logging call is made at and + the syslog severity that is should be logged at. - The syslog severities. + A class to act as a mapping between the level that a logging call is made at and + the syslog severity that is should be logged at. - - - system is unusable - - - + - action must be taken immediately + The mapped syslog severity for the specified level + + + Required property. + The mapped syslog severity for the specified level + + - + - critical conditions - - - - - error conditions - - - - - warning conditions - - - - - normal but significant condition - - - - - informational - - - - - debug-level messages - - - - - syslog facilities - - - - The syslog facilities - - - - - - kernel messages - - - - - random user-level messages - - - - - mail system - - - - - system daemons - - - - - security/authorization messages - - - - - messages generated internally by syslogd - - - - - line printer subsystem - - - - - network news subsystem - - - - - UUCP subsystem - - - - - clock (cron/at) daemon - - - - - security/authorization messages (private) - - - - - ftp daemon - - - - - NTP subsystem - - - - - log audit - - - - - log alert - - - - - clock daemon - - - - - reserved for local use - - - - - reserved for local use - - - - - reserved for local use - - - - - reserved for local use - - - - - reserved for local use - - - - - reserved for local use - - - - - reserved for local use - - - - - reserved for local use - - - - - A class to act as a mapping between the level that a logging call is made at and - the syslog severity that is should be logged at. - - - - A class to act as a mapping between the level that a logging call is made at and - the syslog severity that is should be logged at. - - - - - - The mapped syslog severity for the specified level - - - - Required property. - The mapped syslog severity for the specified level - - - - - - Delivers logging events to a remote logging sink. + Delivers logging events to a remote logging sink. @@ -6759,14 +5989,14 @@ for details on how to shutdown log4net programmatically. - + Nicko Cadell Gert Driesen Daniel Cazzulino - Initializes a new instance of the class. + Initializes a new instance of the class. @@ -6774,6 +6004,22 @@ + + + Gets or sets the URL of the well-known object that will accept + the logging events. + + + The well-known URL of the remote sink. + + + + The URL of the remoting sink that will accept logging events. + The sink must implement the + interface. + + + Initialize the appender based on the options set @@ -6885,22 +6131,6 @@ state it is safe to close the appender. - - - Gets or sets the URL of the well-known object that will accept - the logging events. - - - The well-known URL of the remote sink. - - - - The URL of the remoting sink that will accept logging events. - The sink must implement the - interface. - - - Interface used to deliver objects to a remote sink. @@ -7006,725 +6236,725 @@ Douglas de la Torre Edward Smit - + - Initializes a new instance of the class. + Style of rolling to use - Default constructor. + Style of rolling to use - + - Cleans up all resources used by this appender. + Roll files once per program execution + + + Roll files once per program execution. + Well really once each time this appender is + configured. + + + Setting this option also sets AppendToFile to + false on the RollingFileAppender, otherwise + this appender would just be a normal file appender. + + - + - The fully qualified type of the RollingFileAppender class. + Roll files based only on the size of the file - - Used by the internal logger to record the Type of the - log message. - - + - Sets the quiet writer being used. + Roll files based only on the date - - This method can be overridden by sub classes. - - the writer to set - + - Write out a logging event. + Roll files based on both the size and date of the file - the event to write to file. - - - Handles append time behavior for RollingFileAppender. This checks - if a roll over either by date (checked first) or time (checked second) - is need and then appends to the file last. - - - + - Write out an array of logging events. + The code assumes that the following 'time' constants are in a increasing sequence. - the events to write to file. - Handles append time behavior for RollingFileAppender. This checks - if a roll over either by date (checked first) or time (checked second) - is need and then appends to the file last. + The code assumes that the following 'time' constants are in a increasing sequence. - + - Performs any required rolling before outputting the next event + Roll the log not based on the date - - - Handles append time behavior for RollingFileAppender. This checks - if a roll over either by date (checked first) or time (checked second) - is need and then appends to the file last. - - - + - Creates and opens the file for logging. If - is false then the fully qualified name is determined and used. + Roll the log for each minute - the name of the file to open - true to append to existing file - - This method will ensure that the directory structure - for the specified exists. - - + - Get the current output file name + Roll the log for each hour - the base file name - the output file name - - The output file name is based on the base fileName specified. - If is set then the output - file name is the same as the base file passed in. Otherwise - the output file depends on the date pattern, on the count - direction or both. - - + - Determines curSizeRollBackups (only within the current roll point) + Roll the log twice a day (midday and midnight) - + - Generates a wildcard pattern that can be used to find all files - that are similar to the base file name. + Roll the log each day (midnight) - - - + - Builds a list of filenames for all files matching the base filename plus a file - pattern. + Roll the log each week - - - + - Initiates a roll over if needed for crossing a date boundary since the last run. + Roll the log each month - + - Initializes based on existing conditions at time of . + Initializes a new instance of the class. - Initializes based on existing conditions at time of . - The following is done - - determine curSizeRollBackups (only within the current roll point) - initiates a roll over if needed for crossing a date boundary since the last run. - + Default constructor. - + - Does the work of bumping the 'current' file counter higher - to the highest count when an incremental file name is seen. - The highest count is either the first file (when count direction - is greater than 0) or the last file (when count direction less than 0). - In either case, we want to know the highest count that is present. + Cleans up all resources used by this appender. - - - + - Attempts to extract a number from the end of the file name that indicates - the number of the times the file has been rolled over. + Gets or sets the strategy for determining the current date and time. The default + implementation is to use LocalDateTime which internally calls through to DateTime.Now. + DateTime.UtcNow may be used on frameworks newer than .NET 1.0 by specifying + . + + An implementation of the interface which returns the current date and time. + - Certain date pattern extensions like yyyyMMdd will be parsed as valid backup indexes. + + Gets or sets the used to return the current date and time. + + + There are two built strategies for determining the current date and time, + + and . + + + The default strategy is . + - - - - - - Takes a list of files and a base file name, and looks for - 'incremented' versions of the base file. Bumps the max - count up to the highest count seen. - - - - + - Calculates the RollPoint for the datePattern supplied. + Gets or sets the date pattern to be used for generating file names + when rolling over on date. - the date pattern to calculate the check period for - The RollPoint that is most accurate for the date pattern supplied + + The date pattern to be used for generating file names when rolling + over on date. + - Essentially the date pattern is examined to determine what the - most suitable roll point is. The roll point chosen is the roll point - with the smallest period that can be detected using the date pattern - supplied. i.e. if the date pattern only outputs the year, month, day - and hour then the smallest roll point that can be detected would be - and hourly roll point as minutes could not be detected. + + Takes a string in the same format as expected by + . + + + This property determines the rollover schedule when rolling over + on date. + - + - Initialize the appender based on the options set + Gets or sets the maximum number of backup files that are kept before + the oldest is erased. + + The maximum number of backup files that are kept before the oldest is + erased. + - This is part of the delayed object - activation scheme. The method must - be called on this object after the configuration properties have - been set. Until is called this - object is in an undefined state and must not be used. + If set to zero, then there will be no backup files and the log file + will be truncated when it reaches . - If any of the configuration properties are modified then - must be called again. + If a negative number is supplied then no deletions will be made. Note + that this could result in very slow performance as a large number of + files are rolled over unless is used. - Sets initial conditions including date/time roll over information, first check, - scheduledFilename, and calls to initialize - the current number of backups. + The maximum applies to each time based group of files and + not the total. - - - - - - .1, .2, .3, etc. - - - + - Rollover the file(s) to date/time tagged file(s). + Gets or sets the maximum size that the output file is allowed to reach + before being rolled over to backup files. - set to true if the file to be rolled is currently open + + The maximum size in bytes that the output file is allowed to reach before being + rolled over to backup files. + - Rollover the file(s) to date/time tagged file(s). - Resets curSizeRollBackups. - If fileIsOpen is set then the new file is opened (through SafeOpenFile). + This property is equivalent to except + that it is required for differentiating the setter taking a + argument from the setter taking a + argument. + + + The default maximum file size is 10MB (10*1024*1024). - + - Renames file to file . + Gets or sets the maximum size that the output file is allowed to reach + before being rolled over to backup files. - Name of existing file to roll. - New name for file. + + The maximum size that the output file is allowed to reach before being + rolled over to backup files. + - Renames file to file . It - also checks for existence of target file and deletes if it does. + This property allows you to specify the maximum size with the + suffixes "KB", "MB" or "GB" so that the size is interpreted being + expressed respectively in kilobytes, megabytes or gigabytes. + + + For example, the value "10KB" will be interpreted as 10240 bytes. + + + The default maximum file size is 10MB. + + + If you have the option to set the maximum file size programmatically + consider using the property instead as this + allows you to set the size in bytes as a . - + - Test if a file exists at a specified path + Gets or sets the rolling file count direction. - the path to the file - true if the file exists + + The rolling file count direction. + - Test if a file exists at a specified path + Indicates if the current file is the lowest numbered file or the + highest numbered file. + + + By default newer files have lower numbers ( < 0), + i.e. log.1 is most recent, log.5 is the 5th backup, etc... + + + >= 0 does the opposite i.e. + log.1 is the first backup made, log.5 is the 5th backup made, etc. + For infinite backups use >= 0 to reduce + rollover costs. + The default file count direction is -1. - + - Deletes the specified file if it exists. + Gets or sets the rolling style. - The file to delete. + The rolling style. - Delete a file if is exists. - The file is first moved to a new filename then deleted. - This allows the file to be removed even when it cannot - be deleted, but it still can be moved. - - - - - - Implements file roll base on file size. - - - - If the maximum number of size based backups is reached - (curSizeRollBackups == maxSizeRollBackups) then the oldest - file is deleted -- its index determined by the sign of countDirection. - If countDirection < 0, then files - {File.1, ..., File.curSizeRollBackups -1} - are renamed to {File.2, ..., - File.curSizeRollBackups}. Moreover, File is - renamed File.1 and closed. - - - A new file is created to receive further log output. + The default rolling style is . - If maxSizeRollBackups is equal to zero, then the - File is truncated with no backup files created. - - - If maxSizeRollBackups < 0, then File is - renamed if needed and no files are deleted. + When set to this appender's + property is set to false, otherwise + the appender would append to a single file rather than rolling + the file each time it is opened. - + - Implements file roll. + Gets or sets a value indicating whether to preserve the file name extension when rolling. - the base name to rename + + true if the file name extension should be preserved. + - If the maximum number of size based backups is reached - (curSizeRollBackups == maxSizeRollBackups) then the oldest - file is deleted -- its index determined by the sign of countDirection. - If countDirection < 0, then files - {File.1, ..., File.curSizeRollBackups -1} - are renamed to {File.2, ..., - File.curSizeRollBackups}. - - - If maxSizeRollBackups is equal to zero, then the - File is truncated with no backup files created. - - - If maxSizeRollBackups < 0, then File is - renamed if needed and no files are deleted. - - - This is called by to rename the files. + By default file.log is rolled to file.log.yyyy-MM-dd or file.log.curSizeRollBackup. + However, under Windows the new file name will loose any program associations as the + extension is changed. Optionally file.log can be renamed to file.yyyy-MM-dd.log or + file.curSizeRollBackup.log to maintain any program associations. - + - Get the start time of the next window for the current rollpoint + Gets or sets a value indicating whether to always log to + the same file. - the current date - the type of roll point we are working with - the start time for the next roll point an interval after the currentDateTime date + + true if always should be logged to the same file, otherwise false. + - Returns the date of the next roll point after the currentDateTime date passed to the method. + By default file.log is always the current file. Optionally + file.log.yyyy-mm-dd for current formatted datePattern can by the currently + logging file (or file.log.curSizeRollBackup or even + file.log.yyyy-mm-dd.curSizeRollBackup). - The basic strategy is to subtract the time parts that are less significant - than the rollpoint from the current time. This should roll the time back to - the start of the time window for the current rollpoint. Then we add 1 window - worth of time and get the start time of the next window for the rollpoint. + This will make time based rollovers with a large number of backups + much faster as the appender it won't have to rename all the backups! - - - This object supplies the current date/time. Allows test code to plug in - a method to control this class when testing date/time based rolling. The default - implementation uses the underlying value of DateTime.Now. - - - + - The date pattern. By default, the pattern is set to ".yyyy-MM-dd" - meaning daily rollover. + The fully qualified type of the RollingFileAppender class. + + Used by the internal logger to record the Type of the + log message. + - + - The actual formatted filename that is currently being written to - or will be the file transferred to on roll over - (based on staticLogFileName). + Sets the quiet writer being used. + + This method can be overridden by sub classes. + + the writer to set - + - The timestamp when we shall next recompute the filename. + Write out a logging event. + the event to write to file. + + + Handles append time behavior for RollingFileAppender. This checks + if a roll over either by date (checked first) or time (checked second) + is need and then appends to the file last. + + - + - Holds date of last roll over + Write out an array of logging events. + the events to write to file. + + + Handles append time behavior for RollingFileAppender. This checks + if a roll over either by date (checked first) or time (checked second) + is need and then appends to the file last. + + - + - The type of rolling done + Performs any required rolling before outputting the next event + + + Handles append time behavior for RollingFileAppender. This checks + if a roll over either by date (checked first) or time (checked second) + is need and then appends to the file last. + + - + - The default maximum file size is 10MB + Creates and opens the file for logging. If + is false then the fully qualified name is determined and used. + the name of the file to open + true to append to existing file + + This method will ensure that the directory structure + for the specified exists. + - + - There is zero backup files by default + Get the current output file name + the base file name + the output file name + + The output file name is based on the base fileName specified. + If is set then the output + file name is the same as the base file passed in. Otherwise + the output file depends on the date pattern, on the count + direction or both. + - + - How many sized based backups have been made so far + Determines curSizeRollBackups (only within the current roll point) - + - The rolling file count direction. + Generates a wildcard pattern that can be used to find all files + that are similar to the base file name. + + - + - The rolling mode used in this appender. + Builds a list of filenames for all files matching the base filename plus a file + pattern. + + - + - Cache flag set if we are rolling by date. + Initiates a roll over if needed for crossing a date boundary since the last run. - + - Cache flag set if we are rolling by size. + Initializes based on existing conditions at time of . + + + Initializes based on existing conditions at time of . + The following is done + + determine curSizeRollBackups (only within the current roll point) + initiates a roll over if needed for crossing a date boundary since the last run. + + + - + - Value indicating whether to always log to the same file. + Does the work of bumping the 'current' file counter higher + to the highest count when an incremental file name is seen. + The highest count is either the first file (when count direction + is greater than 0) or the last file (when count direction less than 0). + In either case, we want to know the highest count that is present. + + - + - Value indicating whether to preserve the file name extension when rolling. + Attempts to extract a number from the end of the file name that indicates + the number of the times the file has been rolled over. + + Certain date pattern extensions like yyyyMMdd will be parsed as valid backup indexes. + + + - + - FileName provided in configuration. Used for rolling properly + Takes a list of files and a base file name, and looks for + 'incremented' versions of the base file. Bumps the max + count up to the highest count seen. + + - + - A mutex that is used to lock rolling of files. + Calculates the RollPoint for the datePattern supplied. + the date pattern to calculate the check period for + The RollPoint that is most accurate for the date pattern supplied + + Essentially the date pattern is examined to determine what the + most suitable roll point is. The roll point chosen is the roll point + with the smallest period that can be detected using the date pattern + supplied. i.e. if the date pattern only outputs the year, month, day + and hour then the smallest roll point that can be detected would be + and hourly roll point as minutes could not be detected. + - + - The 1st of January 1970 in UTC + Initialize the appender based on the options set - - - - Gets or sets the strategy for determining the current date and time. The default - implementation is to use LocalDateTime which internally calls through to DateTime.Now. - DateTime.UtcNow may be used on frameworks newer than .NET 1.0 by specifying - . - - - An implementation of the interface which returns the current date and time. - - Gets or sets the used to return the current date and time. + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. - There are two built strategies for determining the current date and time, - - and . + If any of the configuration properties are modified then + must be called again. - The default strategy is . + Sets initial conditions including date/time roll over information, first check, + scheduledFilename, and calls to initialize + the current number of backups. - + - Gets or sets the date pattern to be used for generating file names - when rolling over on date. + - - The date pattern to be used for generating file names when rolling - over on date. - + + .1, .2, .3, etc. + + + + + Rollover the file(s) to date/time tagged file(s). + + set to true if the file to be rolled is currently open - Takes a string in the same format as expected by - . - - - This property determines the rollover schedule when rolling over - on date. + Rollover the file(s) to date/time tagged file(s). + Resets curSizeRollBackups. + If fileIsOpen is set then the new file is opened (through SafeOpenFile). - + - Gets or sets the maximum number of backup files that are kept before - the oldest is erased. + Renames file to file . - - The maximum number of backup files that are kept before the oldest is - erased. - + Name of existing file to roll. + New name for file. - If set to zero, then there will be no backup files and the log file - will be truncated when it reaches . - - - If a negative number is supplied then no deletions will be made. Note - that this could result in very slow performance as a large number of - files are rolled over unless is used. - - - The maximum applies to each time based group of files and - not the total. + Renames file to file . It + also checks for existence of target file and deletes if it does. - + - Gets or sets the maximum size that the output file is allowed to reach - before being rolled over to backup files. + Test if a file exists at a specified path - - The maximum size in bytes that the output file is allowed to reach before being - rolled over to backup files. - + the path to the file + true if the file exists - This property is equivalent to except - that it is required for differentiating the setter taking a - argument from the setter taking a - argument. - - - The default maximum file size is 10MB (10*1024*1024). + Test if a file exists at a specified path - + - Gets or sets the maximum size that the output file is allowed to reach - before being rolled over to backup files. + Deletes the specified file if it exists. - - The maximum size that the output file is allowed to reach before being - rolled over to backup files. - + The file to delete. - This property allows you to specify the maximum size with the - suffixes "KB", "MB" or "GB" so that the size is interpreted being - expressed respectively in kilobytes, megabytes or gigabytes. - - - For example, the value "10KB" will be interpreted as 10240 bytes. - - - The default maximum file size is 10MB. - - - If you have the option to set the maximum file size programmatically - consider using the property instead as this - allows you to set the size in bytes as a . + Delete a file if is exists. + The file is first moved to a new filename then deleted. + This allows the file to be removed even when it cannot + be deleted, but it still can be moved. - + - Gets or sets the rolling file count direction. + Implements file roll base on file size. - - The rolling file count direction. - - Indicates if the current file is the lowest numbered file or the - highest numbered file. - - - By default newer files have lower numbers ( < 0), - i.e. log.1 is most recent, log.5 is the 5th backup, etc... + If the maximum number of size based backups is reached + (curSizeRollBackups == maxSizeRollBackups) then the oldest + file is deleted -- its index determined by the sign of countDirection. + If countDirection < 0, then files + {File.1, ..., File.curSizeRollBackups -1} + are renamed to {File.2, ..., + File.curSizeRollBackups}. Moreover, File is + renamed File.1 and closed. - >= 0 does the opposite i.e. - log.1 is the first backup made, log.5 is the 5th backup made, etc. - For infinite backups use >= 0 to reduce - rollover costs. + A new file is created to receive further log output. - The default file count direction is -1. - - - - - Gets or sets the rolling style. - - The rolling style. - - The default rolling style is . + If maxSizeRollBackups is equal to zero, then the + File is truncated with no backup files created. - When set to this appender's - property is set to false, otherwise - the appender would append to a single file rather than rolling - the file each time it is opened. + If maxSizeRollBackups < 0, then File is + renamed if needed and no files are deleted. - + - Gets or sets a value indicating whether to preserve the file name extension when rolling. + Implements file roll. - - true if the file name extension should be preserved. - + the base name to rename - By default file.log is rolled to file.log.yyyy-MM-dd or file.log.curSizeRollBackup. - However, under Windows the new file name will loose any program associations as the - extension is changed. Optionally file.log can be renamed to file.yyyy-MM-dd.log or - file.curSizeRollBackup.log to maintain any program associations. + If the maximum number of size based backups is reached + (curSizeRollBackups == maxSizeRollBackups) then the oldest + file is deleted -- its index determined by the sign of countDirection. + If countDirection < 0, then files + {File.1, ..., File.curSizeRollBackups -1} + are renamed to {File.2, ..., + File.curSizeRollBackups}. - - - - - Gets or sets a value indicating whether to always log to - the same file. - - - true if always should be logged to the same file, otherwise false. - - - By default file.log is always the current file. Optionally - file.log.yyyy-mm-dd for current formatted datePattern can by the currently - logging file (or file.log.curSizeRollBackup or even - file.log.yyyy-mm-dd.curSizeRollBackup). + If maxSizeRollBackups is equal to zero, then the + File is truncated with no backup files created. - This will make time based rollovers with a large number of backups - much faster as the appender it won't have to rename all the backups! + If maxSizeRollBackups < 0, then File is + renamed if needed and no files are deleted. - - - - - Style of rolling to use - - - Style of rolling to use + This is called by to rename the files. - + - Roll files once per program execution + Get the start time of the next window for the current rollpoint + the current date + the type of roll point we are working with + the start time for the next roll point an interval after the currentDateTime date - Roll files once per program execution. - Well really once each time this appender is - configured. + Returns the date of the next roll point after the currentDateTime date passed to the method. - Setting this option also sets AppendToFile to - false on the RollingFileAppender, otherwise - this appender would just be a normal file appender. + The basic strategy is to subtract the time parts that are less significant + than the rollpoint from the current time. This should roll the time back to + the start of the time window for the current rollpoint. Then we add 1 window + worth of time and get the start time of the next window for the rollpoint. - + - Roll files based only on the size of the file + This object supplies the current date/time. Allows test code to plug in + a method to control this class when testing date/time based rolling. The default + implementation uses the underlying value of DateTime.Now. - + - Roll files based only on the date + The date pattern. By default, the pattern is set to ".yyyy-MM-dd" + meaning daily rollover. - + - Roll files based on both the size and date of the file + The actual formatted filename that is currently being written to + or will be the file transferred to on roll over + (based on staticLogFileName). - + - The code assumes that the following 'time' constants are in a increasing sequence. + The timestamp when we shall next recompute the filename. - - - The code assumes that the following 'time' constants are in a increasing sequence. - - - + - Roll the log not based on the date + Holds date of last roll over - + - Roll the log for each minute + The type of rolling done - + - Roll the log for each hour + The default maximum file size is 10MB - + - Roll the log twice a day (midday and midnight) + There is zero backup files by default - + - Roll the log each day (midnight) + How many sized based backups have been made so far - + - Roll the log each week + The rolling file count direction. - + - Roll the log each month + The rolling mode used in this appender. + + + + + Cache flag set if we are rolling by date. + + + + + Cache flag set if we are rolling by size. + + + + + Value indicating whether to always log to the same file. + + + + + Value indicating whether to preserve the file name extension when rolling. + + + + + FileName provided in configuration. Used for rolling properly + + + + + A mutex that is used to lock rolling of files. + + + + + The 1st of January 1970 in UTC @@ -7824,23 +7054,6 @@ - - - Sends the contents of the cyclic buffer as an e-mail message. - - The logging events to send. - - - - Send the email message - - the body text to include in the mail - - - - trims leading and trailing commas or semicolons - - Gets or sets a comma- or semicolon-delimited list of recipient e-mail addresses (use semicolon on .NET 1.1 and comma for later versions). @@ -8059,6 +7272,12 @@ The default encoding is the operating system's current ANSI codepage. + + + Sends the contents of the cyclic buffer as an e-mail message. + + The logging events to send. + This appender requires a to be set. @@ -8070,6 +7289,12 @@ + + + Send the email message + + the body text to include in the mail + Values for the property. @@ -8101,6 +7326,11 @@ Uses the Windows credentials from the current thread or process to authenticate. + + + trims leading and trailing commas or semicolons + + Send an email when a specific logging event occurs, typically on errors @@ -8136,55 +7366,6 @@ - - - Sends the contents of the cyclic buffer as an e-mail message. - - The logging events to send. - - - Sends the contents of the cyclic buffer as an e-mail message. - - - - - - Activate the options on this appender. - - - - This is part of the delayed object - activation scheme. The method must - be called on this object after the configuration properties have - been set. Until is called this - object is in an undefined state and must not be used. - - - If any of the configuration properties are modified then - must be called again. - - - - - - Convert a path into a fully qualified path. - - The path to convert. - The fully qualified path. - - - Converts the path specified to a fully - qualified path. If the path is relative it is - taken as relative from the application base - directory. - - - - - - The security context to use for privileged calls - - Gets or sets a semicolon-delimited list of recipient e-mail addresses. @@ -8264,6 +7445,35 @@ + + + Sends the contents of the cyclic buffer as an e-mail message. + + The logging events to send. + + + Sends the contents of the cyclic buffer as an e-mail message. + + + + + + Activate the options on this appender. + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + This appender requires a to be set. @@ -8275,11 +7485,31 @@ + + + Convert a path into a fully qualified path. + + The path to convert. + The fully qualified path. + + + Converts the path specified to a fully + qualified path. If the path is relative it is + taken as relative from the application base + directory. + + + + + + The security context to use for privileged calls + + Appender that allows clients to connect via Telnet to receive log messages - + The TelnetAppender accepts socket connections and streams logging messages back to the client. @@ -8313,6 +7543,22 @@ log message. + + + Gets or sets the TCP port number on which this will listen for connections. + + + An integer value in the range to + indicating the TCP port number on which this will listen for connections. + + + + The default value is 23 (the telnet port). + + + The value specified is less than + or greater than . + Overrides the parent method to close the socket handler @@ -8323,6 +7569,17 @@ + + + This appender requires a to be set. + + true + + + This appender requires a to be set. + + + Initialize the appender based on the options set. @@ -8355,68 +7612,83 @@ - + - Gets or sets the TCP port number on which this will listen for connections. + Helper class to manage connected clients - - An integer value in the range to - indicating the TCP port number on which this will listen for connections. - - The default value is 23 (the telnet port). + The SocketHandler class is used to accept connections from + clients. It is threaded so that clients can connect/disconnect + asynchronously. - The value specified is less than - or greater than . - + - This appender requires a to be set. + Class that represents a client connected to this handler - true - This appender requires a to be set. + Class that represents a client connected to this handler - + - Helper class to manage connected clients + Create this for the specified + the client's socket - The SocketHandler class is used to accept connections from - clients. It is threaded so that clients can connect/disconnect - asynchronously. + Opens a stream writer on the socket. - + - Opens a new server port on + Write a string to the client - the local port to listen on for connections + string to send - Creates a socket handler on the specified local server port. + Write a string to the client - + - Sends a string message to each of the connected clients + Cleanup the clients connection - the text to send - Sends a string message to each of the connected clients + Close the socket connection. - + + + Opens a new server port on + + the local port to listen on for connections + + + Creates a socket handler on the specified local server port. + + + + + + Sends a string message to each of the connected clients + + the text to send + + + Sends a string message to each of the connected clients + + + + Add a client to the internal clients list @@ -8428,6 +7700,21 @@ client to remove + + + Test if this handler has active connections + + + true if this handler has active connections + + + + This property will be true while this handler has + active connections, that is at least one connection that + the handler will attempt to send a message to. + + + Callback used to accept a connection on the server socket @@ -8450,1347 +7737,1158 @@ - + - Test if this handler has active connections + Sends logging events to a . - - true if this handler has active connections - - This property will be true while this handler has - active connections, that is at least one connection that - the handler will attempt to send a message to. + An Appender that writes to a . + + + This appender may be used stand alone if initialized with an appropriate + writer, however it is typically used as a base class for an appender that + can open a to write to. + Nicko Cadell + Gert Driesen + Douglas de la Torre - + - Class that represents a client connected to this handler + Initializes a new instance of the class. - Class that represents a client connected to this handler + Default constructor. - + - Create this for the specified + Initializes a new instance of the class and + sets the output destination to a new initialized + with the specified . - the client's socket + The layout to use with this appender. + The to output to. - Opens a stream writer on the socket. + Obsolete constructor. - + - Write a string to the client + Initializes a new instance of the class and sets + the output destination to the specified . - string to send + The layout to use with this appender + The to output to + + The must have been previously opened. + - Write a string to the client + Obsolete constructor. - + - Cleanup the clients connection + Gets or set whether the appender will flush at the end + of each append operation. - + - Close the socket connection. + The default behavior is to flush at the end of each + append operation. + + + If this option is set to false, then the underlying + stream can defer persisting the logging event to a later + time. + + + Avoiding the flush operation at the end of each append results in + a performance gain of 10 to 20 percent. However, there is safety + trade-off involved in skipping flushing. Indeed, when flushing is + skipped, then it is likely that the last few log events will not + be recorded on disk when the application exits. This is a high + price to pay even for a 20% performance gain. - + - Appends log events to the system. + Sets the where the log output will go. - The application configuration file can be used to control what listeners - are actually used. See the MSDN documentation for the - class for details on configuring the - trace system. + The specified must be open and writable. - Events are written using the System.Diagnostics.Trace.Write(string,string) - method. The event's logger name is the default value for the category parameter - of the Write method. + The will be closed when the appender + instance is closed. - Compact Framework
- The Compact Framework does not support the - class for any operation except Assert. When using the Compact Framework this - appender will write to the system rather than - the Trace system. This appender will therefore behave like the . + Note: Logging to an unopened will fail.
- Douglas de la Torre - Nicko Cadell - Gert Driesen - Ron Grabowski
- + - Initializes a new instance of the . + This method determines if there is a sense in attempting to append. - Default constructor. + This method checks if an output target has been set and if a + layout has been set. + false if any of the preconditions fail. - + - Initializes a new instance of the - with a specified layout. + This method is called by the + method. - The layout to use with this appender. + The event to log. - Obsolete constructor. + Writes a log statement to the output stream if the output stream exists + and is writable. + + + The format of the output will depend on the appender's layout. - + - Writes the logging event to the system. + This method is called by the + method. - The event to log. + The array of events to log. - Writes the logging event to the system. + This method writes all the bulk logged events to the output writer + before flushing the stream. - + - Immediate flush means that the underlying writer or output stream - will be flushed at the end of each append operation. + Close this appender instance. The underlying stream or writer is also closed. - - Immediate flush is slower but ensures that each append request is - actually written. If is set to - false, then there is a good chance that the last few - logs events are not actually written to persistent media if and - when the application crashes. - - - The default value is true. + Closed appenders cannot be reused. - + - Defaults to %logger + Gets or set the and the underlying + , if any, for this appender. + + The for this appender. + - + - Flushes any buffered log data. + This appender requires a to be set. - The maximum time to wait for logging events to be flushed. - True if all logging events were flushed successfully, else false. + true + + + This appender requires a to be set. + + - + - Gets or sets a value that indicates whether the appender will - flush at the end of each write. + Writes the footer and closes the underlying . - The default behavior is to flush at the end of each - write. If the option is set tofalse, then the underlying - stream can defer writing to physical medium to a later time. - - Avoiding the flush operation at the end of each append results - in a performance gain of 10 to 20 percent. However, there is safety - trade-off involved in skipping flushing. Indeed, when flushing is - skipped, then it is likely that the last few log events will not - be recorded on disk when the application exits. This is a high - price to pay even for a 20% performance gain. + Writes the footer and closes the underlying . - + - The category parameter sent to the Trace method. + Closes the underlying . - Defaults to %logger which will use the logger name of the current - as the category parameter. + Closes the underlying . - - - + - This appender requires a to be set. + Clears internal references to the underlying + and other variables. - true - This appender requires a to be set. + Subclasses can override this method for an alternate closing behavior. - + - Assembly level attribute that specifies a domain to alias to this assembly's repository. + Writes a footer as produced by the embedded layout's property. - AliasDomainAttribute is obsolete. Use AliasRepositoryAttribute instead of AliasDomainAttribute. - - - An assembly's logger repository is defined by its , - however this can be overridden by an assembly loaded before the target assembly. - - - An assembly can alias another assembly's domain to its repository by - specifying this attribute with the name of the target domain. + Writes a footer as produced by the embedded layout's property. + + + + + Writes a header produced by the embedded layout's property. + + - This attribute can only be specified on the assembly and may be used - as many times as necessary to alias all the required domains. + Writes a header produced by the embedded layout's property. - Nicko Cadell - Gert Driesen - + - Assembly level attribute that specifies a repository to alias to this assembly's repository. + Called to allow a subclass to lazily initialize the writer - An assembly's logger repository is defined by its , - however this can be overridden by an assembly loaded before the target assembly. - - - An assembly can alias another assembly's repository to its repository by - specifying this attribute with the name of the target repository. - - - This attribute can only be specified on the assembly and may be used - as many times as necessary to alias all the required repositories. - - - Nicko Cadell - Gert Driesen - - - - Initializes a new instance of the class with - the specified repository to alias to this assembly's repository. - - The repository to alias to this assemby's repository. - - - Initializes a new instance of the class with - the specified repository to alias to this assembly's repository. + This method is called when an event is logged and the or + have not been set. This allows a subclass to + attempt to initialize the writer multiple times. - + - Gets or sets the repository to alias to this assemby's repository. + Gets or sets the where logging events + will be written to. - The repository to alias to this assemby's repository. + The where logging events are written. - The name of the repository to alias to this assemby's repository. + This is the where logging events + will be written to. - + - Initializes a new instance of the class with - the specified domain to alias to this assembly's repository. + This is the where logging events + will be written to. - The domain to alias to this assemby's repository. - - - Obsolete. Use instead of . - - - + - Use this class to quickly configure a . + Immediate flush means that the underlying + or output stream will be flushed at the end of each append operation. - Allows very simple programmatic configuration of log4net. - - - Only one appender can be configured using this configurator. - The appender is set at the root of the hierarchy and all logging - events will be delivered to that appender. + Immediate flush is slower but ensures that each append request is + actually written. If is set to + false, then there is a good chance that the last few + logging events are not actually persisted if and when the application + crashes. - Appenders can also implement the interface. Therefore - they would require that the method - be called after the appenders properties have been configured. + The default value is true. - Nicko Cadell - Gert Driesen - + - The fully qualified type of the BasicConfigurator class. + The fully qualified type of the TextWriterAppender class. Used by the internal logger to record the Type of the log message. - + - Initializes a new instance of the class. + Flushes any buffered log data. - - - Uses a private access modifier to prevent instantiation of this class. - - + The maximum time to wait for logging events to be flushed. + True if all logging events were flushed successfully, else false. - + - Initializes the log4net system with a default configuration. + Appends log events to the system. - Initializes the log4net logging system using a - that will write to Console.Out. The log messages are - formatted using the layout object - with the - layout style. + The application configuration file can be used to control what listeners + are actually used. See the MSDN documentation for the + class for details on configuring the + trace system. - - - - - Initializes the log4net system using the specified appenders. - - The appenders to use to log all logging events. - - Initializes the log4net system using the specified appenders. + Events are written using the System.Diagnostics.Trace.Write(string,string) + method. The event's logger name is the default value for the category parameter + of the Write method. - - - - - Initializes the log4net system using the specified appender. - - The appender to use to log all logging events. - - Initializes the log4net system using the specified appender. + Compact Framework
+ The Compact Framework does not support the + class for any operation except Assert. When using the Compact Framework this + appender will write to the system rather than + the Trace system. This appender will therefore behave like the .
+ Douglas de la Torre + Nicko Cadell + Gert Driesen + Ron Grabowski
- + - Initializes the with a default configuration. + Initializes a new instance of the . - The repository to configure. - Initializes the specified repository using a - that will write to Console.Out. The log messages are - formatted using the layout object - with the - layout style. + Default constructor. - + - Initializes the using the specified appender. + Initializes a new instance of the + with a specified layout. - The repository to configure. - The appender to use to log all logging events. + The layout to use with this appender. - Initializes the using the specified appender. + Obsolete constructor. - + - Initializes the using the specified appenders. + Gets or sets a value that indicates whether the appender will + flush at the end of each write. - The repository to configure. - The appenders to use to log all logging events. + The default behavior is to flush at the end of each + write. If the option is set tofalse, then the underlying + stream can defer writing to physical medium to a later time. + - Initializes the using the specified appender. + Avoiding the flush operation at the end of each append results + in a performance gain of 10 to 20 percent. However, there is safety + trade-off involved in skipping flushing. Indeed, when flushing is + skipped, then it is likely that the last few log events will not + be recorded on disk when the application exits. This is a high + price to pay even for a 20% performance gain. - - - Base class for all log4net configuration attributes. - - - This is an abstract class that must be extended by - specific configurators. This attribute allows the - configurator to be parameterized by an assembly level - attribute. - - Nicko Cadell - Gert Driesen - - + - Constructor used by subclasses. + The category parameter sent to the Trace method. - the ordering priority for this configurator - The is used to order the configurator - attributes before they are invoked. Higher priority configurators are executed - before lower priority ones. + Defaults to %logger which will use the logger name of the current + as the category parameter. + + - + - Configures the for the specified assembly. + Writes the logging event to the system. - The assembly that this attribute was defined on. - The repository to configure. + The event to log. - Abstract method implemented by a subclass. When this method is called - the subclass should configure the . + Writes the logging event to the system. - + - Compare this instance to another ConfiguratorAttribute + This appender requires a to be set. - the object to compare to - see + true - Compares the priorities of the two instances. - Sorts by priority in descending order. Objects with the same priority are - randomly ordered. + This appender requires a to be set. - + - Assembly level attribute that specifies the logging domain for the assembly. + Immediate flush means that the underlying writer or output stream + will be flushed at the end of each append operation. - DomainAttribute is obsolete. Use RepositoryAttribute instead of DomainAttribute. - - - Assemblies are mapped to logging domains. Each domain has its own - logging repository. This attribute specified on the assembly controls - the configuration of the domain. The property specifies the name - of the domain that this assembly is a part of. The - specifies the type of the repository objects to create for the domain. If - this attribute is not specified and a is not specified - then the assembly will be part of the default shared logging domain. + Immediate flush is slower but ensures that each append request is + actually written. If is set to + false, then there is a good chance that the last few + logs events are not actually written to persistent media if and + when the application crashes. - This attribute can only be specified on the assembly and may only be used - once per assembly. - + The default value is true. - Nicko Cadell - Gert Driesen - + - Assembly level attribute that specifies the logging repository for the assembly. + Defaults to %logger - - - Assemblies are mapped to logging repository. This attribute specified - on the assembly controls - the configuration of the repository. The property specifies the name - of the repository that this assembly is a part of. The - specifies the type of the object - to create for the assembly. If this attribute is not specified or a - is not specified then the assembly will be part of the default shared logging repository. - - - This attribute can only be specified on the assembly and may only be used - once per assembly. - - - Nicko Cadell - Gert Driesen - + - Initializes a new instance of the class. + Flushes any buffered log data. - - - Default constructor. - + The maximum time to wait for logging events to be flushed. + True if all logging events were flushed successfully, else false. + + + + Sends logging events as connectionless UDP datagrams to a remote host or a + multicast group using an . + + + + UDP guarantees neither that messages arrive, nor that they arrive in the correct order. + + + To view the logging results, a custom application can be developed that listens for logging + events. + + + When decoding events send via this appender remember to use the same encoding + to decode the events as was used to send the events. See the + property to specify the encoding to use. + + + + This example shows how to log receive logging events that are sent + on IP address 244.0.0.1 and port 8080 to the console. The event is + encoded in the packet as a unicode string and it is decoded as such. + + IPEndPoint remoteEndPoint = new IPEndPoint(IPAddress.Any, 0); + UdpClient udpClient; + byte[] buffer; + string loggingEvent; + + try + { + udpClient = new UdpClient(8080); + + while(true) + { + buffer = udpClient.Receive(ref remoteEndPoint); + loggingEvent = System.Text.Encoding.Unicode.GetString(buffer); + Console.WriteLine(loggingEvent); + } + } + catch(Exception e) + { + Console.WriteLine(e.ToString()); + } + + + Dim remoteEndPoint as IPEndPoint + Dim udpClient as UdpClient + Dim buffer as Byte() + Dim loggingEvent as String + + Try + remoteEndPoint = new IPEndPoint(IPAddress.Any, 0) + udpClient = new UdpClient(8080) + + While True + buffer = udpClient.Receive(ByRef remoteEndPoint) + loggingEvent = System.Text.Encoding.Unicode.GetString(buffer) + Console.WriteLine(loggingEvent) + Wend + Catch e As Exception + Console.WriteLine(e.ToString()) + End Try + + + An example configuration section to log information using this appender to the + IP 224.0.0.1 on port 8080: + + + + + + + + + + Gert Driesen + Nicko Cadell + + + + Initializes a new instance of the class. + + + The default constructor initializes all fields to their default values. - + - Initialize a new instance of the class - with the name of the repository. + Gets or sets the IP address of the remote host or multicast group to which + the underlying should sent the logging event. - The name of the repository. + + The IP address of the remote host or multicast group to which the logging event + will be sent. + - Initialize the attribute with the name for the assembly's repository. + Multicast addresses are identified by IP class D addresses (in the range 224.0.0.0 to + 239.255.255.255). Multicast packets can pass across different networks through routers, so + it is possible to use multicasts in an Internet scenario as long as your network provider + supports multicasting. + + + Hosts that want to receive particular multicast messages must register their interest by joining + the multicast group. Multicast messages are not sent to networks where no host has joined + the multicast group. Class D IP addresses are used for multicast groups, to differentiate + them from normal host addresses, allowing nodes to easily detect if a message is of interest. + + + Static multicast addresses that are needed globally are assigned by IANA. A few examples are listed in the table below: + + + + + IP Address + Description + + + 224.0.0.1 + + + Sends a message to all system on the subnet. + + + + + 224.0.0.2 + + + Sends a message to all routers on the subnet. + + + + + 224.0.0.12 + + + The DHCP server answers messages on the IP address 224.0.0.12, but only on a subnet. + + + + + + + A complete list of actually reserved multicast addresses and their owners in the ranges + defined by RFC 3171 can be found at the IANA web site. + + + The address range 239.0.0.0 to 239.255.255.255 is reserved for administrative scope-relative + addresses. These addresses can be reused with other local groups. Routers are typically + configured with filters to prevent multicast traffic in this range from flowing outside + of the local network. - + - Gets or sets the name of the logging repository. + Gets or sets the TCP port number of the remote host or multicast group to which + the underlying should sent the logging event. - The string name to use as the name of the repository associated with this - assembly. + An integer value in the range to + indicating the TCP port number of the remote host or multicast group to which the logging event + will be sent. - - This value does not have to be unique. Several assemblies can share the - same repository. They will share the logging configuration of the repository. - + The underlying will send messages to this TCP port number + on the remote host or multicast group. + The value specified is less than or greater than . - + - Gets or sets the type of repository to create for this assembly. + Gets or sets the TCP port number from which the underlying will communicate. - The type of repository to create for this assembly. + An integer value in the range to + indicating the TCP port number from which the underlying will communicate. - The type of the repository to create for the assembly. - The type must implement the - interface. + The underlying will bind to this port for sending messages. - This will be the type of repository created when - the repository is created. If multiple assemblies reference the - same repository then the repository is only created once using the - of the first assembly to call into the - repository. + Setting the value to 0 (the default) will cause the udp client not to bind to + a local port. + The value specified is less than or greater than . - + - Initializes a new instance of the class. + Gets or sets used to write the packets. + + The used to write the packets. + - Obsolete. Use RepositoryAttribute instead of DomainAttribute. + The used to write the packets. - + - Initialize a new instance of the class - with the name of the domain. + Gets or sets the underlying . - The name of the domain. + + The underlying . + - - Obsolete. Use RepositoryAttribute instead of DomainAttribute. - + creates a to send logging events + over a network. Classes deriving from can use this + property to get or set this . Use the underlying + returned from if you require access beyond that which + provides. - + - Use this class to initialize the log4net environment using an Xml tree. + Gets or sets the cached remote endpoint to which the logging events should be sent. + + + The cached remote endpoint to which the logging events will be sent. + + + The method will initialize the remote endpoint + with the values of the and + properties. + + + + + Initialize the appender based on the options set. - DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator. + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. - Configures a using an Xml tree. + If any of the configuration properties are modified then + must be called again. + + + The appender will be ignored if no was specified or + an invalid remote or local TCP port number was specified. - Nicko Cadell - Gert Driesen + The required property was not specified. + The TCP port number assigned to or is less than or greater than . - + - Private constructor + This method is called by the method. + The event to log. + + + Sends the event using an UDP datagram. + + + Exceptions are passed to the . + + - + - Automatically configures the log4net system based on the - application's configuration settings. + This appender requires a to be set. + true - DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator. + This appender requires a to be set. - Each application has a configuration file. This has the - same name as the application with '.config' appended. - This file is XML and calling this function prompts the - configurator to look in that file for a section called - log4net that contains the configuration data. - + - Automatically configures the using settings - stored in the application's configuration file. + Closes the UDP connection and releases all resources associated with + this instance. - DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator. + Disables the underlying and releases all managed + and unmanaged resources associated with the . - Each application has a configuration file. This has the - same name as the application with '.config' appended. - This file is XML and calling this function prompts the - configurator to look in that file for a section called - log4net that contains the configuration data. - The repository to configure. - + - Configures log4net using a log4net element + Initializes the underlying connection. - DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator. + The underlying is initialized and binds to the + port number from which you intend to communicate. + + + Exceptions are passed to the . - Loads the log4net configuration from the XML element - supplied as . - The element to parse. - + - Configures the using the specified XML - element. + The IP address of the remote host or multicast group to which + the logging event will be sent. - - - DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator. - - Loads the log4net configuration from the XML element - supplied as . - - The repository to configure. - The element to parse. - + - Configures log4net using the specified configuration file. + The TCP port number of the remote host or multicast group to + which the logging event will be sent. + + + + + The cached remote endpoint to which the logging events will be sent. + + + + + The TCP port number from which the will communicate. + + + + + The instance that will be used for sending the + logging events. + + + + + The encoding to use for the packet. + + + + + Assembly level attribute that specifies a domain to alias to this assembly's repository. - The XML file to load the configuration from. - DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator. + AliasDomainAttribute is obsolete. Use AliasRepositoryAttribute instead of AliasDomainAttribute. - The configuration file must be valid XML. It must contain - at least one element called log4net that holds - the log4net configuration data. + An assembly's logger repository is defined by its , + however this can be overridden by an assembly loaded before the target assembly. - The log4net configuration file can possible be specified in the application's - configuration file (either MyAppName.exe.config for a - normal application on Web.config for an ASP.NET application). + An assembly can alias another assembly's domain to its repository by + specifying this attribute with the name of the target domain. - - The following example configures log4net using a configuration file, of which the - location is stored in the application's configuration file : - - - using log4net.Config; - using System.IO; - using System.Configuration; - - ... - - DOMConfigurator.Configure(new FileInfo(ConfigurationSettings.AppSettings["log4net-config-file"])); - - In the .config file, the path to the log4net can be specified like this : + This attribute can only be specified on the assembly and may be used + as many times as necessary to alias all the required domains. - - - - - - - + Nicko Cadell + Gert Driesen - + - Configures log4net using the specified configuration file. + Initializes a new instance of the class with + the specified domain to alias to this assembly's repository. - A stream to load the XML configuration from. + The domain to alias to this assemby's repository. - DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator. - - - The configuration data must be valid XML. It must contain - at least one element called log4net that holds - the log4net configuration data. - - - Note that this method will NOT close the stream parameter. + Obsolete. Use instead of . - + - Configures the using the specified configuration - file. + Assembly level attribute that specifies a repository to alias to this assembly's repository. - The repository to configure. - The XML file to load the configuration from. - DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator. - - - The configuration file must be valid XML. It must contain - at least one element called log4net that holds - the configuration data. + An assembly's logger repository is defined by its , + however this can be overridden by an assembly loaded before the target assembly. - The log4net configuration file can possible be specified in the application's - configuration file (either MyAppName.exe.config for a - normal application on Web.config for an ASP.NET application). + An assembly can alias another assembly's repository to its repository by + specifying this attribute with the name of the target repository. - - The following example configures log4net using a configuration file, of which the - location is stored in the application's configuration file : - - - using log4net.Config; - using System.IO; - using System.Configuration; - - ... - - DOMConfigurator.Configure(new FileInfo(ConfigurationSettings.AppSettings["log4net-config-file"])); - - In the .config file, the path to the log4net can be specified like this : + This attribute can only be specified on the assembly and may be used + as many times as necessary to alias all the required repositories. - - - - - - - + Nicko Cadell + Gert Driesen - + - Configures the using the specified configuration - file. + Initializes a new instance of the class with + the specified repository to alias to this assembly's repository. - The repository to configure. - The stream to load the XML configuration from. + The repository to alias to this assemby's repository. - DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator. - - - The configuration data must be valid XML. It must contain - at least one element called log4net that holds - the configuration data. - - - Note that this method will NOT close the stream parameter. + Initializes a new instance of the class with + the specified repository to alias to this assembly's repository. - + - Configures log4net using the file specified, monitors the file for changes - and reloads the configuration if a change is detected. + Gets or sets the repository to alias to this assemby's repository. - The XML file to load the configuration from. + + The repository to alias to this assemby's repository. + - DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator. - - - The configuration file must be valid XML. It must contain - at least one element called log4net that holds - the configuration data. - - - The configuration file will be monitored using a - and depends on the behavior of that class. - - - For more information on how to configure log4net using - a separate configuration file, see . + The name of the repository to alias to this assemby's repository. - - + - Configures the using the file specified, - monitors the file for changes and reloads the configuration if a change - is detected. + Use this class to quickly configure a . - The repository to configure. - The XML file to load the configuration from. - DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator. - - - The configuration file must be valid XML. It must contain - at least one element called log4net that holds - the configuration data. + Allows very simple programmatic configuration of log4net. - The configuration file will be monitored using a - and depends on the behavior of that class. + Only one appender can be configured using this configurator. + The appender is set at the root of the hierarchy and all logging + events will be delivered to that appender. - For more information on how to configure log4net using - a separate configuration file, see . + Appenders can also implement the interface. Therefore + they would require that the method + be called after the appenders properties have been configured. - + Nicko Cadell + Gert Driesen - + - Assembly level attribute to configure the . + The fully qualified type of the BasicConfigurator class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Initializes a new instance of the class. - AliasDomainAttribute is obsolete. Use AliasRepositoryAttribute instead of AliasDomainAttribute. - - - This attribute may only be used at the assembly scope and can only - be used once per assembly. - - - Use this attribute to configure the - without calling one of the - methods. + Uses a private access modifier to prevent instantiation of this class. - Nicko Cadell - Gert Driesen - + - Assembly level attribute to configure the . + Initializes the log4net system with a default configuration. - This attribute may only be used at the assembly scope and can only - be used once per assembly. - - - Use this attribute to configure the - without calling one of the - methods. - - - If neither of the or - properties are set the configuration is loaded from the application's .config file. - If set the property takes priority over the - property. The property - specifies a path to a file to load the config from. The path is relative to the - application's base directory; . - The property is used as a postfix to the assembly file name. - The config file must be located in the application's base directory; . - For example in a console application setting the to - config has the same effect as not specifying the or - properties. - - - The property can be set to cause the - to watch the configuration file for changes. - - - - Log4net will only look for assembly level configuration attributes once. - When using the log4net assembly level attributes to control the configuration - of log4net you must ensure that the first call to any of the - methods is made from the assembly with the configuration - attributes. - - - If you cannot guarantee the order in which log4net calls will be made from - different assemblies you must use programmatic configuration instead, i.e. - call the method directly. + Initializes the log4net logging system using a + that will write to Console.Out. The log messages are + formatted using the layout object + with the + layout style. - - Nicko Cadell - Gert Driesen - + - Default constructor + Initializes the log4net system using the specified appenders. + The appenders to use to log all logging events. - Default constructor + Initializes the log4net system using the specified appenders. - + - Configures the for the specified assembly. + Initializes the log4net system using the specified appender. - The assembly that this attribute was defined on. - The repository to configure. + The appender to use to log all logging events. - Configure the repository using the . - The specified must extend the - class otherwise the will not be able to - configure it. + Initializes the log4net system using the specified appender. - The does not extend . - - - - Attempt to load configuration from the local file system - - The assembly that this attribute was defined on. - The repository to configure. - - - - Configure the specified repository using a - - The repository to configure. - the FileInfo pointing to the config file - - - - Attempt to load configuration from a URI - - The assembly that this attribute was defined on. - The repository to configure. - - - - The fully qualified type of the XmlConfiguratorAttribute class. - - - Used by the internal logger to record the Type of the - log message. - - + - Gets or sets the filename of the configuration file. + Initializes the with a default configuration. - - The filename of the configuration file. - + The repository to configure. - If specified, this is the name of the configuration file to use with - the . This file path is relative to the - application base directory (). - - - The takes priority over the . + Initializes the specified repository using a + that will write to Console.Out. The log messages are + formatted using the layout object + with the + layout style. - + - Gets or sets the extension of the configuration file. + Initializes the using the specified appender. - - The extension of the configuration file. - + The repository to configure. + The appender to use to log all logging events. - If specified this is the extension for the configuration file. - The path to the config file is built by using the application - base directory (), - the assembly file name and the config file extension. - - - If the is set to MyExt then - possible config file names would be: MyConsoleApp.exe.MyExt or - MyClassLibrary.dll.MyExt. - - - The takes priority over the . + Initializes the using the specified appender. - + - Gets or sets a value indicating whether to watch the configuration file. + Initializes the using the specified appenders. - - true if the configuration should be watched, false otherwise. - + The repository to configure. + The appenders to use to log all logging events. - If this flag is specified and set to true then the framework - will watch the configuration file and will reload the config each time - the file is modified. - - - The config file can only be watched if it is loaded from local disk. - In a No-Touch (Smart Client) deployment where the application is downloaded - from a web server the config file may not reside on the local disk - and therefore it may not be able to watch it. + Initializes the using the specified appender. - - Watching configuration is not supported on the SSCLI. - - + - Class to register for the log4net section of the configuration file + Base class for all log4net configuration attributes. - The log4net section of the configuration file needs to have a section - handler registered. This is the section handler used. It simply returns - the XML element that is the root of the section. + This is an abstract class that must be extended by + specific configurators. This attribute allows the + configurator to be parameterized by an assembly level + attribute. - - Example of registering the log4net section handler : - - - -
- - - log4net configuration XML goes here - - - - Nicko Cadell Gert Driesen - + - Initializes a new instance of the class. + Constructor used by subclasses. + the ordering priority for this configurator - Default constructor. + The is used to order the configurator + attributes before they are invoked. Higher priority configurators are executed + before lower priority ones. - + - Parses the configuration section. + Configures the for the specified assembly. - The configuration settings in a corresponding parent configuration section. - The configuration context when called from the ASP.NET configuration system. Otherwise, this parameter is reserved and is a null reference. - The for the log4net section. - The for the log4net section. + The assembly that this attribute was defined on. + The repository to configure. - Returns the containing the configuration data, + Abstract method implemented by a subclass. When this method is called + the subclass should configure the . - + - Assembly level attribute that specifies a plugin to attach to - the repository. + Compare this instance to another ConfiguratorAttribute + the object to compare to + see - Specifies the type of a plugin to create and attach to the - assembly's repository. The plugin type must implement the - interface. + Compares the priorities of the two instances. + Sorts by priority in descending order. Objects with the same priority are + randomly ordered. - Nicko Cadell - Gert Driesen - + - Interface used to create plugins. + Assembly level attribute that specifies the logging domain for the assembly. - Interface used to create a plugin. + DomainAttribute is obsolete. Use RepositoryAttribute instead of DomainAttribute. + + + Assemblies are mapped to logging domains. Each domain has its own + logging repository. This attribute specified on the assembly controls + the configuration of the domain. The property specifies the name + of the domain that this assembly is a part of. The + specifies the type of the repository objects to create for the domain. If + this attribute is not specified and a is not specified + then the assembly will be part of the default shared logging domain. + + + This attribute can only be specified on the assembly and may only be used + once per assembly. Nicko Cadell Gert Driesen - + - Creates the plugin object. + Initializes a new instance of the class. - the new plugin instance - Create and return a new plugin instance. + Obsolete. Use RepositoryAttribute instead of DomainAttribute. - + - Initializes a new instance of the class - with the specified type. + Initialize a new instance of the class + with the name of the domain. - The type name of plugin to create. + The name of the domain. - Create the attribute with the plugin type specified. - - - Where possible use the constructor that takes a . + Obsolete. Use RepositoryAttribute instead of DomainAttribute. - + - Initializes a new instance of the class - with the specified type. + Use this class to initialize the log4net environment using an Xml tree. - The type of plugin to create. - Create the attribute with the plugin type specified. + DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator. + + + Configures a using an Xml tree. + Nicko Cadell + Gert Driesen - - - Creates the plugin object defined by this attribute. - - - - Creates the instance of the object as - specified by this attribute. - - - The plugin object. - - - - Returns a representation of the properties of this object. - - - - Overrides base class method to - return a representation of the properties of this object. - - - A representation of the properties of this object - - - - Gets or sets the type for the plugin. - - - The type for the plugin. - - - - The type for the plugin. - - - - - - Gets or sets the type name for the plugin. - - - The type name for the plugin. - - - - The type name for the plugin. - - - Where possible use the property instead. - - - - - - Assembly level attribute to configure the . - - - - This attribute may only be used at the assembly scope and can only - be used once per assembly. - - - Use this attribute to configure the - without calling one of the - methods. - - - Nicko Cadell - - - - Construct provider attribute with type specified - - the type of the provider to use - - - The provider specified must subclass the - class. - - - - - - Configures the SecurityContextProvider - - The assembly that this attribute was defined on. - The repository to configure. - - - Creates a provider instance from the specified. - Sets this as the default security context provider . - - - - - - The fully qualified type of the SecurityContextProviderAttribute class. - - - Used by the internal logger to record the Type of the - log message. - - - + - Gets or sets the type of the provider to use. + Private constructor - - the type of the provider to use. - - - - The provider specified must subclass the - class. - - - + - Use this class to initialize the log4net environment using an Xml tree. + Automatically configures the log4net system based on the + application's configuration settings. - Configures a using an Xml tree. + DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator. + Each application has a configuration file. This has the + same name as the application with '.config' appended. + This file is XML and calling this function prompts the + configurator to look in that file for a section called + log4net that contains the configuration data. - Nicko Cadell - Gert Driesen - - - - Private constructor - - + Automatically configures the using settings stored in the application's configuration file. + DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator. + Each application has a configuration file. This has the same name as the application with '.config' appended. This file is XML and calling this function prompts the configurator to look in that file for a section called log4net that contains the configuration data. - - - To use this method to configure log4net you must specify - the section - handler for the log4net configuration section. See the - for an example. - The repository to configure. - + - Automatically configures the log4net system based on the - application's configuration settings. + Configures log4net using a log4net element - Each application has a configuration file. This has the - same name as the application with '.config' appended. - This file is XML and calling this function prompts the - configurator to look in that file for a section called - log4net that contains the configuration data. - - - To use this method to configure log4net you must specify - the section - handler for the log4net configuration section. See the - for an example. + DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator. + Loads the log4net configuration from the XML element + supplied as . - + The element to parse. - + - Configures log4net using a log4net element + Configures the using the specified XML + element. + DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator. + Loads the log4net configuration from the XML element supplied as . - + The repository to configure. The element to parse. - + Configures log4net using the specified configuration file. The XML file to load the configuration from. + DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator. + + The configuration file must be valid XML. It must contain at least one element called log4net that holds the log4net configuration data. @@ -9800,17 +8898,6 @@ configuration file (either MyAppName.exe.config for a normal application on Web.config for an ASP.NET application). - - The first element matching <configuration> will be read as the - configuration. If this file is also a .NET .config file then you must specify - a configuration section for the log4net element otherwise .NET will - complain. Set the type for the section handler to , for example: - - -
- - - The following example configures log4net using a configuration file, of which the location is stored in the application's configuration file : @@ -9822,42 +8909,29 @@ ... - XmlConfigurator.Configure(new FileInfo(ConfigurationSettings.AppSettings["log4net-config-file"])); + DOMConfigurator.Configure(new FileInfo(ConfigurationSettings.AppSettings["log4net-config-file"])); In the .config file, the path to the log4net can be specified like this : - - - - + + + + - + - Configures log4net using the specified configuration URI. + Configures log4net using the specified configuration file. - A URI to load the XML configuration from. + A stream to load the XML configuration from. - The configuration data must be valid XML. It must contain - at least one element called log4net that holds - the log4net configuration data. - - - The must support the URI scheme specified. + DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator. - - - - - Configures log4net using the specified configuration data stream. - - A stream to load the XML configuration from. - The configuration data must be valid XML. It must contain at least one element called log4net that holds @@ -9868,19 +8942,7 @@ - - - Configures the using the specified XML - element. - - - Loads the log4net configuration from the XML element - supplied as . - - The repository to configure. - The element to parse. - - + Configures the using the specified configuration file. @@ -9889,6 +8951,9 @@ The XML file to load the configuration from. + DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator. + + The configuration file must be valid XML. It must contain at least one element called log4net that holds the configuration data. @@ -9898,17 +8963,6 @@ configuration file (either MyAppName.exe.config for a normal application on Web.config for an ASP.NET application). - - The first element matching <configuration> will be read as the - configuration. If this file is also a .NET .config file then you must specify - a configuration section for the log4net element otherwise .NET will - complain. Set the type for the section handler to , for example: - - -
- - - The following example configures log4net using a configuration file, of which the location is stored in the application's configuration file : @@ -9920,57 +8974,42 @@ ... - XmlConfigurator.Configure(new FileInfo(ConfigurationSettings.AppSettings["log4net-config-file"])); + DOMConfigurator.Configure(new FileInfo(ConfigurationSettings.AppSettings["log4net-config-file"])); In the .config file, the path to the log4net can be specified like this : - - - - + + + + - + Configures the using the specified configuration - URI. + file. The repository to configure. - A URI to load the XML configuration from. + The stream to load the XML configuration from. + DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator. + + The configuration data must be valid XML. It must contain at least one element called log4net that holds the configuration data. - The must support the URI scheme specified. + Note that this method will NOT close the stream parameter. - - - Configures the using the specified configuration - file. - - The repository to configure. - The stream to load the XML configuration from. - - - The configuration data must be valid XML. It must contain - at least one element called log4net that holds - the configuration data. - - - Note that this method will NOT close the stream parameter. - - - - + Configures log4net using the file specified, monitors the file for changes and reloads the configuration if a change is detected. @@ -9978,6 +9017,9 @@ The XML file to load the configuration from. + DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator. + + The configuration file must be valid XML. It must contain at least one element called log4net that holds the configuration data. @@ -9993,7 +9035,7 @@ - + Configures the using the file specified, monitors the file for changes and reloads the configuration if a change @@ -10003,6 +9045,9 @@ The XML file to load the configuration from. + DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator. + + The configuration file must be valid XML. It must contain at least one element called log4net that holds the configuration data. @@ -10018,5368 +9063,4929 @@ - + - Configures the specified repository using a log4net element. + Assembly level attribute to configure the . - The hierarchy to configure. - The element to parse. - Loads the log4net configuration from the XML element - supplied as . + AliasDomainAttribute is obsolete. Use AliasRepositoryAttribute instead of AliasDomainAttribute. - This method is ultimately called by one of the Configure methods - to load the configuration from an . + This attribute may only be used at the assembly scope and can only + be used once per assembly. + + + Use this attribute to configure the + without calling one of the + methods. + Nicko Cadell + Gert Driesen - - - Maps repository names to ConfigAndWatchHandler instances to allow a particular - ConfigAndWatchHandler to dispose of its FileSystemWatcher when a repository is - reconfigured. - - - + - The fully qualified type of the XmlConfigurator class. + Class to register for the log4net section of the configuration file - Used by the internal logger to record the Type of the - log message. + The log4net section of the configuration file needs to have a section + handler registered. This is the section handler used. It simply returns + the XML element that is the root of the section. + + Example of registering the log4net section handler : + + + +
+ + + log4net configuration XML goes here + + + + + Nicko Cadell + Gert Driesen - + - Class used to watch config files. + Initializes a new instance of the class. - Uses the to monitor - changes to a specified file. Because multiple change notifications - may be raised when the file is modified, a timer is used to - compress the notifications into a single event. The timer - waits for time before delivering - the event notification. If any further - change notifications arrive while the timer is waiting it - is reset and waits again for to - elapse. + Default constructor. - - - The default amount of time to wait after receiving notification - before reloading the config file. - - - - - Holds the FileInfo used to configure the XmlConfigurator - - - + - Holds the repository being configured. + Parses the configuration section. + The configuration settings in a corresponding parent configuration section. + The configuration context when called from the ASP.NET configuration system. Otherwise, this parameter is reserved and is a null reference. + The for the log4net section. + The for the log4net section. + + + Returns the containing the configuration data, + + - + - The timer used to compress the notification events. + Assembly level attribute that specifies a plugin to attach to + the repository. + + + Specifies the type of a plugin to create and attach to the + assembly's repository. The plugin type must implement the + interface. + + + Nicko Cadell + Gert Driesen - + - Watches file for changes. This object should be disposed when no longer - needed to free system handles on the watched resources. + Initializes a new instance of the class + with the specified type. + The type name of plugin to create. + + + Create the attribute with the plugin type specified. + + + Where possible use the constructor that takes a . + + - + - Initializes a new instance of the class to - watch a specified config file used to configure a repository. + Initializes a new instance of the class + with the specified type. - The repository to configure. - The configuration file to watch. + The type of plugin to create. - Initializes a new instance of the class. + Create the attribute with the plugin type specified. - + - Event handler used by . + Gets or sets the type for the plugin. - The firing the event. - The argument indicates the file that caused the event to be fired. + + The type for the plugin. + - This handler reloads the configuration from the file when the event is fired. + The type for the plugin. - + - Event handler used by . + Gets or sets the type name for the plugin. - The firing the event. - The argument indicates the file that caused the event to be fired. + + The type name for the plugin. + - This handler reloads the configuration from the file when the event is fired. + The type name for the plugin. + + + Where possible use the property instead. - + - Called by the timer when the configuration has been updated. + Creates the plugin object defined by this attribute. - null + + + Creates the instance of the object as + specified by this attribute. + + + The plugin object. - + - Release the handles held by the watcher and timer. + Returns a representation of the properties of this object. + + + Overrides base class method to + return a representation of the properties of this object. + + + A representation of the properties of this object - + - The implementation of the interface suitable - for use with the compact framework + Assembly level attribute that specifies the logging repository for the assembly. - This implementation is a simple - mapping between repository name and - object. + Assemblies are mapped to logging repository. This attribute specified + on the assembly controls + the configuration of the repository. The property specifies the name + of the repository that this assembly is a part of. The + specifies the type of the object + to create for the assembly. If this attribute is not specified or a + is not specified then the assembly will be part of the default shared logging repository. - The .NET Compact Framework 1.0 does not support retrieving assembly - level attributes therefore unlike the DefaultRepositorySelector - this selector does not examine the calling assembly for attributes. + This attribute can only be specified on the assembly and may only be used + once per assembly. Nicko Cadell + Gert Driesen - + - Interface used by the to select the . + Initializes a new instance of the class. - The uses a - to specify the policy for selecting the correct - to return to the caller. + Default constructor. - Nicko Cadell - Gert Driesen - + - Gets the for the specified assembly. + Initialize a new instance of the class + with the name of the repository. - The assembly to use to lookup to the - The for the assembly. + The name of the repository. - Gets the for the specified assembly. - - - How the association between and - is made is not defined. The implementation may choose any method for - this association. The results of this method must be repeatable, i.e. - when called again with the same arguments the result must be the - save value. + Initialize the attribute with the name for the assembly's repository. - + - Gets the named . + Gets or sets the name of the logging repository. - The name to use to lookup to the . - The named + + The string name to use as the name of the repository associated with this + assembly. + - Lookup a named . This is the repository created by - calling . + + This value does not have to be unique. Several assemblies can share the + same repository. They will share the logging configuration of the repository. + - + - Creates a new repository for the assembly specified. + Gets or sets the type of repository to create for this assembly. - The assembly to use to create the domain to associate with the . - The type of repository to create, must implement . - The repository created. + + The type of repository to create for this assembly. + - The created will be associated with the domain - specified such that a call to with the - same assembly specified will return the same repository instance. + The type of the repository to create for the assembly. + The type must implement the + interface. - How the association between and - is made is not defined. The implementation may choose any method for - this association. + This will be the type of repository created when + the repository is created. If multiple assemblies reference the + same repository then the repository is only created once using the + of the first assembly to call into the + repository. - + - Creates a new repository with the name specified. + Assembly level attribute to configure the . - The name to associate with the . - The type of repository to create, must implement . - The repository created. - The created will be associated with the name - specified such that a call to with the - same name will return the same repository instance. + This attribute may only be used at the assembly scope and can only + be used once per assembly. + + + Use this attribute to configure the + without calling one of the + methods. + Nicko Cadell - + - Test if a named repository exists + Construct provider attribute with type specified - the named repository to check - true if the repository exists + the type of the provider to use - Test if a named repository exists. Use - to create a new repository and to retrieve - a repository. + The provider specified must subclass the + class. - + - Gets an array of all currently defined repositories. + Gets or sets the type of the provider to use. - - An array of the instances created by - this . + + the type of the provider to use. + - Gets an array of all of the repositories created by this selector. + The provider specified must subclass the + class. - + - Event to notify that a logger repository has been created. + Configures the SecurityContextProvider - - Event to notify that a logger repository has been created. - + The assembly that this attribute was defined on. + The repository to configure. - Event raised when a new repository is created. - The event source will be this selector. The event args will - be a which - holds the newly created . + Creates a provider instance from the specified. + Sets this as the default security context provider . - + - Create a new repository selector + The fully qualified type of the SecurityContextProviderAttribute class. - the type of the repositories to create, must implement - - Create an new compact repository selector. - The default type for repositories must be specified, - an appropriate value would be . - + Used by the internal logger to record the Type of the + log message. - throw if is null - throw if does not implement - + - Get the for the specified assembly + Use this class to initialize the log4net environment using an Xml tree. - not used - The default - The argument is not used. This selector does not create a - separate repository for each assembly. - - - As a named repository is not specified the default repository is - returned. The default repository is named log4net-default-repository. + Configures a using an Xml tree. + Nicko Cadell + Gert Driesen - + - Get the named + Private constructor + + + + + Automatically configures the using settings + stored in the application's configuration file. - the name of the repository to lookup - The named - Get the named . The default - repository is log4net-default-repository. Other repositories - must be created using the . - If the named repository does not exist an exception is thrown. + Each application has a configuration file. This has the + same name as the application with '.config' appended. + This file is XML and calling this function prompts the + configurator to look in that file for a section called + log4net that contains the configuration data. + + + To use this method to configure log4net you must specify + the section + handler for the log4net configuration section. See the + for an example. - throw if is null - throw if the does not exist + The repository to configure. - + - Create a new repository for the assembly specified + Automatically configures the log4net system based on the + application's configuration settings. - not used - the type of repository to create, must implement - the repository created - The argument is not used. This selector does not create a - separate repository for each assembly. + Each application has a configuration file. This has the + same name as the application with '.config' appended. + This file is XML and calling this function prompts the + configurator to look in that file for a section called + log4net that contains the configuration data. - If the is null then the - default repository type specified to the constructor is used. + To use this method to configure log4net you must specify + the section + handler for the log4net configuration section. See the + for an example. + + + + + + Configures log4net using a log4net element + + - As a named repository is not specified the default repository is - returned. The default repository is named log4net-default-repository. + Loads the log4net configuration from the XML element + supplied as . + The element to parse. - + - Create a new repository for the repository specified + Configures log4net using the specified configuration file. - the repository to associate with the - the type of repository to create, must implement . - If this param is null then the default repository type is used. - the repository created + The XML file to load the configuration from. - The created will be associated with the repository - specified such that a call to with the - same repository specified will return the same repository instance. + The configuration file must be valid XML. It must contain + at least one element called log4net that holds + the log4net configuration data. - If the named repository already exists an exception will be thrown. + The log4net configuration file can possible be specified in the application's + configuration file (either MyAppName.exe.config for a + normal application on Web.config for an ASP.NET application). - If is null then the default - repository type specified to the constructor is used. + The first element matching <configuration> will be read as the + configuration. If this file is also a .NET .config file then you must specify + a configuration section for the log4net element otherwise .NET will + complain. Set the type for the section handler to , for example: + + +
+ + + + + The following example configures log4net using a configuration file, of which the + location is stored in the application's configuration file : + + + using log4net.Config; + using System.IO; + using System.Configuration; + + ... + + XmlConfigurator.Configure(new FileInfo(ConfigurationSettings.AppSettings["log4net-config-file"])); + + + In the .config file, the path to the log4net can be specified like this : + + + + + + + - throw if is null - throw if the already exists - + - Test if a named repository exists + Configures log4net using the specified configuration URI. - the named repository to check - true if the repository exists + A URI to load the XML configuration from. - Test if a named repository exists. Use - to create a new repository and to retrieve - a repository. + The configuration data must be valid XML. It must contain + at least one element called log4net that holds + the log4net configuration data. + + + The must support the URI scheme specified. - + - Gets a list of objects + Configures log4net using the specified configuration data stream. - an array of all known objects + A stream to load the XML configuration from. - Gets an array of all of the repositories created by this selector. + The configuration data must be valid XML. It must contain + at least one element called log4net that holds + the log4net configuration data. + + + Note that this method will NOT close the stream parameter. - + - The fully qualified type of the CompactRepositorySelector class. + Configures the using the specified XML + element. - Used by the internal logger to record the Type of the - log message. + Loads the log4net configuration from the XML element + supplied as . + The repository to configure. + The element to parse. - + - Notify the registered listeners that the repository has been created + Configures the using the specified configuration + file. - The repository that has been created + The repository to configure. + The XML file to load the configuration from. - Raises the LoggerRepositoryCreatedEvent - event. + The configuration file must be valid XML. It must contain + at least one element called log4net that holds + the configuration data. - - - - - Event to notify that a logger repository has been created. - - - Event to notify that a logger repository has been created. - - - Event raised when a new repository is created. - The event source will be this selector. The event args will - be a which - holds the newly created . + The log4net configuration file can possible be specified in the application's + configuration file (either MyAppName.exe.config for a + normal application on Web.config for an ASP.NET application). - - - - - The default implementation of the interface. - - - Uses attributes defined on the calling assembly to determine how to - configure the hierarchy for the repository. + The first element matching <configuration> will be read as the + configuration. If this file is also a .NET .config file then you must specify + a configuration section for the log4net element otherwise .NET will + complain. Set the type for the section handler to , for example: + + +
+ + - - Nicko Cadell - Gert Driesen - - - - Creates a new repository selector. - - The type of the repositories to create, must implement - + + The following example configures log4net using a configuration file, of which the + location is stored in the application's configuration file : + + + using log4net.Config; + using System.IO; + using System.Configuration; + + ... + + XmlConfigurator.Configure(new FileInfo(ConfigurationSettings.AppSettings["log4net-config-file"])); + - Create an new repository selector. - The default type for repositories must be specified, - an appropriate value would be . + In the .config file, the path to the log4net can be specified like this : + + + + + + + - is . - does not implement . - + - Gets the for the specified assembly. + Configures the using the specified configuration + URI. - The assembly use to lookup the . + The repository to configure. + A URI to load the XML configuration from. - The type of the created and the repository - to create can be overridden by specifying the - attribute on the . - - - The default values are to use the - implementation of the interface and to use the - as the name of the repository. + The configuration data must be valid XML. It must contain + at least one element called log4net that holds + the configuration data. - The created will be automatically configured using - any attributes defined on - the . + The must support the URI scheme specified. - The for the assembly - is . - + - Gets the for the specified repository. + Configures the using the specified configuration + file. - The repository to use to lookup the . - The for the specified repository. + The repository to configure. + The stream to load the XML configuration from. - Returns the named repository. If is null - a is thrown. If the repository - does not exist a is thrown. + The configuration data must be valid XML. It must contain + at least one element called log4net that holds + the configuration data. - Use to create a repository. + Note that this method will NOT close the stream parameter. - is . - does not exist. - + - Create a new repository for the assembly specified + Configures log4net using the file specified, monitors the file for changes + and reloads the configuration if a change is detected. - the assembly to use to create the repository to associate with the . - The type of repository to create, must implement . - The repository created. + The XML file to load the configuration from. - The created will be associated with the repository - specified such that a call to with the - same assembly specified will return the same repository instance. - - - The type of the created and - the repository to create can be overridden by specifying the - attribute on the - . The default values are to use the - implementation of the - interface and to use the - as the name of the repository. + The configuration file must be valid XML. It must contain + at least one element called log4net that holds + the configuration data. - The created will be automatically - configured using any - attributes defined on the . + The configuration file will be monitored using a + and depends on the behavior of that class. - If a repository for the already exists - that repository will be returned. An error will not be raised and that - repository may be of a different type to that specified in . - Also the attribute on the - assembly may be used to override the repository type specified in - . + For more information on how to configure log4net using + a separate configuration file, see . - is . + - + - Creates a new repository for the assembly specified. + Configures the using the file specified, + monitors the file for changes and reloads the configuration if a change + is detected. - the assembly to use to create the repository to associate with the . - The type of repository to create, must implement . - The name to assign to the created repository - Set to true to read and apply the assembly attributes - The repository created. + The repository to configure. + The XML file to load the configuration from. - The created will be associated with the repository - specified such that a call to with the - same assembly specified will return the same repository instance. - - - The type of the created and - the repository to create can be overridden by specifying the - attribute on the - . The default values are to use the - implementation of the - interface and to use the - as the name of the repository. + The configuration file must be valid XML. It must contain + at least one element called log4net that holds + the configuration data. - The created will be automatically - configured using any - attributes defined on the . + The configuration file will be monitored using a + and depends on the behavior of that class. - If a repository for the already exists - that repository will be returned. An error will not be raised and that - repository may be of a different type to that specified in . - Also the attribute on the - assembly may be used to override the repository type specified in - . + For more information on how to configure log4net using + a separate configuration file, see . - is . + - + - Creates a new repository for the specified repository. + Class used to watch config files. - The repository to associate with the . - The type of repository to create, must implement . - If this param is then the default repository type is used. - The new repository. - The created will be associated with the repository - specified such that a call to with the - same repository specified will return the same repository instance. + Uses the to monitor + changes to a specified file. Because multiple change notifications + may be raised when the file is modified, a timer is used to + compress the notifications into a single event. The timer + waits for time before delivering + the event notification. If any further + change notifications arrive while the timer is waiting it + is reset and waits again for to + elapse. - is . - already exists. - + - Test if a named repository exists + Holds the FileInfo used to configure the XmlConfigurator - the named repository to check - true if the repository exists - - - Test if a named repository exists. Use - to create a new repository and to retrieve - a repository. - - - + - Gets a list of objects + Holds the repository being configured. - an array of all known objects - - - Gets an array of all of the repositories created by this selector. - - - + - Aliases a repository to an existing repository. + The timer used to compress the notification events. - The repository to alias. - The repository that the repository is aliased to. - - - The repository specified will be aliased to the repository when created. - The repository must not already exist. - - - When the repository is created it must utilize the same repository type as - the repository it is aliased to, otherwise the aliasing will fail. - - - - is . - -or- - is . - - + - Notifies the registered listeners that the repository has been created. + The default amount of time to wait after receiving notification + before reloading the config file. - The repository that has been created. - - - Raises the event. - - - + - Gets the repository name and repository type for the specified assembly. + Watches file for changes. This object should be disposed when no longer + needed to free system handles on the watched resources. - The assembly that has a . - in/out param to hold the repository name to use for the assembly, caller should set this to the default value before calling. - in/out param to hold the type of the repository to create for the assembly, caller should set this to the default value before calling. - is . - + - Configures the repository using information from the assembly. + Initializes a new instance of the class to + watch a specified config file used to configure a repository. - The assembly containing - attributes which define the configuration for the repository. The repository to configure. - - is . - -or- - is . - - - - - Loads the attribute defined plugins on the assembly. - - The assembly that contains the attributes. - The repository to add the plugins to. - - is . - -or- - is . - - - - - Loads the attribute defined aliases on the assembly. - - The assembly that contains the attributes. - The repository to alias to. - - is . - -or- - is . - - - - - The fully qualified type of the DefaultRepositorySelector class. - + The configuration file to watch. - Used by the internal logger to record the Type of the - log message. + + Initializes a new instance of the class. + - + - Event to notify that a logger repository has been created. + Event handler used by . - - Event to notify that a logger repository has been created. - + The firing the event. + The argument indicates the file that caused the event to be fired. - Event raised when a new repository is created. - The event source will be this selector. The event args will - be a which - holds the newly created . + This handler reloads the configuration from the file when the event is fired. - + - Defined error codes that can be passed to the method. + Event handler used by . + The firing the event. + The argument indicates the file that caused the event to be fired. - Values passed to the method. + This handler reloads the configuration from the file when the event is fired. - Nicko Cadell - - - - A general error - - + - Error while writing output + Called by the timer when the configuration has been updated. + null - + - Failed to flush file + Release the handles held by the watcher and timer. - + - Failed to close file + Configures the specified repository using a log4net element. + The hierarchy to configure. + The element to parse. + + + Loads the log4net configuration from the XML element + supplied as . + + + This method is ultimately called by one of the Configure methods + to load the configuration from an . + + - + - Unable to open output file + Maps repository names to ConfigAndWatchHandler instances to allow a particular + ConfigAndWatchHandler to dispose of its FileSystemWatcher when a repository is + reconfigured. - + - No layout specified + The fully qualified type of the XmlConfigurator class. + + Used by the internal logger to record the Type of the + log message. + - + - Failed to parse address + Assembly level attribute to configure the . + + + This attribute may only be used at the assembly scope and can only + be used once per assembly. + + + Use this attribute to configure the + without calling one of the + methods. + + + If neither of the or + properties are set the configuration is loaded from the application's .config file. + If set the property takes priority over the + property. The property + specifies a path to a file to load the config from. The path is relative to the + application's base directory; . + The property is used as a postfix to the assembly file name. + The config file must be located in the application's base directory; . + For example in a console application setting the to + config has the same effect as not specifying the or + properties. + + + The property can be set to cause the + to watch the configuration file for changes. + + + + Log4net will only look for assembly level configuration attributes once. + When using the log4net assembly level attributes to control the configuration + of log4net you must ensure that the first call to any of the + methods is made from the assembly with the configuration + attributes. + + + If you cannot guarantee the order in which log4net calls will be made from + different assemblies you must use programmatic configuration instead, i.e. + call the method directly. + + + + Nicko Cadell + Gert Driesen - + - An evaluator that triggers on an Exception type + Default constructor - This evaluator will trigger if the type of the Exception - passed to - is equal to a Type in . /// + Default constructor - Drew Schaeffer - + - Test if an triggers an action + Gets or sets the filename of the configuration file. + + The filename of the configuration file. + - Implementations of this interface allow certain appenders to decide - when to perform an appender specific action. + If specified, this is the name of the configuration file to use with + the . This file path is relative to the + application base directory (). - The action or behavior triggered is defined by the implementation. + The takes priority over the . - Nicko Cadell - + - Test if this event triggers the action + Gets or sets the extension of the configuration file. - The event to check - true if this event triggers the action, otherwise false + + The extension of the configuration file. + - Return true if this event triggers the action + If specified this is the extension for the configuration file. + The path to the config file is built by using the application + base directory (), + the assembly file name and the config file extension. + + + If the is set to MyExt then + possible config file names would be: MyConsoleApp.exe.MyExt or + MyClassLibrary.dll.MyExt. + + + The takes priority over the . - + - The type that causes the trigger to fire. + Gets or sets a value indicating whether to watch the configuration file. + + true if the configuration should be watched, false otherwise. + + + + If this flag is specified and set to true then the framework + will watch the configuration file and will reload the config each time + the file is modified. + + + The config file can only be watched if it is loaded from local disk. + In a No-Touch (Smart Client) deployment where the application is downloaded + from a web server the config file may not reside on the local disk + and therefore it may not be able to watch it. + + + Watching configuration is not supported on the SSCLI. + + - + - Causes subclasses of to cause the trigger to fire. - - - - - Default ctor to allow dynamic creation through a configurator. + Configures the for the specified assembly. + The assembly that this attribute was defined on. + The repository to configure. + + + Configure the repository using the . + The specified must extend the + class otherwise the will not be able to + configure it. + + + The does not extend . - + - Constructs an evaluator and initializes to trigger on + Attempt to load configuration from the local file system - the type that triggers this evaluator. - If true, this evaluator will trigger on subclasses of . + The assembly that this attribute was defined on. + The repository to configure. - + - Is this the triggering event? + Configure the specified repository using a - The event to check - This method returns true, if the logging event Exception - Type is . - Otherwise it returns false - - - This evaluator will trigger if the Exception Type of the event - passed to - is . - - + The repository to configure. + the FileInfo pointing to the config file - + - The type that triggers this evaluator. + Attempt to load configuration from a URI + The assembly that this attribute was defined on. + The repository to configure. - + - If true, this evaluator will trigger on subclasses of . + The fully qualified type of the XmlConfiguratorAttribute class. + + Used by the internal logger to record the Type of the + log message. + - + - Appenders may delegate their error handling to an . + The implementation of the interface suitable + for use with the compact framework - Error handling is a particularly tedious to get right because by - definition errors are hard to predict and to reproduce. + This implementation is a simple + mapping between repository name and + object. + + + The .NET Compact Framework 1.0 does not support retrieving assembly + level attributes therefore unlike the DefaultRepositorySelector + this selector does not examine the calling assembly for attributes. Nicko Cadell - Gert Driesen - + - Handles the error and information about the error condition is passed as - a parameter. + Create a new repository selector - The message associated with the error. - The that was thrown when the error occurred. - The error code associated with the error. + the type of the repositories to create, must implement - Handles the error and information about the error condition is passed as - a parameter. + Create an new compact repository selector. + The default type for repositories must be specified, + an appropriate value would be . + throw if is null + throw if does not implement - + - Prints the error message passed as a parameter. + Get the for the specified assembly - The message associated with the error. - The that was thrown when the error occurred. + not used + The default - See . + The argument is not used. This selector does not create a + separate repository for each assembly. + + + As a named repository is not specified the default repository is + returned. The default repository is named log4net-default-repository. - + - Prints the error message passed as a parameter. + Get the named - The message associated with the error. + the name of the repository to lookup + The named - See . + Get the named . The default + repository is log4net-default-repository. Other repositories + must be created using the . + If the named repository does not exist an exception is thrown. + throw if is null + throw if the does not exist - + - Interface for objects that require fixing. + Create a new repository for the assembly specified + not used + the type of repository to create, must implement + the repository created - Interface that indicates that the object requires fixing before it - can be taken outside the context of the appender's - method. + The argument is not used. This selector does not create a + separate repository for each assembly. - When objects that implement this interface are stored - in the context properties maps - and - are fixed - (see ) the - method will be called. + If the is null then the + default repository type specified to the constructor is used. - - Nicko Cadell - - - - Get a portable version of this object - - the portable instance of this object - - Get a portable instance object that represents the current - state of this object. The portable object can be stored - and logged from any thread with identical results. + As a named repository is not specified the default repository is + returned. The default repository is named log4net-default-repository. - + - Interface that all loggers implement + Create a new repository for the repository specified + the repository to associate with the + the type of repository to create, must implement . + If this param is null then the default repository type is used. + the repository created - This interface supports logging events and testing if a level - is enabled for logging. + The created will be associated with the repository + specified such that a call to with the + same repository specified will return the same repository instance. - These methods will not throw exceptions. Note to implementor, ensure - that the implementation of these methods cannot allow an exception - to be thrown to the caller. + If the named repository already exists an exception will be thrown. + + + If is null then the default + repository type specified to the constructor is used. - Nicko Cadell - Gert Driesen + throw if is null + throw if the already exists - + - This generic form is intended to be used by wrappers. + Test if a named repository exists - The declaring type of the method that is - the stack boundary into the logging system for this call. - The level of the message to be logged. - The message object to log. - the exception to log, including its stack trace. Pass null to not log an exception. + the named repository to check + true if the repository exists - Generates a logging event for the specified using - the and . + Test if a named repository exists. Use + to create a new repository and to retrieve + a repository. - + - This is the most generic printing method that is intended to be used - by wrappers. + Gets a list of objects - The event being logged. + an array of all known objects - Logs the specified logging event through this logger. + Gets an array of all of the repositories created by this selector. - + - Checks if this logger is enabled for a given passed as parameter. + The fully qualified type of the CompactRepositorySelector class. - The level to check. - - true if this logger is enabled for level, otherwise false. - - - Test if this logger is going to log events of the specified . - + Used by the internal logger to record the Type of the + log message. - + - Gets the name of the logger. + Event to notify that a logger repository has been created. - The name of the logger. + Event to notify that a logger repository has been created. - The name of this logger + Event raised when a new repository is created. + The event source will be this selector. The event args will + be a which + holds the newly created . - + - Gets the where this - Logger instance is attached to. + Notify the registered listeners that the repository has been created - - The that this logger belongs to. - + The repository that has been created - Gets the where this - Logger instance is attached to. + Raises the LoggerRepositoryCreatedEvent + event. - + - Base interface for all wrappers + The default implementation of the interface. - Base interface for all wrappers. - - - All wrappers must implement this interface. + Uses attributes defined on the calling assembly to determine how to + configure the hierarchy for the repository. Nicko Cadell + Gert Driesen - + - Get the implementation behind this wrapper object. + Event to notify that a logger repository has been created. - The object that in implementing this object. + Event to notify that a logger repository has been created. - The object that in implementing this - object. The Logger object may not - be the same object as this object because of logger decorators. - This gets the actual underlying objects that is used to process - the log events. - - - - - - Delegate used to handle logger repository creation event notifications - - The which created the repository. - The event args - that holds the instance that has been created. - - - Delegate used to handle logger repository creation event notifications. + Event raised when a new repository is created. + The event source will be this selector. The event args will + be a which + holds the newly created . - + - Provides data for the event. + Creates a new repository selector. + The type of the repositories to create, must implement - A - event is raised every time a is created. + Create an new repository selector. + The default type for repositories must be specified, + an appropriate value would be . + is . + does not implement . - - - The created - - - + - Construct instance using specified + Gets the for the specified assembly. - the that has been created + The assembly use to lookup the . - Construct instance using specified + The type of the created and the repository + to create can be overridden by specifying the + attribute on the . + + + The default values are to use the + implementation of the interface and to use the + as the name of the repository. + + + The created will be automatically configured using + any attributes defined on + the . + The for the assembly + is . - + - The that has been created + Gets the for the specified repository. - - The that has been created - + The repository to use to lookup the . + The for the specified repository. - The that has been created + Returns the named repository. If is null + a is thrown. If the repository + does not exist a is thrown. + + + Use to create a repository. + is . + does not exist. - + - Defines the default set of levels recognized by the system. + Create a new repository for the assembly specified + the assembly to use to create the repository to associate with the . + The type of repository to create, must implement . + The repository created. - Each has an associated . - - - Levels have a numeric that defines the relative - ordering between levels. Two Levels with the same - are deemed to be equivalent. - - - The levels that are recognized by log4net are set for each - and each repository can have different levels defined. The levels are stored - in the on the repository. Levels are - looked up by name from the . + The created will be associated with the repository + specified such that a call to with the + same assembly specified will return the same repository instance. - When logging at level INFO the actual level used is not but - the value of LoggerRepository.LevelMap["INFO"]. The default value for this is - , but this can be changed by reconfiguring the level map. + The type of the created and + the repository to create can be overridden by specifying the + attribute on the + . The default values are to use the + implementation of the + interface and to use the + as the name of the repository. - Each level has a in addition to its . The - is the string that is written into the output log. By default - the display name is the same as the level name, but this can be used to alias levels - or to localize the log output. + The created will be automatically + configured using any + attributes defined on the . - Some of the predefined levels recognized by the system are: + If a repository for the already exists + that repository will be returned. An error will not be raised and that + repository may be of a different type to that specified in . + Also the attribute on the + assembly may be used to override the repository type specified in + . - - - . - - - . - - - . - - - . - - - . - - - . - - - . - - - Nicko Cadell - Gert Driesen + is . - + - Constructor + Creates a new repository for the assembly specified. - Integer value for this level, higher values represent more severe levels. - The string name of this level. - The display name for this level. This may be localized or otherwise different from the name + the assembly to use to create the repository to associate with the . + The type of repository to create, must implement . + The name to assign to the created repository + Set to true to read and apply the assembly attributes + The repository created. - Initializes a new instance of the class with - the specified level name and value. + The created will be associated with the repository + specified such that a call to with the + same assembly specified will return the same repository instance. - - - - - Constructor - - Integer value for this level, higher values represent more severe levels. - The string name of this level. - - Initializes a new instance of the class with - the specified level name and value. + The type of the created and + the repository to create can be overridden by specifying the + attribute on the + . The default values are to use the + implementation of the + interface and to use the + as the name of the repository. - - - - - Returns the representation of the current - . - - - A representation of the current . - - - Returns the level . + The created will be automatically + configured using any + attributes defined on the . - - - - - Compares levels. - - The object to compare against. - true if the objects are equal. - - Compares the levels of instances, and - defers to base class if the target object is not a - instance. + If a repository for the already exists + that repository will be returned. An error will not be raised and that + repository may be of a different type to that specified in . + Also the attribute on the + assembly may be used to override the repository type specified in + . + is . - + - Returns a hash code + Creates a new repository for the specified repository. - A hash code for the current . + The repository to associate with the . + The type of repository to create, must implement . + If this param is then the default repository type is used. + The new repository. - Returns a hash code suitable for use in hashing algorithms and data - structures like a hash table. - - - Returns the hash code of the level . + The created will be associated with the repository + specified such that a call to with the + same repository specified will return the same repository instance. + is . + already exists. - + - Compares this instance to a specified object and returns an - indication of their relative values. + Test if a named repository exists - A instance or to compare with this instance. - - A 32-bit signed integer that indicates the relative order of the - values compared. The return value has these meanings: - - - Value - Meaning - - - Less than zero - This instance is less than . - - - Zero - This instance is equal to . - - - Greater than zero - - This instance is greater than . - -or- - is . - - - - + the named repository to check + true if the repository exists - must be an instance of - or ; otherwise, an exception is thrown. + Test if a named repository exists. Use + to create a new repository and to retrieve + a repository. - is not a . - + - Returns a value indicating whether a specified - is greater than another specified . + Gets a list of objects - A - A - - true if is greater than - ; otherwise, false. - + an array of all known objects - Compares two levels. + Gets an array of all of the repositories created by this selector. - + - Returns a value indicating whether a specified - is less than another specified . + Aliases a repository to an existing repository. - A - A - - true if is less than - ; otherwise, false. - + The repository to alias. + The repository that the repository is aliased to. - Compares two levels. + The repository specified will be aliased to the repository when created. + The repository must not already exist. - - - - - Returns a value indicating whether a specified - is greater than or equal to another specified . - - A - A - - true if is greater than or equal to - ; otherwise, false. - - - Compares two levels. + When the repository is created it must utilize the same repository type as + the repository it is aliased to, otherwise the aliasing will fail. + + is . + -or- + is . + - + - Returns a value indicating whether a specified - is less than or equal to another specified . + Notifies the registered listeners that the repository has been created. - A - A - - true if is less than or equal to - ; otherwise, false. - + The repository that has been created. - Compares two levels. + Raises the event. - + - Returns a value indicating whether two specified - objects have the same value. + Gets the repository name and repository type for the specified assembly. - A or . - A or . - - true if the value of is the same as the - value of ; otherwise, false. - - - - Compares two levels. - - - - - - Returns a value indicating whether two specified - objects have different values. - - A or . - A or . - - true if the value of is different from - the value of ; otherwise, false. - - - - Compares two levels. - - + The assembly that has a . + in/out param to hold the repository name to use for the assembly, caller should set this to the default value before calling. + in/out param to hold the type of the repository to create for the assembly, caller should set this to the default value before calling. + is . - + - Compares two specified instances. + Configures the repository using information from the assembly. - The first to compare. - The second to compare. - - A 32-bit signed integer that indicates the relative order of the - two values compared. The return value has these meanings: - - - Value - Meaning - - - Less than zero - is less than . - - - Zero - is equal to . - - - Greater than zero - is greater than . - - - - - - Compares two levels. - - + The assembly containing + attributes which define the configuration for the repository. + The repository to configure. + + is . + -or- + is . + - + - The level designates a higher level than all the rest. + Loads the attribute defined plugins on the assembly. + The assembly that contains the attributes. + The repository to add the plugins to. + + is . + -or- + is . + - + - The level designates very severe error events. - System unusable, emergencies. + Loads the attribute defined aliases on the assembly. + The assembly that contains the attributes. + The repository to alias to. + + is . + -or- + is . + - + - The level designates very severe error events. - System unusable, emergencies. + The fully qualified type of the DefaultRepositorySelector class. + + Used by the internal logger to record the Type of the + log message. + - + - The level designates very severe error events - that will presumably lead the application to abort. + Defined error codes that can be passed to the method. + + + Values passed to the method. + + + Nicko Cadell - + - The level designates very severe error events. - Take immediate action, alerts. + A general error - + - The level designates very severe error events. - Critical condition, critical. + Error while writing output - + - The level designates very severe error events. + Failed to flush file - + - The level designates error events that might - still allow the application to continue running. + Failed to close file - + - The level designates potentially harmful - situations. + Unable to open output file - + - The level designates informational messages - that highlight the progress of the application at the highest level. + No layout specified - + - The level designates informational messages that - highlight the progress of the application at coarse-grained level. + Failed to parse address - + - The level designates fine-grained informational - events that are most useful to debug an application. + An evaluator that triggers on an Exception type + + + This evaluator will trigger if the type of the Exception + passed to + is equal to a Type in . /// + + + Drew Schaeffer - + - The level designates fine-grained informational - events that are most useful to debug an application. + The type that causes the trigger to fire. - + - The level designates fine-grained informational - events that are most useful to debug an application. + Causes subclasses of to cause the trigger to fire. - + - The level designates fine-grained informational - events that are most useful to debug an application. + Default ctor to allow dynamic creation through a configurator. - + - The level designates fine-grained informational - events that are most useful to debug an application. + Constructs an evaluator and initializes to trigger on + the type that triggers this evaluator. + If true, this evaluator will trigger on subclasses of . - + - The level designates fine-grained informational - events that are most useful to debug an application. + The type that triggers this evaluator. - + - The level designates the lowest level possible. + If true, this evaluator will trigger on subclasses of . - + - Gets the name of this level. + Is this the triggering event? - - The name of this level. - + The event to check + This method returns true, if the logging event Exception + Type is . + Otherwise it returns false - Gets the name of this level. + This evaluator will trigger if the Exception Type of the event + passed to + is . - + - Gets the value of this level. + Flags passed to the property - - The value of this level. - - Gets the value of this level. + Flags passed to the property + Nicko Cadell - + - Gets the display name of this level. + Fix the MDC - - The display name of this level. - - - - Gets the display name of this level. - - - + - A strongly-typed collection of objects. + Fix the NDC - Nicko Cadell - + - Creates a read-only wrapper for a LevelCollection instance. + Fix the rendered message - list to create a readonly wrapper arround - - A LevelCollection wrapper that is read-only. - - + - Initializes a new instance of the LevelCollection class - that is empty and has the default initial capacity. + Fix the thread name - + - Initializes a new instance of the LevelCollection class - that has the specified initial capacity. + Fix the callers location information - - The number of elements that the new LevelCollection is initially capable of storing. - + + CAUTION: Very slow to generate + - + - Initializes a new instance of the LevelCollection class - that contains elements copied from the specified LevelCollection. + Fix the callers windows user name - The LevelCollection whose elements are copied to the new collection. + + CAUTION: Slow to generate + - + - Initializes a new instance of the LevelCollection class - that contains elements copied from the specified array. + Fix the domain friendly name - The array whose elements are copied to the new list. - + - Initializes a new instance of the LevelCollection class - that contains elements copied from the specified collection. + Fix the callers principal name - The collection whose elements are copied to the new list. + + CAUTION: May be slow to generate + - + - Allow subclasses to avoid our default constructors + Fix the exception text - - + - Copies the entire LevelCollection to a one-dimensional - array. + Fix the event properties. Active properties must implement in order to be eligible for fixing. - The one-dimensional array to copy to. - + - Copies the entire LevelCollection to a one-dimensional - array, starting at the specified index of the target array. + No fields fixed - The one-dimensional array to copy to. - The zero-based index in at which copying begins. - + - Adds a to the end of the LevelCollection. + All fields fixed - The to be added to the end of the LevelCollection. - The index at which the value has been added. - + - Removes all elements from the LevelCollection. + Partial fields fixed + + + This set of partial fields gives good performance. The following fields are fixed: + + + + + + + + + - + - Creates a shallow copy of the . + Interface for attaching appenders to objects. - A new with a shallow copy of the collection data. + + + Interface for attaching, removing and retrieving appenders. + + + Nicko Cadell + Gert Driesen - + - Determines whether a given is in the LevelCollection. + Attaches an appender. - The to check for. - true if is found in the LevelCollection; otherwise, false. + The appender to add. + + + Add the specified appender. The implementation may + choose to allow or deny duplicate appenders. + + - + - Returns the zero-based index of the first occurrence of a - in the LevelCollection. + Gets all attached appenders. - The to locate in the LevelCollection. + + A collection of attached appenders. + + + + Gets a collection of attached appenders. + If there are no attached appenders the + implementation should return an empty + collection rather than null. + + + + + + Gets an attached appender with the specified name. + + The name of the appender to get. - The zero-based index of the first occurrence of - in the entire LevelCollection, if found; otherwise, -1. + The appender with the name specified, or null if no appender with the + specified name is found. + + + Returns an attached appender with the specified. + If no appender with the specified name is found null will be + returned. + + - + - Inserts an element into the LevelCollection at the specified index. + Removes all attached appenders. - The zero-based index at which should be inserted. - The to insert. - - is less than zero - -or- - is equal to or greater than . - + + + Removes and closes all attached appenders + + - + - Removes the first occurrence of a specific from the LevelCollection. + Removes the specified appender from the list of attached appenders. - The to remove from the LevelCollection. - - The specified was not found in the LevelCollection. - + The appender to remove. + The appender removed from the list + + + The appender removed is not closed. + If you are discarding the appender you must call + on the appender removed. + + - + - Removes the element at the specified index of the LevelCollection. + Removes the appender with the specified name from the list of appenders. - The zero-based index of the element to remove. - - is less than zero - -or- - is equal to or greater than . - + The name of the appender to remove. + The appender removed from the list + + + The appender removed is not closed. + If you are discarding the appender you must call + on the appender removed. + + - + - Returns an enumerator that can iterate through the LevelCollection. + Appenders may delegate their error handling to an . - An for the entire LevelCollection. + + + Error handling is a particularly tedious to get right because by + definition errors are hard to predict and to reproduce. + + + Nicko Cadell + Gert Driesen - + - Adds the elements of another LevelCollection to the current LevelCollection. + Handles the error and information about the error condition is passed as + a parameter. - The LevelCollection whose elements should be added to the end of the current LevelCollection. - The new of the LevelCollection. + The message associated with the error. + The that was thrown when the error occurred. + The error code associated with the error. + + + Handles the error and information about the error condition is passed as + a parameter. + + - + - Adds the elements of a array to the current LevelCollection. + Prints the error message passed as a parameter. - The array whose elements should be added to the end of the LevelCollection. - The new of the LevelCollection. + The message associated with the error. + The that was thrown when the error occurred. + + + See . + + - + - Adds the elements of a collection to the current LevelCollection. + Prints the error message passed as a parameter. - The collection whose elements should be added to the end of the LevelCollection. - The new of the LevelCollection. + The message associated with the error. + + + See . + + - + - Sets the capacity to the actual number of elements. + Interface for objects that require fixing. + + + Interface that indicates that the object requires fixing before it + can be taken outside the context of the appender's + method. + + + When objects that implement this interface are stored + in the context properties maps + and + are fixed + (see ) the + method will be called. + + + Nicko Cadell - - - is less than zero - -or- - is equal to or greater than . - - - - - is less than zero - -or- - is equal to or greater than . - - - + - Gets the number of elements actually contained in the LevelCollection. + Get a portable version of this object + the portable instance of this object + + + Get a portable instance object that represents the current + state of this object. The portable object can be stored + and logged from any thread with identical results. + + - + - Gets a value indicating whether access to the collection is synchronized (thread-safe). + Interface that all loggers implement - false, because the backing type is an array, which is never thread-safe. + + + This interface supports logging events and testing if a level + is enabled for logging. + + + These methods will not throw exceptions. Note to implementor, ensure + that the implementation of these methods cannot allow an exception + to be thrown to the caller. + + + Nicko Cadell + Gert Driesen - + - Gets an object that can be used to synchronize access to the collection. + Gets the name of the logger. + + The name of the logger. + + + + The name of this logger + + - + - Gets or sets the at the specified index. - - The zero-based index of the element to get or set. - - is less than zero - -or- - is equal to or greater than . - - - - - Gets a value indicating whether the collection has a fixed size. - - true if the collection has a fixed size; otherwise, false. The default is false - - - - Gets a value indicating whether the IList is read-only. - - true if the collection is read-only; otherwise, false. The default is false - - - - Gets or sets the number of elements the LevelCollection can contain. - - - - - Supports type-safe iteration over a . - - - - - Advances the enumerator to the next element in the collection. - - - true if the enumerator was successfully advanced to the next element; - false if the enumerator has passed the end of the collection. - - - The collection was modified after the enumerator was created. - - - - - Sets the enumerator to its initial position, before the first element in the collection. - - - - - Gets the current element in the collection. - - - - - Type visible only to our subclasses - Used to access protected constructor - - - - - A value - - - - - Supports simple iteration over a . + This generic form is intended to be used by wrappers. + The declaring type of the method that is + the stack boundary into the logging system for this call. + The level of the message to be logged. + The message object to log. + the exception to log, including its stack trace. Pass null to not log an exception. + + + Generates a logging event for the specified using + the and . + + - + - Initializes a new instance of the Enumerator class. + This is the most generic printing method that is intended to be used + by wrappers. - + The event being logged. + + + Logs the specified logging event through this logger. + + - + - Advances the enumerator to the next element in the collection. + Checks if this logger is enabled for a given passed as parameter. + The level to check. - true if the enumerator was successfully advanced to the next element; - false if the enumerator has passed the end of the collection. + true if this logger is enabled for level, otherwise false. - - The collection was modified after the enumerator was created. - - - - - Sets the enumerator to its initial position, before the first element in the collection. - + + + Test if this logger is going to log events of the specified . + + - + - Gets the current element in the collection. + Gets the where this + Logger instance is attached to. + + The that this logger belongs to. + + + + Gets the where this + Logger instance is attached to. + + - + - An evaluator that triggers at a threshold level + Base interface for all wrappers - This evaluator will trigger if the level of the event - passed to - is equal to or greater than the - level. + Base interface for all wrappers. + + + All wrappers must implement this interface. Nicko Cadell - - - The threshold for triggering - - - + - Create a new evaluator using the threshold. + Get the implementation behind this wrapper object. + + The object that in implementing this object. + - Create a new evaluator using the threshold. - - - This evaluator will trigger if the level of the event - passed to - is equal to or greater than the - level. + The object that in implementing this + object. The Logger object may not + be the same object as this object because of logger decorators. + This gets the actual underlying objects that is used to process + the log events. - + - Create a new evaluator using the specified threshold. + Interface used to delay activate a configured object. - the threshold to trigger at - Create a new evaluator using the specified threshold. + This allows an object to defer activation of its options until all + options have been set. This is required for components which have + related options that remain ambiguous until all are set. - This evaluator will trigger if the level of the event - passed to - is equal to or greater than the - level. + If a component implements this interface then the method + must be called by the container after its all the configured properties have been set + and before the component can be used. + Nicko Cadell - + - Is this the triggering event? + Activate the options that were previously set with calls to properties. - The event to check - This method returns true, if the event level - is equal or higher than the . - Otherwise it returns false - This evaluator will trigger if the level of the event - passed to - is equal to or greater than the - level. + This allows an object to defer activation of its options until all + options have been set. This is required for components which have + related options that remain ambiguous until all are set. + + + If a component implements this interface then this method must be called + after its properties have been set before the component can be used. - + - the threshold to trigger at + Delegate used to handle logger repository creation event notifications - - The that will cause this evaluator to trigger - + The which created the repository. + The event args + that holds the instance that has been created. - This evaluator will trigger if the level of the event - passed to - is equal to or greater than the - level. + Delegate used to handle logger repository creation event notifications. - + - Mapping between string name and Level object + Provides data for the event. - Mapping between string name and object. - This mapping is held separately for each . - The level name is case insensitive. + A + event is raised every time a is created. - Nicko Cadell - + - Mapping from level name to Level object. The - level name is case insensitive + The created - + - Construct the level map + Construct instance using specified + the that has been created - Construct the level map. + Construct instance using specified - + - Clear the internal maps of all levels + The that has been created + + The that has been created + - Clear the internal maps of all levels + The that has been created - + - Create a new Level and add it to the map + Interface used by the to select the . - the string to display for the Level - the level value to give to the Level - Create a new Level and add it to the map + The uses a + to specify the policy for selecting the correct + to return to the caller. - + Nicko Cadell + Gert Driesen - + - Create a new Level and add it to the map + Gets the for the specified assembly. - the string to display for the Level - the level value to give to the Level - the display name to give to the Level + The assembly to use to lookup to the + The for the assembly. - Create a new Level and add it to the map + Gets the for the specified assembly. + + + How the association between and + is made is not defined. The implementation may choose any method for + this association. The results of this method must be repeatable, i.e. + when called again with the same arguments the result must be the + save value. - + - Add a Level to the map + Gets the named . - the Level to add + The name to use to lookup to the . + The named - - Add a Level to the map - + Lookup a named . This is the repository created by + calling . - + - Lookup a named level from the map + Creates a new repository for the assembly specified. - the name of the level to lookup is taken from this level. - If the level is not set on the map then this level is added - the level in the map with the name specified + The assembly to use to create the domain to associate with the . + The type of repository to create, must implement . + The repository created. - Lookup a named level from the map. The name of the level to lookup is taken - from the property of the - argument. + The created will be associated with the domain + specified such that a call to with the + same assembly specified will return the same repository instance. - If no level with the specified name is found then the - argument is added to the level map - and returned. + How the association between and + is made is not defined. The implementation may choose any method for + this association. - + - Lookup a by name + Creates a new repository with the name specified. - The name of the Level to lookup - a Level from the map with the name specified + The name to associate with the . + The type of repository to create, must implement . + The repository created. - Returns the from the - map with the name specified. If the no level is - found then null is returned. + The created will be associated with the name + specified such that a call to with the + same name will return the same repository instance. - + - Return all possible levels as a list of Level objects. + Test if a named repository exists - all possible levels as a list of Level objects + the named repository to check + true if the repository exists - Return all possible levels as a list of Level objects. + Test if a named repository exists. Use + to create a new repository and to retrieve + a repository. - + - The internal representation of caller location information. + Gets an array of all currently defined repositories. + + An array of the instances created by + this . - This class uses the System.Diagnostics.StackTrace class to generate - a call stack. The caller's information is then extracted from this stack. - - - The System.Diagnostics.StackTrace class is not supported on the - .NET Compact Framework 1.0 therefore caller location information is not - available on that framework. + Gets an array of all of the repositories created by this selector. + + + + + Event to notify that a logger repository has been created. + + + Event to notify that a logger repository has been created. + + - The System.Diagnostics.StackTrace class has this to say about Release builds: + Event raised when a new repository is created. + The event source will be this selector. The event args will + be a which + holds the newly created . + + + + + Test if an triggers an action + + - "StackTrace information will be most informative with Debug build configurations. - By default, Debug builds include debug symbols, while Release builds do not. The - debug symbols contain most of the file, method name, line number, and column - information used in constructing StackFrame and StackTrace objects. StackTrace - might not report as many method calls as expected, due to code transformations - that occur during optimization." + Implementations of this interface allow certain appenders to decide + when to perform an appender specific action. - This means that in a Release build the caller information may be incomplete or may - not exist at all! Therefore caller location information cannot be relied upon in a Release build. + The action or behavior triggered is defined by the implementation. Nicko Cadell - Gert Driesen - + - When location information is not available the constant - NA is returned. Current value of this string - constant is ?. + Test if this event triggers the action + The event to check + true if this event triggers the action, otherwise false + + + Return true if this event triggers the action + + - + - Constructor + Defines the default set of levels recognized by the system. - The declaring type of the method that is - the stack boundary into the logging system for this call. - Initializes a new instance of the - class based on the current thread. + Each has an associated . + + + Levels have a numeric that defines the relative + ordering between levels. Two Levels with the same + are deemed to be equivalent. + + + The levels that are recognized by log4net are set for each + and each repository can have different levels defined. The levels are stored + in the on the repository. Levels are + looked up by name from the . + + + When logging at level INFO the actual level used is not but + the value of LoggerRepository.LevelMap["INFO"]. The default value for this is + , but this can be changed by reconfiguring the level map. + + + Each level has a in addition to its . The + is the string that is written into the output log. By default + the display name is the same as the level name, but this can be used to alias levels + or to localize the log output. + + + Some of the predefined levels recognized by the system are: + + + . + + + . + + + . + + + . + + + . + + + . + + + . + + + Nicko Cadell + Gert Driesen - + Constructor - The fully qualified class name. - The method name. - The file name. - The line number of the method within the file. + Integer value for this level, higher values represent more severe levels. + The string name of this level. + The display name for this level. This may be localized or otherwise different from the name - Initializes a new instance of the - class with the specified data. + Initializes a new instance of the class with + the specified level name and value. - + - The fully qualified type of the LocationInfo class. + Constructor + Integer value for this level, higher values represent more severe levels. + The string name of this level. - Used by the internal logger to record the Type of the - log message. + + Initializes a new instance of the class with + the specified level name and value. + - + - Gets the fully qualified class name of the caller making the logging - request. + Gets the name of this level. - The fully qualified class name of the caller making the logging - request. + The name of this level. - Gets the fully qualified class name of the caller making the logging - request. + Gets the name of this level. - + - Gets the file name of the caller. + Gets the value of this level. - The file name of the caller. + The value of this level. - Gets the file name of the caller. + Gets the value of this level. - + - Gets the line number of the caller. + Gets the display name of this level. - The line number of the caller. + The display name of this level. - Gets the line number of the caller. + Gets the display name of this level. - + - Gets the method name of the caller. + Returns the representation of the current + . - - The method name of the caller. - + + A representation of the current . + - Gets the method name of the caller. + Returns the level . - + - Gets all available caller information + Compares levels. - - All available caller information, in the format - fully.qualified.classname.of.caller.methodName(Filename:line) - + The object to compare against. + true if the objects are equal. - Gets all available caller information, in the format - fully.qualified.classname.of.caller.methodName(Filename:line) + Compares the levels of instances, and + defers to base class if the target object is not a + instance. - - - Gets the stack frames from the stack trace of the caller making the log request - - - + - Static manager that controls the creation of repositories + Returns a hash code + A hash code for the current . - Static manager that controls the creation of repositories - - - This class is used by the wrapper managers (e.g. ) - to provide access to the objects. + Returns a hash code suitable for use in hashing algorithms and data + structures like a hash table. - This manager also holds the that is used to - lookup and create repositories. The selector can be set either programmatically using - the property, or by setting the log4net.RepositorySelector - AppSetting in the applications config file to the fully qualified type name of the - selector to use. + Returns the hash code of the level . - Nicko Cadell - Gert Driesen - + - Private constructor to prevent instances. Only static methods should be used. + Compares this instance to a specified object and returns an + indication of their relative values. + A instance or to compare with this instance. + + A 32-bit signed integer that indicates the relative order of the + values compared. The return value has these meanings: + + + Value + Meaning + + + Less than zero + This instance is less than . + + + Zero + This instance is equal to . + + + Greater than zero + + This instance is greater than . + -or- + is . + + + + - Private constructor to prevent instances. Only static methods should be used. + must be an instance of + or ; otherwise, an exception is thrown. + is not a . - + - Hook the shutdown event + Returns a value indicating whether a specified + is greater than another specified . + A + A + + true if is greater than + ; otherwise, false. + - On the full .NET runtime, the static constructor hooks up the - AppDomain.ProcessExit and AppDomain.DomainUnload> events. - These are used to shutdown the log4net system as the application exits. + Compares two levels. - + - Register for ProcessExit and DomainUnload events on the AppDomain + Returns a value indicating whether a specified + is less than another specified . + A + A + + true if is less than + ; otherwise, false. + - This needs to be in a separate method because the events make - a LinkDemand for the ControlAppDomain SecurityPermission. Because - this is a LinkDemand it is demanded at JIT time. Therefore we cannot - catch the exception in the method itself, we have to catch it in the - caller. + Compares two levels. - + - Return the default instance. + Returns a value indicating whether a specified + is greater than or equal to another specified . - the repository to lookup in - Return the default instance + A + A + + true if is greater than or equal to + ; otherwise, false. + - Gets the for the repository specified - by the argument. + Compares two levels. - - - Returns the default instance. - - The assembly to use to lookup the repository. - The default instance. - - + - Return the default instance. + Returns a value indicating whether a specified + is less than or equal to another specified . - the repository to lookup in - Return the default instance + A + A + + true if is less than or equal to + ; otherwise, false. + - Gets the for the repository specified - by the argument. + Compares two levels. - + - Returns the default instance. + Returns a value indicating whether two specified + objects have the same value. - The assembly to use to lookup the repository. - The default instance. + A or . + A or . + + true if the value of is the same as the + value of ; otherwise, false. + - Returns the default instance. + Compares two levels. - + - Returns the named logger if it exists. + Returns a value indicating whether two specified + objects have different values. - The repository to lookup in. - The fully qualified logger name to look for. + A or . + A or . - The logger found, or null if the named logger does not exist in the - specified repository. + true if the value of is different from + the value of ; otherwise, false. - If the named logger exists (in the specified repository) then it - returns a reference to the logger, otherwise it returns - null. + Compares two levels. - + - Returns the named logger if it exists. + Compares two specified instances. - The assembly to use to lookup the repository. - The fully qualified logger name to look for. + The first to compare. + The second to compare. - The logger found, or null if the named logger does not exist in the - specified assembly's repository. + A 32-bit signed integer that indicates the relative order of the + two values compared. The return value has these meanings: + + + Value + Meaning + + + Less than zero + is less than . + + + Zero + is equal to . + + + Greater than zero + is greater than . + + - If the named logger exists (in the specified assembly's repository) then it - returns a reference to the logger, otherwise it returns - null. + Compares two levels. - + - Returns all the currently defined loggers in the specified repository. + The level designates a higher level than all the rest. - The repository to lookup in. - All the defined loggers. - - - The root logger is not included in the returned array. - - - + - Returns all the currently defined loggers in the specified assembly's repository. + The level designates very severe error events. + System unusable, emergencies. - The assembly to use to lookup the repository. - All the defined loggers. - - - The root logger is not included in the returned array. - - - + - Retrieves or creates a named logger. + The level designates very severe error events. + System unusable, emergencies. - The repository to lookup in. - The name of the logger to retrieve. - The logger with the name specified. - - - Retrieves a logger named as the - parameter. If the named logger already exists, then the - existing instance will be returned. Otherwise, a new instance is - created. - - - By default, loggers do not have a set level but inherit - it from the hierarchy. This is one of the central features of - log4net. - - - + - Retrieves or creates a named logger. + The level designates very severe error events + that will presumably lead the application to abort. - The assembly to use to lookup the repository. - The name of the logger to retrieve. - The logger with the name specified. - - - Retrieves a logger named as the - parameter. If the named logger already exists, then the - existing instance will be returned. Otherwise, a new instance is - created. - - - By default, loggers do not have a set level but inherit - it from the hierarchy. This is one of the central features of - log4net. - - - + - Shorthand for . + The level designates very severe error events. + Take immediate action, alerts. - The repository to lookup in. - The of which the fullname will be used as the name of the logger to retrieve. - The logger with the name specified. - - - Gets the logger for the fully qualified name of the type specified. - - - + - Shorthand for . + The level designates very severe error events. + Critical condition, critical. - the assembly to use to lookup the repository - The of which the fullname will be used as the name of the logger to retrieve. - The logger with the name specified. - - - Gets the logger for the fully qualified name of the type specified. - - - + - Shuts down the log4net system. + The level designates very severe error events. - - - Calling this method will safely close and remove all - appenders in all the loggers including root contained in all the - default repositories. - - - Some appenders need to be closed before the application exists. - Otherwise, pending logging events might be lost. - - - The shutdown method is careful to close nested - appenders before closing regular appenders. This is allows - configurations where a regular appender is attached to a logger - and again to a nested appender. - - - + - Shuts down the repository for the repository specified. + The level designates error events that might + still allow the application to continue running. - The repository to shutdown. - - - Calling this method will safely close and remove all - appenders in all the loggers including root contained in the - repository for the specified. - - - Some appenders need to be closed before the application exists. - Otherwise, pending logging events might be lost. - - - The shutdown method is careful to close nested - appenders before closing regular appenders. This is allows - configurations where a regular appender is attached to a logger - and again to a nested appender. - - - + - Shuts down the repository for the repository specified. + The level designates potentially harmful + situations. - The assembly to use to lookup the repository. - - - Calling this method will safely close and remove all - appenders in all the loggers including root contained in the - repository for the repository. The repository is looked up using - the specified. - - - Some appenders need to be closed before the application exists. - Otherwise, pending logging events might be lost. - - - The shutdown method is careful to close nested - appenders before closing regular appenders. This is allows - configurations where a regular appender is attached to a logger - and again to a nested appender. - - - + - Resets all values contained in this repository instance to their defaults. + The level designates informational messages + that highlight the progress of the application at the highest level. - The repository to reset. - - - Resets all values contained in the repository instance to their - defaults. This removes all appenders from all loggers, sets - the level of all non-root loggers to null, - sets their additivity flag to true and sets the level - of the root logger to . Moreover, - message disabling is set its default "off" value. - - - + - Resets all values contained in this repository instance to their defaults. + The level designates informational messages that + highlight the progress of the application at coarse-grained level. - The assembly to use to lookup the repository to reset. - - - Resets all values contained in the repository instance to their - defaults. This removes all appenders from all loggers, sets - the level of all non-root loggers to null, - sets their additivity flag to true and sets the level - of the root logger to . Moreover, - message disabling is set its default "off" value. - - - + - Creates a repository with the specified name. + The level designates fine-grained informational + events that are most useful to debug an application. - The name of the repository, this must be unique amongst repositories. - The created for the repository. - - - CreateDomain is obsolete. Use CreateRepository instead of CreateDomain. - - - Creates the default type of which is a - object. - - - The name must be unique. Repositories cannot be redefined. - An will be thrown if the repository already exists. - - - The specified repository already exists. - + - Creates a repository with the specified name. + The level designates fine-grained informational + events that are most useful to debug an application. - The name of the repository, this must be unique amongst repositories. - The created for the repository. - - - Creates the default type of which is a - object. - - - The name must be unique. Repositories cannot be redefined. - An will be thrown if the repository already exists. - - - The specified repository already exists. - + - Creates a repository with the specified name and repository type. + The level designates fine-grained informational + events that are most useful to debug an application. - The name of the repository, this must be unique to the repository. - A that implements - and has a no arg constructor. An instance of this type will be created to act - as the for the repository specified. - The created for the repository. - - - CreateDomain is obsolete. Use CreateRepository instead of CreateDomain. - - - The name must be unique. Repositories cannot be redefined. - An Exception will be thrown if the repository already exists. - - - The specified repository already exists. - + - Creates a repository with the specified name and repository type. + The level designates fine-grained informational + events that are most useful to debug an application. - The name of the repository, this must be unique to the repository. - A that implements - and has a no arg constructor. An instance of this type will be created to act - as the for the repository specified. - The created for the repository. - - - The name must be unique. Repositories cannot be redefined. - An Exception will be thrown if the repository already exists. - - - The specified repository already exists. - + - Creates a repository for the specified assembly and repository type. + The level designates fine-grained informational + events that are most useful to debug an application. - The assembly to use to get the name of the repository. - A that implements - and has a no arg constructor. An instance of this type will be created to act - as the for the repository specified. - The created for the repository. - - - CreateDomain is obsolete. Use CreateRepository instead of CreateDomain. - - - The created will be associated with the repository - specified such that a call to with the - same assembly specified will return the same repository instance. - - - + - Creates a repository for the specified assembly and repository type. + The level designates fine-grained informational + events that are most useful to debug an application. - The assembly to use to get the name of the repository. - A that implements - and has a no arg constructor. An instance of this type will be created to act - as the for the repository specified. - The created for the repository. - - - The created will be associated with the repository - specified such that a call to with the - same assembly specified will return the same repository instance. - - - + - Gets an array of all currently defined repositories. + The level designates the lowest level possible. - An array of all the known objects. - - - Gets an array of all currently defined repositories. - - - + - Internal method to get pertinent version info. + A strongly-typed collection of objects. - A string of version info. + Nicko Cadell - + - Called when the event fires + Supports type-safe iteration over a . - the that is exiting - null - - - Called when the event fires. - - - When the event is triggered the log4net system is . - - - + - Called when the event fires + Gets the current element in the collection. - the that is exiting - null - - - Called when the event fires. - - - When the event is triggered the log4net system is . - - - + - The fully qualified type of the LoggerManager class. + Advances the enumerator to the next element in the collection. - - Used by the internal logger to record the Type of the - log message. - + + true if the enumerator was successfully advanced to the next element; + false if the enumerator has passed the end of the collection. + + + The collection was modified after the enumerator was created. + - + - Initialize the default repository selector + Sets the enumerator to its initial position, before the first element in the collection. - + - Gets or sets the repository selector used by the . + Creates a read-only wrapper for a LevelCollection instance. - - The repository selector used by the . - - - - The repository selector () is used by - the to create and select repositories - (). - - - The caller to supplies either a string name - or an assembly (if not supplied the assembly is inferred using - ). - - - This context is used by the selector to lookup a specific repository. - - - For the full .NET Framework, the default repository is DefaultRepositorySelector; - for the .NET Compact Framework CompactRepositorySelector is the default - repository. - - + list to create a readonly wrapper arround + + A LevelCollection wrapper that is read-only. + - + - Implementation of the interface. + Initializes a new instance of the LevelCollection class + that is empty and has the default initial capacity. - - - This class should be used as the base for all wrapper implementations. - - - Nicko Cadell - Gert Driesen - + - Constructs a new wrapper for the specified logger. + Initializes a new instance of the LevelCollection class + that has the specified initial capacity. - The logger to wrap. - - - Constructs a new wrapper for the specified logger. - - + + The number of elements that the new LevelCollection is initially capable of storing. + - + - The logger that this object is wrapping + Initializes a new instance of the LevelCollection class + that contains elements copied from the specified LevelCollection. + The LevelCollection whose elements are copied to the new collection. - + - Gets the implementation behind this wrapper object. + Initializes a new instance of the LevelCollection class + that contains elements copied from the specified array. - - The object that this object is implementing. - - - - The Logger object may not be the same object as this object - because of logger decorators. - - - This gets the actual underlying objects that is used to process - the log events. - - + The array whose elements are copied to the new list. - + - Portable data structure used by + Initializes a new instance of the LevelCollection class + that contains elements copied from the specified collection. - - - Portable data structure used by - - - Nicko Cadell + The collection whose elements are copied to the new list. - + - The logger name. + Type visible only to our subclasses + Used to access protected constructor - - - The logger name. - - - + - Level of logging event. + A value - - - Level of logging event. Level cannot be Serializable - because it is a flyweight. Due to its special serialization it - cannot be declared final either. - - - + - The application supplied message. + Allow subclasses to avoid our default constructors - - - The application supplied message of logging event. - - + - + - The name of thread + Gets the number of elements actually contained in the LevelCollection. - - - The name of thread in which this logging event was generated - - - + - Gets or sets the local time the event was logged + Copies the entire LevelCollection to a one-dimensional + array. - - - Prefer using the setter, since local time can be ambiguous. - - + The one-dimensional array to copy to. - + - Location information for the caller. + Copies the entire LevelCollection to a one-dimensional + array, starting at the specified index of the target array. - - - Location information for the caller. - - + The one-dimensional array to copy to. + The zero-based index in at which copying begins. - + - String representation of the user + Gets a value indicating whether access to the collection is synchronized (thread-safe). - - - String representation of the user's windows name, - like DOMAIN\username - - + false, because the backing type is an array, which is never thread-safe. - + - String representation of the identity. + Gets an object that can be used to synchronize access to the collection. - - - String representation of the current thread's principal identity. - - - + - The string representation of the exception + Gets or sets the at the specified index. - - - The string representation of the exception - - + The zero-based index of the element to get or set. + + is less than zero + -or- + is equal to or greater than . + - + - String representation of the AppDomain. + Adds a to the end of the LevelCollection. - - - String representation of the AppDomain. - - + The to be added to the end of the LevelCollection. + The index at which the value has been added. - + - Additional event specific properties + Removes all elements from the LevelCollection. - - - A logger or an appender may attach additional - properties to specific events. These properties - have a string key and an object value. - - - + - Gets or sets the UTC time the event was logged + Creates a shallow copy of the . - - - The TimeStamp is stored in the UTC time zone. - - + A new with a shallow copy of the collection data. - + - Flags passed to the property + Determines whether a given is in the LevelCollection. - - - Flags passed to the property - - - Nicko Cadell + The to check for. + true if is found in the LevelCollection; otherwise, false. - + - Fix the MDC + Returns the zero-based index of the first occurrence of a + in the LevelCollection. + The to locate in the LevelCollection. + + The zero-based index of the first occurrence of + in the entire LevelCollection, if found; otherwise, -1. + - + - Fix the NDC + Inserts an element into the LevelCollection at the specified index. + The zero-based index at which should be inserted. + The to insert. + + is less than zero + -or- + is equal to or greater than . + - + - Fix the rendered message + Removes the first occurrence of a specific from the LevelCollection. + The to remove from the LevelCollection. + + The specified was not found in the LevelCollection. + - + - Fix the thread name + Removes the element at the specified index of the LevelCollection. + The zero-based index of the element to remove. + + is less than zero + -or- + is equal to or greater than . + - + - Fix the callers location information + Gets a value indicating whether the collection has a fixed size. - - CAUTION: Very slow to generate - + true if the collection has a fixed size; otherwise, false. The default is false - + - Fix the callers windows user name + Gets a value indicating whether the IList is read-only. - - CAUTION: Slow to generate - + true if the collection is read-only; otherwise, false. The default is false - + - Fix the domain friendly name + Returns an enumerator that can iterate through the LevelCollection. + An for the entire LevelCollection. - + - Fix the callers principal name + Gets or sets the number of elements the LevelCollection can contain. - - CAUTION: May be slow to generate - - + - Fix the exception text + Adds the elements of another LevelCollection to the current LevelCollection. + The LevelCollection whose elements should be added to the end of the current LevelCollection. + The new of the LevelCollection. - + - Fix the event properties. Active properties must implement in order to be eligible for fixing. + Adds the elements of a array to the current LevelCollection. + The array whose elements should be added to the end of the LevelCollection. + The new of the LevelCollection. - + - No fields fixed + Adds the elements of a collection to the current LevelCollection. + The collection whose elements should be added to the end of the LevelCollection. + The new of the LevelCollection. - + - All fields fixed + Sets the capacity to the actual number of elements. - + + + is less than zero + -or- + is equal to or greater than . + + + + + is less than zero + -or- + is equal to or greater than . + + + - Partial fields fixed + Supports simple iteration over a . - - - This set of partial fields gives good performance. The following fields are fixed: - - - - - - - - - - + - The internal representation of logging events. + Initializes a new instance of the Enumerator class. - - - When an affirmative decision is made to log then a - instance is created. This instance - is passed around to the different log4net components. - - - This class is of concern to those wishing to extend log4net. - - - Some of the values in instances of - are considered volatile, that is the values are correct at the - time the event is delivered to appenders, but will not be consistent - at any time afterwards. If an event is to be stored and then processed - at a later time these volatile values must be fixed by calling - . There is a performance penalty - for incurred by calling but it - is essential to maintaining data consistency. - - - Nicko Cadell - Gert Driesen - Douglas de la Torre - Daniel Cazzulino + - + - The key into the Properties map for the host name value. + Gets the current element in the collection. - + - The key into the Properties map for the thread identity value. + Advances the enumerator to the next element in the collection. + + true if the enumerator was successfully advanced to the next element; + false if the enumerator has passed the end of the collection. + + + The collection was modified after the enumerator was created. + - + - The key into the Properties map for the user name value. + Sets the enumerator to its initial position, before the first element in the collection. - + - Initializes a new instance of the class - from the supplied parameters. + An evaluator that triggers at a threshold level - The declaring type of the method that is - the stack boundary into the logging system for this call. - The repository this event is logged in. - The name of the logger of this event. - The level of this event. - The message of this event. - The exception for this event. - Except , and , - all fields of LoggingEvent are filled when actually needed. Call - to cache all data locally - to prevent inconsistencies. - - This method is called by the log4net framework - to create a logging event. + This evaluator will trigger if the level of the event + passed to + is equal to or greater than the + level. + Nicko Cadell - + - Initializes a new instance of the class - using specific data. + The threshold for triggering + + + + + Create a new evaluator using the threshold. - The declaring type of the method that is - the stack boundary into the logging system for this call. - The repository this event is logged in. - Data used to initialize the logging event. - The fields in the struct that have already been fixed. - This constructor is provided to allow a - to be created independently of the log4net framework. This can - be useful if you require a custom serialization scheme. - - - Use the method to obtain an - instance of the class. + Create a new evaluator using the threshold. - The parameter should be used to specify which fields in the - struct have been preset. Fields not specified in the - will be captured from the environment if requested or fixed. + This evaluator will trigger if the level of the event + passed to + is equal to or greater than the + level. - + - Initializes a new instance of the class - using specific data. + Create a new evaluator using the specified threshold. - The declaring type of the method that is - the stack boundary into the logging system for this call. - The repository this event is logged in. - Data used to initialize the logging event. + the threshold to trigger at - This constructor is provided to allow a - to be created independently of the log4net framework. This can - be useful if you require a custom serialization scheme. - - - Use the method to obtain an - instance of the class. + Create a new evaluator using the specified threshold. - This constructor sets this objects flags to , - this assumes that all the data relating to this event is passed in via the - parameter and no other data should be captured from the environment. + This evaluator will trigger if the level of the event + passed to + is equal to or greater than the + level. - + - Initializes a new instance of the class - using specific data. + the threshold to trigger at - Data used to initialize the logging event. + + The that will cause this evaluator to trigger + - This constructor is provided to allow a - to be created independently of the log4net framework. This can - be useful if you require a custom serialization scheme. - - - Use the method to obtain an - instance of the class. + This evaluator will trigger if the level of the event + passed to + is equal to or greater than the + level. + + + + + Is this the triggering event? + + The event to check + This method returns true, if the event level + is equal or higher than the . + Otherwise it returns false + - This constructor sets this objects flags to , - this assumes that all the data relating to this event is passed in via the - parameter and no other data should be captured from the environment. + This evaluator will trigger if the level of the event + passed to + is equal to or greater than the + level. - + - Serialization constructor + Mapping between string name and Level object - The that holds the serialized object data. - The that contains contextual information about the source or destination. - Initializes a new instance of the class - with serialized data. + Mapping between string name and object. + This mapping is held separately for each . + The level name is case insensitive. + Nicko Cadell - + - Ensure that the repository is set. + Mapping from level name to Level object. The + level name is case insensitive - the value for the repository - + - Write the rendered message to a TextWriter + Construct the level map - the writer to write the message to - Unlike the property this method - does store the message data in the internal cache. Therefore - if called only once this method should be faster than the - property, however if the message is - to be accessed multiple times then the property will be more efficient. + Construct the level map. - + - Serializes this object into the provided. + Clear the internal maps of all levels - The to populate with data. - The destination for this serialization. - The data in this event must be fixed before it can be serialized. - - - The method must be called during the - method call if this event - is to be used outside that method. + Clear the internal maps of all levels - + - Gets the portable data for this . + Lookup a by name - The for this event. + The name of the Level to lookup + a Level from the map with the name specified - A new can be constructed using a - instance. - - - Does a fix of the data - in the logging event before returning the event data. + Returns the from the + map with the name specified. If the no level is + found then null is returned. - + - Gets the portable data for this . + Create a new Level and add it to the map - The set of data to ensure is fixed in the LoggingEventData - The for this event. + the string to display for the Level + the level value to give to the Level - A new can be constructed using a - instance. + Create a new Level and add it to the map + - + - Returns this event's exception's rendered using the - . + Create a new Level and add it to the map - - This event's exception's rendered using the . - + the string to display for the Level + the level value to give to the Level + the display name to give to the Level - Obsolete. Use instead. + Create a new Level and add it to the map - + - Returns this event's exception's rendered using the - . + Add a Level to the map - - This event's exception's rendered using the . - + the Level to add - Returns this event's exception's rendered using the - . + Add a Level to the map - + - Fix instance fields that hold volatile data. + Return all possible levels as a list of Level objects. + all possible levels as a list of Level objects - Some of the values in instances of - are considered volatile, that is the values are correct at the - time the event is delivered to appenders, but will not be consistent - at any time afterwards. If an event is to be stored and then processed - at a later time these volatile values must be fixed by calling - . There is a performance penalty - incurred by calling but it - is essential to maintaining data consistency. + Return all possible levels as a list of Level objects. + + + + + Lookup a named level from the map + + the name of the level to lookup is taken from this level. + If the level is not set on the map then this level is added + the level in the map with the name specified + - Calling is equivalent to - calling passing the parameter - false. + Lookup a named level from the map. The name of the level to lookup is taken + from the property of the + argument. - See for more - information. + If no level with the specified name is found then the + argument is added to the level map + and returned. - + - Fixes instance fields that hold volatile data. + The internal representation of caller location information. - Set to true to not fix data that takes a long time to fix. - Some of the values in instances of - are considered volatile, that is the values are correct at the - time the event is delivered to appenders, but will not be consistent - at any time afterwards. If an event is to be stored and then processed - at a later time these volatile values must be fixed by calling - . There is a performance penalty - for incurred by calling but it - is essential to maintaining data consistency. + This class uses the System.Diagnostics.StackTrace class to generate + a call stack. The caller's information is then extracted from this stack. - The param controls the data that - is fixed. Some of the data that can be fixed takes a long time to - generate, therefore if you do not require those settings to be fixed - they can be ignored by setting the param - to true. This setting will ignore the - and settings. + The System.Diagnostics.StackTrace class is not supported on the + .NET Compact Framework 1.0 therefore caller location information is not + available on that framework. - Set to false to ensure that all - settings are fixed. + The System.Diagnostics.StackTrace class has this to say about Release builds: + + + "StackTrace information will be most informative with Debug build configurations. + By default, Debug builds include debug symbols, while Release builds do not. The + debug symbols contain most of the file, method name, line number, and column + information used in constructing StackFrame and StackTrace objects. StackTrace + might not report as many method calls as expected, due to code transformations + that occur during optimization." + + + This means that in a Release build the caller information may be incomplete or may + not exist at all! Therefore caller location information cannot be relied upon in a Release build. + Nicko Cadell + Gert Driesen - + - Fix the fields specified by the parameter + Constructor - the fields to fix + The declaring type of the method that is + the stack boundary into the logging system for this call. - Only fields specified in the will be fixed. - Fields will not be fixed if they have previously been fixed. - It is not possible to 'unfix' a field. + Initializes a new instance of the + class based on the current thread. - + - Lookup a composite property in this event + Constructor - the key for the property to lookup - the value for the property + The fully qualified class name. + The method name. + The file name. + The line number of the method within the file. - This event has composite properties that combine together properties from - several different contexts in the following order: - - - this events properties - - This event has that can be set. These - properties are specific to this event only. - - - - the thread properties - - The that are set on the current - thread. These properties are shared by all events logged on this thread. - - - - the global properties - - The that are set globally. These - properties are shared by all the threads in the AppDomain. - - - + Initializes a new instance of the + class with the specified data. - + - Get all the composite properties in this event + Gets the fully qualified class name of the caller making the logging + request. - the containing all the properties + + The fully qualified class name of the caller making the logging + request. + - See for details of the composite properties - stored by the event. - - - This method returns a single containing all the - properties defined for this event. + Gets the fully qualified class name of the caller making the logging + request. - + - The internal logging event data. + Gets the file name of the caller. + + The file name of the caller. + + + + Gets the file name of the caller. + + - + - The internal logging event data. + Gets the line number of the caller. + + The line number of the caller. + + + + Gets the line number of the caller. + + - + - The internal logging event data. + Gets the method name of the caller. + + The method name of the caller. + + + + Gets the method name of the caller. + + - + - The fully qualified Type of the calling - logger class in the stack frame (i.e. the declaring type of the method). + Gets all available caller information + + All available caller information, in the format + fully.qualified.classname.of.caller.methodName(Filename:line) + + + + Gets all available caller information, in the format + fully.qualified.classname.of.caller.methodName(Filename:line) + + - + - The application supplied message of logging event. + Gets the stack frames from the stack trace of the caller making the log request - + - The exception that was thrown. + The fully qualified type of the LocationInfo class. - This is not serialized. The string representation - is serialized instead. + Used by the internal logger to record the Type of the + log message. - + - The repository that generated the logging event + When location information is not available the constant + NA is returned. Current value of this string + constant is ?. - - This is not serialized. - - + - The fix state for this event + Exception base type for log4net. - These flags indicate which fields have been fixed. - Not serialized. + + This type extends . It + does not add any new functionality but does differentiate the + type of exception being thrown. + + Nicko Cadell + Gert Driesen - + - Indicated that the internal cache is updateable (ie not fixed) + Constructor - This is a seperate flag to m_fixFlags as it allows incrementel fixing and simpler - changes in the caching strategy. + + Initializes a new instance of the class. + - + - Gets the time when the current process started. + Constructor - - This is the time when this process started. - + A message to include with the exception. - The TimeStamp is stored internally in UTC and converted to the local time zone for this computer. - - - Tries to get the start time for the current process. - Failing that it returns the time of the first call to - this property. - - - Note that AppDomains may be loaded and unloaded within the - same process without the process terminating and therefore - without the process start time being reset. + Initializes a new instance of the class with + the specified message. - + - Gets the UTC time when the current process started. + Constructor - - This is the UTC time when this process started. - + A message to include with the exception. + A nested exception to include. - Tries to get the start time for the current process. - Failing that it returns the time of the first call to - this property. - - - Note that AppDomains may be loaded and unloaded within the - same process without the process terminating and therefore - without the process start time being reset. + Initializes a new instance of the class + with the specified message and inner exception. - + - Gets the of the logging event. + Serialization constructor - - The of the logging event. - + The that holds the serialized object data about the exception being thrown. + The that contains contextual information about the source or destination. - Gets the of the logging event. + Initializes a new instance of the class + with serialized data. - + - Gets the time of the logging event. + Static manager that controls the creation of repositories - - The time of the logging event. - - The TimeStamp is stored in UTC and converted to the local time zone for this computer. + Static manager that controls the creation of repositories + + + This class is used by the wrapper managers (e.g. ) + to provide access to the objects. + + + This manager also holds the that is used to + lookup and create repositories. The selector can be set either programmatically using + the property, or by setting the log4net.RepositorySelector + AppSetting in the applications config file to the fully qualified type name of the + selector to use. + Nicko Cadell + Gert Driesen - - - Gets UTC the time of the logging event. - - - The UTC time of the logging event. - - - + - Gets the name of the logger that logged the event. + Private constructor to prevent instances. Only static methods should be used. - - The name of the logger that logged the event. - - Gets the name of the logger that logged the event. + Private constructor to prevent instances. Only static methods should be used. - + - Gets the location information for this logging event. + Hook the shutdown event - - The location information for this logging event. - - The collected information is cached for future use. - - - See the class for more information on - supported frameworks and the different behavior in Debug and - Release builds. + On the full .NET runtime, the static constructor hooks up the + AppDomain.ProcessExit and AppDomain.DomainUnload> events. + These are used to shutdown the log4net system as the application exits. - + - Gets the message object used to initialize this event. + Register for ProcessExit and DomainUnload events on the AppDomain - - The message object used to initialize this event. - - Gets the message object used to initialize this event. - Note that this event may not have a valid message object. - If the event is serialized the message object will not - be transferred. To get the text of the message the - property must be used - not this property. - - - If there is no defined message object for this event then - null will be returned. + This needs to be in a separate method because the events make + a LinkDemand for the ControlAppDomain SecurityPermission. Because + this is a LinkDemand it is demanded at JIT time. Therefore we cannot + catch the exception in the method itself, we have to catch it in the + caller. - + - Gets the exception object used to initialize this event. + Return the default instance. - - The exception object used to initialize this event. - + the repository to lookup in + Return the default instance - Gets the exception object used to initialize this event. - Note that this event may not have a valid exception object. - If the event is serialized the exception object will not - be transferred. To get the text of the exception the - method must be used - not this property. - - - If there is no defined exception object for this event then - null will be returned. + Gets the for the repository specified + by the argument. - + - The that this event was created in. + Returns the default instance. + + The assembly to use to lookup the repository. + The default instance. + + + + Return the default instance. + the repository to lookup in + Return the default instance - The that this event was created in. + Gets the for the repository specified + by the argument. - + - Gets the message, rendered through the . + Returns the default instance. - - The message rendered through the . - + The assembly to use to lookup the repository. + The default instance. - The collected information is cached for future use. + Returns the default instance. - + - Gets the name of the current thread. + Returns the named logger if it exists. - - The name of the current thread, or the thread ID when - the name is not available. - + The repository to lookup in. + The fully qualified logger name to look for. + + The logger found, or null if the named logger does not exist in the + specified repository. + - The collected information is cached for future use. + If the named logger exists (in the specified repository) then it + returns a reference to the logger, otherwise it returns + null. - + - Gets the name of the current user. + Returns the named logger if it exists. - - The name of the current user, or NOT AVAILABLE when the - underlying runtime has no support for retrieving the name of the - current user. - + The assembly to use to lookup the repository. + The fully qualified logger name to look for. + + The logger found, or null if the named logger does not exist in the + specified assembly's repository. + - Calls WindowsIdentity.GetCurrent().Name to get the name of - the current windows user. - - - To improve performance, we could cache the string representation of - the name, and reuse that as long as the identity stayed constant. - Once the identity changed, we would need to re-assign and re-render - the string. - - - However, the WindowsIdentity.GetCurrent() call seems to - return different objects every time, so the current implementation - doesn't do this type of caching. - - - Timing for these operations: - - - - Method - Results - - - WindowsIdentity.GetCurrent() - 10000 loops, 00:00:00.2031250 seconds - - - WindowsIdentity.GetCurrent().Name - 10000 loops, 00:00:08.0468750 seconds - - - - This means we could speed things up almost 40 times by caching the - value of the WindowsIdentity.GetCurrent().Name property, since - this takes (8.04-0.20) = 7.84375 seconds. + If the named logger exists (in the specified assembly's repository) then it + returns a reference to the logger, otherwise it returns + null. - + - Gets the identity of the current thread principal. + Returns all the currently defined loggers in the specified repository. - - The string name of the identity of the current thread principal. - + The repository to lookup in. + All the defined loggers. - Calls System.Threading.Thread.CurrentPrincipal.Identity.Name to get - the name of the current thread principal. + The root logger is not included in the returned array. - + - Gets the AppDomain friendly name. + Returns all the currently defined loggers in the specified assembly's repository. - - The AppDomain friendly name. - + The assembly to use to lookup the repository. + All the defined loggers. - Gets the AppDomain friendly name. + The root logger is not included in the returned array. - + - Additional event specific properties. + Retrieves or creates a named logger. - - Additional event specific properties. - + The repository to lookup in. + The name of the logger to retrieve. + The logger with the name specified. - A logger or an appender may attach additional - properties to specific events. These properties - have a string key and an object value. - - - This property is for events that have been added directly to - this event. The aggregate properties (which include these - event properties) can be retrieved using - and . + Retrieves a logger named as the + parameter. If the named logger already exists, then the + existing instance will be returned. Otherwise, a new instance is + created. - Once the properties have been fixed this property - returns the combined cached properties. This ensures that updates to - this property are always reflected in the underlying storage. When - returning the combined properties there may be more keys in the - Dictionary than expected. + By default, loggers do not have a set level but inherit + it from the hierarchy. This is one of the central features of + log4net. - + - The fixed fields in this event + Retrieves or creates a named logger. - - The set of fields that are fixed in this event - + The assembly to use to lookup the repository. + The name of the logger to retrieve. + The logger with the name specified. - Fields will not be fixed if they have previously been fixed. - It is not possible to 'unfix' a field. + Retrieves a logger named as the + parameter. If the named logger already exists, then the + existing instance will be returned. Otherwise, a new instance is + created. + + + By default, loggers do not have a set level but inherit + it from the hierarchy. This is one of the central features of + log4net. - + - Implementation of wrapper interface. + Shorthand for . + The repository to lookup in. + The of which the fullname will be used as the name of the logger to retrieve. + The logger with the name specified. - This implementation of the interface - forwards to the held by the base class. - - - This logger has methods to allow the caller to log at the following - levels: + Gets the logger for the fully qualified name of the type specified. - - - DEBUG - - The and methods log messages - at the DEBUG level. That is the level with that name defined in the - repositories . The default value - for this level is . The - property tests if this level is enabled for logging. - - - - INFO - - The and methods log messages - at the INFO level. That is the level with that name defined in the - repositories . The default value - for this level is . The - property tests if this level is enabled for logging. - - - - WARN - - The and methods log messages - at the WARN level. That is the level with that name defined in the - repositories . The default value - for this level is . The - property tests if this level is enabled for logging. - - - - ERROR - - The and methods log messages - at the ERROR level. That is the level with that name defined in the - repositories . The default value - for this level is . The - property tests if this level is enabled for logging. - - - - FATAL - - The and methods log messages - at the FATAL level. That is the level with that name defined in the - repositories . The default value - for this level is . The - property tests if this level is enabled for logging. - - - + + + + + Shorthand for . + + the assembly to use to lookup the repository + The of which the fullname will be used as the name of the logger to retrieve. + The logger with the name specified. + - The values for these levels and their semantic meanings can be changed by - configuring the for the repository. + Gets the logger for the fully qualified name of the type specified. - Nicko Cadell - Gert Driesen - + - The ILog interface is use by application to log messages into - the log4net framework. + Shuts down the log4net system. - Use the to obtain logger instances - that implement this interface. The - static method is used to get logger instances. + Calling this method will safely close and remove all + appenders in all the loggers including root contained in all the + default repositories. - This class contains methods for logging at different levels and also - has properties for determining if those logging levels are - enabled in the current configuration. + Some appenders need to be closed before the application exists. + Otherwise, pending logging events might be lost. - This interface can be implemented in different ways. This documentation - specifies reasonable behavior that a caller can expect from the actual - implementation, however different implementations reserve the right to - do things differently. + The shutdown method is careful to close nested + appenders before closing regular appenders. This is allows + configurations where a regular appender is attached to a logger + and again to a nested appender. - Simple example of logging messages - - ILog log = LogManager.GetLogger("application-log"); - - log.Info("Application Start"); - log.Debug("This is a debug message"); - - if (log.IsDebugEnabled) - { - log.Debug("This is another debug message"); - } - - - - - Nicko Cadell - Gert Driesen - - Log a message object with the level. + - Log a message object with the level. + Shuts down the repository for the repository specified. - The message object to log. + The repository to shutdown. - This method first checks if this logger is DEBUG - enabled by comparing the level of this logger with the - level. If this logger is - DEBUG enabled, then it converts the message object - (passed as parameter) to a string by invoking the appropriate - . It then - proceeds to call all the registered appenders in this logger - and also higher in the hierarchy depending on the value of - the additivity flag. + Calling this method will safely close and remove all + appenders in all the loggers including root contained in the + repository for the specified. - WARNING Note that passing an - to this method will print the name of the - but no stack trace. To print a stack trace use the - form instead. + + Some appenders need to be closed before the application exists. + Otherwise, pending logging events might be lost. + + + The shutdown method is careful to close nested + appenders before closing regular appenders. This is allows + configurations where a regular appender is attached to a logger + and again to a nested appender. - - - + - Log a message object with the level including - the stack trace of the passed - as a parameter. + Shuts down the repository for the repository specified. - The message object to log. - The exception to log, including its stack trace. + The assembly to use to lookup the repository. - See the form for more detailed information. + Calling this method will safely close and remove all + appenders in all the loggers including root contained in the + repository for the repository. The repository is looked up using + the specified. + + + Some appenders need to be closed before the application exists. + Otherwise, pending logging events might be lost. + + + The shutdown method is careful to close nested + appenders before closing regular appenders. This is allows + configurations where a regular appender is attached to a logger + and again to a nested appender. - - - - Log a formatted string with the level. + - Logs a formatted message string with the level. + Resets all values contained in this repository instance to their defaults. - A String containing zero or more format items - An Object array containing zero or more objects to format + The repository to reset. - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - + Resets all values contained in the repository instance to their + defaults. This removes all appenders from all loggers, sets + the level of all non-root loggers to null, + sets their additivity flag to true and sets the level + of the root logger to . Moreover, + message disabling is set its default "off" value. + - - - + - Logs a formatted message string with the level. + Resets all values contained in this repository instance to their defaults. - A String containing zero or more format items - An Object to format + The assembly to use to lookup the repository to reset. - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - + Resets all values contained in the repository instance to their + defaults. This removes all appenders from all loggers, sets + the level of all non-root loggers to null, + sets their additivity flag to true and sets the level + of the root logger to . Moreover, + message disabling is set its default "off" value. + - - - + - Logs a formatted message string with the level. + Creates a repository with the specified name. - A String containing zero or more format items - An Object to format - An Object to format + The name of the repository, this must be unique amongst repositories. + The created for the repository. - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. + CreateDomain is obsolete. Use CreateRepository instead of CreateDomain. - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. + Creates the default type of which is a + object. + + + The name must be unique. Repositories cannot be redefined. + An will be thrown if the repository already exists. - - + The specified repository already exists. - + - Logs a formatted message string with the level. + Creates a repository with the specified name. - A String containing zero or more format items - An Object to format - An Object to format - An Object to format + The name of the repository, this must be unique amongst repositories. + The created for the repository. - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. + Creates the default type of which is a + object. - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. + The name must be unique. Repositories cannot be redefined. + An will be thrown if the repository already exists. - - + The specified repository already exists. - + - Logs a formatted message string with the level. + Creates a repository with the specified name and repository type. - An that supplies culture-specific formatting information - A String containing zero or more format items - An Object array containing zero or more objects to format + The name of the repository, this must be unique to the repository. + A that implements + and has a no arg constructor. An instance of this type will be created to act + as the for the repository specified. + The created for the repository. - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. + CreateDomain is obsolete. Use CreateRepository instead of CreateDomain. - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. + The name must be unique. Repositories cannot be redefined. + An Exception will be thrown if the repository already exists. - - + The specified repository already exists. - - Log a message object with the level. + - Logs a message object with the level. + Creates a repository with the specified name and repository type. + The name of the repository, this must be unique to the repository. + A that implements + and has a no arg constructor. An instance of this type will be created to act + as the for the repository specified. + The created for the repository. - This method first checks if this logger is INFO - enabled by comparing the level of this logger with the - level. If this logger is - INFO enabled, then it converts the message object - (passed as parameter) to a string by invoking the appropriate - . It then - proceeds to call all the registered appenders in this logger - and also higher in the hierarchy depending on the value of the - additivity flag. - - WARNING Note that passing an - to this method will print the name of the - but no stack trace. To print a stack trace use the - form instead. + The name must be unique. Repositories cannot be redefined. + An Exception will be thrown if the repository already exists. - The message object to log. - - + The specified repository already exists. - + - Logs a message object with the INFO level including - the stack trace of the passed - as a parameter. + Creates a repository for the specified assembly and repository type. - The message object to log. - The exception to log, including its stack trace. + The assembly to use to get the name of the repository. + A that implements + and has a no arg constructor. An instance of this type will be created to act + as the for the repository specified. + The created for the repository. - See the form for more detailed information. + CreateDomain is obsolete. Use CreateRepository instead of CreateDomain. + + + The created will be associated with the repository + specified such that a call to with the + same assembly specified will return the same repository instance. - - - - Log a formatted message string with the level. + - Logs a formatted message string with the level. + Creates a repository for the specified assembly and repository type. - A String containing zero or more format items - An Object array containing zero or more objects to format + The assembly to use to get the name of the repository. + A that implements + and has a no arg constructor. An instance of this type will be created to act + as the for the repository specified. + The created for the repository. - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. + The created will be associated with the repository + specified such that a call to with the + same assembly specified will return the same repository instance. - - - + - Logs a formatted message string with the level. + Gets an array of all currently defined repositories. - A String containing zero or more format items - An Object to format + An array of all the known objects. - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. + Gets an array of all currently defined repositories. - - - + - Logs a formatted message string with the level. + Gets or sets the repository selector used by the . - A String containing zero or more format items - An Object to format - An Object to format + + The repository selector used by the . + - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. + The repository selector () is used by + the to create and select repositories + (). - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. + The caller to supplies either a string name + or an assembly (if not supplied the assembly is inferred using + ). + + + This context is used by the selector to lookup a specific repository. + + + For the full .NET Framework, the default repository is DefaultRepositorySelector; + for the .NET Compact Framework CompactRepositorySelector is the default + repository. - - - + - Logs a formatted message string with the level. + Internal method to get pertinent version info. - A String containing zero or more format items - An Object to format - An Object to format - An Object to format + A string of version info. + + + + Called when the event fires + + the that is exiting + null - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. + Called when the event fires. - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. + When the event is triggered the log4net system is . - - - + - Logs a formatted message string with the level. + Called when the event fires - An that supplies culture-specific formatting information - A String containing zero or more format items - An Object array containing zero or more objects to format + the that is exiting + null - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. + Called when the event fires. - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. + When the event is triggered the log4net system is . - - - - Log a message object with the level. + - Log a message object with the level. + The fully qualified type of the LoggerManager class. - - This method first checks if this logger is WARN - enabled by comparing the level of this logger with the - level. If this logger is - WARN enabled, then it converts the message object - (passed as parameter) to a string by invoking the appropriate - . It then - proceeds to call all the registered appenders in this logger - and also higher in the hierarchy depending on the value of the - additivity flag. - - WARNING Note that passing an - to this method will print the name of the - but no stack trace. To print a stack trace use the - form instead. - + Used by the internal logger to record the Type of the + log message. - The message object to log. - - - + - Log a message object with the level including - the stack trace of the passed - as a parameter. + Initialize the default repository selector + + + + + Implementation of the interface. - The message object to log. - The exception to log, including its stack trace. - See the form for more detailed information. + This class should be used as the base for all wrapper implementations. - - + Nicko Cadell + Gert Driesen - - Log a formatted message string with the level. + - Logs a formatted message string with the level. + Constructs a new wrapper for the specified logger. - A String containing zero or more format items - An Object array containing zero or more objects to format + The logger to wrap. - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. + Constructs a new wrapper for the specified logger. - - - + - Logs a formatted message string with the level. + Gets the implementation behind this wrapper object. - A String containing zero or more format items - An Object to format + + The object that this object is implementing. + - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. + The Logger object may not be the same object as this object + because of logger decorators. - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. + This gets the actual underlying objects that is used to process + the log events. - - - + - Logs a formatted message string with the level. + The logger that this object is wrapping + + + + + Portable data structure used by - A String containing zero or more format items - An Object to format - An Object to format - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. + Portable data structure used by - - + Nicko Cadell - + - Logs a formatted message string with the level. + The logger name. - A String containing zero or more format items - An Object to format - An Object to format - An Object to format - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. + The logger name. - - - + - Logs a formatted message string with the level. + Level of logging event. - An that supplies culture-specific formatting information - A String containing zero or more format items - An Object array containing zero or more objects to format - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. + Level of logging event. Level cannot be Serializable + because it is a flyweight. Due to its special serialization it + cannot be declared final either. - - - - Log a message object with the level. + - Logs a message object with the level. + The application supplied message. - The message object to log. - This method first checks if this logger is ERROR - enabled by comparing the level of this logger with the - level. If this logger is - ERROR enabled, then it converts the message object - (passed as parameter) to a string by invoking the appropriate - . It then - proceeds to call all the registered appenders in this logger - and also higher in the hierarchy depending on the value of the - additivity flag. - - WARNING Note that passing an - to this method will print the name of the - but no stack trace. To print a stack trace use the - form instead. + The application supplied message of logging event. - - - + - Log a message object with the level including - the stack trace of the passed - as a parameter. + The name of thread - The message object to log. - The exception to log, including its stack trace. - See the form for more detailed information. + The name of thread in which this logging event was generated - - - - Log a formatted message string with the level. + - Logs a formatted message string with the level. + Gets or sets the local time the event was logged - A String containing zero or more format items - An Object array containing zero or more objects to format - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. + Prefer using the setter, since local time can be ambiguous. - - - + - Logs a formatted message string with the level. + Gets or sets the UTC time the event was logged - A String containing zero or more format items - An Object to format - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. + The TimeStamp is stored in the UTC time zone. + + + + + Location information for the caller. + + - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. + Location information for the caller. - - - + - Logs a formatted message string with the level. + String representation of the user - A String containing zero or more format items - An Object to format - An Object to format - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. + String representation of the user's windows name, + like DOMAIN\username + + + + + String representation of the identity. + + - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. + String representation of the current thread's principal identity. - - - + - Logs a formatted message string with the level. + The string representation of the exception - A String containing zero or more format items - An Object to format - An Object to format - An Object to format - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. + The string representation of the exception - - - + - Logs a formatted message string with the level. + String representation of the AppDomain. - An that supplies culture-specific formatting information - A String containing zero or more format items - An Object array containing zero or more objects to format - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. + String representation of the AppDomain. + + + + + Additional event specific properties + + - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. + A logger or an appender may attach additional + properties to specific events. These properties + have a string key and an object value. - - - - Log a message object with the level. + - Log a message object with the level. + The internal representation of logging events. - This method first checks if this logger is FATAL - enabled by comparing the level of this logger with the - level. If this logger is - FATAL enabled, then it converts the message object - (passed as parameter) to a string by invoking the appropriate - . It then - proceeds to call all the registered appenders in this logger - and also higher in the hierarchy depending on the value of the - additivity flag. + When an affirmative decision is made to log then a + instance is created. This instance + is passed around to the different log4net components. - WARNING Note that passing an - to this method will print the name of the - but no stack trace. To print a stack trace use the - form instead. + + This class is of concern to those wishing to extend log4net. + + + Some of the values in instances of + are considered volatile, that is the values are correct at the + time the event is delivered to appenders, but will not be consistent + at any time afterwards. If an event is to be stored and then processed + at a later time these volatile values must be fixed by calling + . There is a performance penalty + for incurred by calling but it + is essential to maintaining data consistency. - The message object to log. - - + Nicko Cadell + Gert Driesen + Douglas de la Torre + Daniel Cazzulino - + - Log a message object with the level including - the stack trace of the passed - as a parameter. + Initializes a new instance of the class + from the supplied parameters. - The message object to log. - The exception to log, including its stack trace. + The declaring type of the method that is + the stack boundary into the logging system for this call. + The repository this event is logged in. + The name of the logger of this event. + The level of this event. + The message of this event. + The exception for this event. - See the form for more detailed information. + Except , and , + all fields of LoggingEvent are filled when actually needed. Call + to cache all data locally + to prevent inconsistencies. + + This method is called by the log4net framework + to create a logging event. - - - - Log a formatted message string with the level. + - Logs a formatted message string with the level. + Initializes a new instance of the class + using specific data. - A String containing zero or more format items - An Object array containing zero or more objects to format + The declaring type of the method that is + the stack boundary into the logging system for this call. + The repository this event is logged in. + Data used to initialize the logging event. + The fields in the struct that have already been fixed. - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. + This constructor is provided to allow a + to be created independently of the log4net framework. This can + be useful if you require a custom serialization scheme. - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. + Use the method to obtain an + instance of the class. + + + The parameter should be used to specify which fields in the + struct have been preset. Fields not specified in the + will be captured from the environment if requested or fixed. - - - + - Logs a formatted message string with the level. + Initializes a new instance of the class + using specific data. - A String containing zero or more format items - An Object to format + The declaring type of the method that is + the stack boundary into the logging system for this call. + The repository this event is logged in. + Data used to initialize the logging event. - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. + This constructor is provided to allow a + to be created independently of the log4net framework. This can + be useful if you require a custom serialization scheme. - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. + Use the method to obtain an + instance of the class. + + + This constructor sets this objects flags to , + this assumes that all the data relating to this event is passed in via the + parameter and no other data should be captured from the environment. - - - + - Logs a formatted message string with the level. + Initializes a new instance of the class + using specific data. - A String containing zero or more format items - An Object to format - An Object to format + Data used to initialize the logging event. - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. + This constructor is provided to allow a + to be created independently of the log4net framework. This can + be useful if you require a custom serialization scheme. - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. + Use the method to obtain an + instance of the class. + + + This constructor sets this objects flags to , + this assumes that all the data relating to this event is passed in via the + parameter and no other data should be captured from the environment. - - - + - Logs a formatted message string with the level. + Serialization constructor - A String containing zero or more format items - An Object to format - An Object to format - An Object to format + The that holds the serialized object data. + The that contains contextual information about the source or destination. - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. + Initializes a new instance of the class + with serialized data. - - - + - Logs a formatted message string with the level. + Gets the time when the current process started. - An that supplies culture-specific formatting information - A String containing zero or more format items - An Object array containing zero or more objects to format + + This is the time when this process started. + - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. + The TimeStamp is stored internally in UTC and converted to the local time zone for this computer. - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. + Tries to get the start time for the current process. + Failing that it returns the time of the first call to + this property. + + + Note that AppDomains may be loaded and unloaded within the + same process without the process terminating and therefore + without the process start time being reset. - - - + - Checks if this logger is enabled for the level. + Gets the UTC time when the current process started. - true if this logger is enabled for events, false otherwise. + This is the UTC time when this process started. - This function is intended to lessen the computational cost of - disabled log debug statements. - - For some ILog interface log, when you write: - - log.Debug("This is entry number: " + i ); - - - You incur the cost constructing the message, string construction and concatenation in - this case, regardless of whether the message is logged or not. + Tries to get the start time for the current process. + Failing that it returns the time of the first call to + this property. - If you are worried about speed (who isn't), then you should write: - - - if (log.IsDebugEnabled) - { - log.Debug("This is entry number: " + i ); - } - - - This way you will not incur the cost of parameter - construction if debugging is disabled for log. On - the other hand, if the log is debug enabled, you - will incur the cost of evaluating whether the logger is debug - enabled twice. Once in and once in - the . This is an insignificant overhead - since evaluating a logger takes about 1% of the time it - takes to actually log. This is the preferred style of logging. - - Alternatively if your logger is available statically then the is debug - enabled state can be stored in a static variable like this: - - - private static readonly bool isDebugEnabled = log.IsDebugEnabled; - - - Then when you come to log you can write: - - - if (isDebugEnabled) - { - log.Debug("This is entry number: " + i ); - } - - - This way the debug enabled state is only queried once - when the class is loaded. Using a private static readonly - variable is the most efficient because it is a run time constant - and can be heavily optimized by the JIT compiler. - - - Of course if you use a static readonly variable to - hold the enabled state of the logger then you cannot - change the enabled state at runtime to vary the logging - that is produced. You have to decide if you need absolute - speed or runtime flexibility. + Note that AppDomains may be loaded and unloaded within the + same process without the process terminating and therefore + without the process start time being reset. - - - + - Checks if this logger is enabled for the level. + Gets the of the logging event. - true if this logger is enabled for events, false otherwise. + The of the logging event. - For more information see . + + Gets the of the logging event. + - - - - + - Checks if this logger is enabled for the level. + Gets the time of the logging event. - true if this logger is enabled for events, false otherwise. + The time of the logging event. - For more information see . + + The TimeStamp is stored in UTC and converted to the local time zone for this computer. + - - - - + - Checks if this logger is enabled for the level. + Gets UTC the time of the logging event. - true if this logger is enabled for events, false otherwise. + The UTC time of the logging event. - - For more information see . - - - - - + - Checks if this logger is enabled for the level. + Gets the name of the logger that logged the event. - true if this logger is enabled for events, false otherwise. + The name of the logger that logged the event. - For more information see . + + Gets the name of the logger that logged the event. + - - - - + - Construct a new wrapper for the specified logger. + Gets the location information for this logging event. - The logger to wrap. + + The location information for this logging event. + - Construct a new wrapper for the specified logger. + The collected information is cached for future use. + + + See the class for more information on + supported frameworks and the different behavior in Debug and + Release builds. - + - Virtual method called when the configuration of the repository changes + Gets the message object used to initialize this event. - the repository holding the levels + + The message object used to initialize this event. + - Virtual method called when the configuration of the repository changes + Gets the message object used to initialize this event. + Note that this event may not have a valid message object. + If the event is serialized the message object will not + be transferred. To get the text of the message the + property must be used + not this property. + + + If there is no defined message object for this event then + null will be returned. - + - Logs a message object with the DEBUG level. + Gets the exception object used to initialize this event. - The message object to log. + + The exception object used to initialize this event. + - This method first checks if this logger is DEBUG - enabled by comparing the level of this logger with the - DEBUG level. If this logger is - DEBUG enabled, then it converts the message object - (passed as parameter) to a string by invoking the appropriate - . It then - proceeds to call all the registered appenders in this logger - and also higher in the hierarchy depending on the value of the - additivity flag. + Gets the exception object used to initialize this event. + Note that this event may not have a valid exception object. + If the event is serialized the exception object will not + be transferred. To get the text of the exception the + method must be used + not this property. - WARNING Note that passing an - to this method will print the name of the - but no stack trace. To print a stack trace use the - form instead. + If there is no defined exception object for this event then + null will be returned. - + - Logs a message object with the DEBUG level + The that this event was created in. - The message object to log. - The exception to log, including its stack trace. - Logs a message object with the DEBUG level including - the stack trace of the passed - as a parameter. - - - See the form for more detailed information. + The that this event was created in. - - + - Logs a formatted message string with the DEBUG level. + Ensure that the repository is set. - A String containing zero or more format items - An Object array containing zero or more objects to format + the value for the repository + + + + Gets the message, rendered through the . + + + The message rendered through the . + - The message is formatted using the method. See - String.Format for details of the syntax of the format string and the behavior - of the formatting. - - - The string is formatted using the - format provider. To specify a localized provider use the - method. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. + The collected information is cached for future use. - + - Logs a formatted message string with the DEBUG level. + Write the rendered message to a TextWriter - A String containing zero or more format items - An Object to format + the writer to write the message to - The message is formatted using the method. See - String.Format for details of the syntax of the format string and the behavior - of the formatting. - - - The string is formatted using the - format provider. To specify a localized provider use the - method. + Unlike the property this method + does store the message data in the internal cache. Therefore + if called only once this method should be faster than the + property, however if the message is + to be accessed multiple times then the property will be more efficient. + + + + + Gets the name of the current thread. + + + The name of the current thread, or the thread ID when + the name is not available. + + - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. + The collected information is cached for future use. - + - Logs a formatted message string with the DEBUG level. + Gets the name of the current user. - A String containing zero or more format items - An Object to format - An Object to format + + The name of the current user, or NOT AVAILABLE when the + underlying runtime has no support for retrieving the name of the + current user. + - The message is formatted using the method. See - String.Format for details of the syntax of the format string and the behavior - of the formatting. + Calls WindowsIdentity.GetCurrent().Name to get the name of + the current windows user. - The string is formatted using the - format provider. To specify a localized provider use the - method. + To improve performance, we could cache the string representation of + the name, and reuse that as long as the identity stayed constant. + Once the identity changed, we would need to re-assign and re-render + the string. - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. + However, the WindowsIdentity.GetCurrent() call seems to + return different objects every time, so the current implementation + doesn't do this type of caching. + + + Timing for these operations: + + + + Method + Results + + + WindowsIdentity.GetCurrent() + 10000 loops, 00:00:00.2031250 seconds + + + WindowsIdentity.GetCurrent().Name + 10000 loops, 00:00:08.0468750 seconds + + + + This means we could speed things up almost 40 times by caching the + value of the WindowsIdentity.GetCurrent().Name property, since + this takes (8.04-0.20) = 7.84375 seconds. - + - Logs a formatted message string with the DEBUG level. + Gets the identity of the current thread principal. - A String containing zero or more format items - An Object to format - An Object to format - An Object to format + + The string name of the identity of the current thread principal. + - The message is formatted using the method. See - String.Format for details of the syntax of the format string and the behavior - of the formatting. - - - The string is formatted using the - format provider. To specify a localized provider use the - method. + Calls System.Threading.Thread.CurrentPrincipal.Identity.Name to get + the name of the current thread principal. + + + + + Gets the AppDomain friendly name. + + + The AppDomain friendly name. + + - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. + Gets the AppDomain friendly name. - + - Logs a formatted message string with the DEBUG level. + Additional event specific properties. - An that supplies culture-specific formatting information - A String containing zero or more format items - An Object array containing zero or more objects to format + + Additional event specific properties. + - The message is formatted using the method. See - String.Format for details of the syntax of the format string and the behavior - of the formatting. + A logger or an appender may attach additional + properties to specific events. These properties + have a string key and an object value. - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. + This property is for events that have been added directly to + this event. The aggregate properties (which include these + event properties) can be retrieved using + and . + + + Once the properties have been fixed this property + returns the combined cached properties. This ensures that updates to + this property are always reflected in the underlying storage. When + returning the combined properties there may be more keys in the + Dictionary than expected. - + - Logs a message object with the INFO level. + The fixed fields in this event - The message object to log. + + The set of fields that are fixed in this event + - This method first checks if this logger is INFO - enabled by comparing the level of this logger with the - INFO level. If this logger is - INFO enabled, then it converts the message object - (passed as parameter) to a string by invoking the appropriate - . It then - proceeds to call all the registered appenders in this logger - and also higher in the hierarchy depending on the value of - the additivity flag. - - - WARNING Note that passing an - to this method will print the name of the - but no stack trace. To print a stack trace use the - form instead. + Fields will not be fixed if they have previously been fixed. + It is not possible to 'unfix' a field. - + - Logs a message object with the INFO level. + Serializes this object into the provided. - The message object to log. - The exception to log, including its stack trace. + The to populate with data. + The destination for this serialization. - Logs a message object with the INFO level including - the stack trace of the - passed as a parameter. + The data in this event must be fixed before it can be serialized. - See the form for more detailed information. + The method must be called during the + method call if this event + is to be used outside that method. - - + - Logs a formatted message string with the INFO level. + Gets the portable data for this . - A String containing zero or more format items - An Object array containing zero or more objects to format + The for this event. - The message is formatted using the method. See - String.Format for details of the syntax of the format string and the behavior - of the formatting. - - - The string is formatted using the - format provider. To specify a localized provider use the - method. + A new can be constructed using a + instance. - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. + Does a fix of the data + in the logging event before returning the event data. - + - Logs a formatted message string with the INFO level. + Gets the portable data for this . - A String containing zero or more format items - An Object to format + The set of data to ensure is fixed in the LoggingEventData + The for this event. - The message is formatted using the method. See - String.Format for details of the syntax of the format string and the behavior - of the formatting. + A new can be constructed using a + instance. + + + + + Returns this event's exception's rendered using the + . + + + This event's exception's rendered using the . + + - The string is formatted using the - format provider. To specify a localized provider use the - method. + Obsolete. Use instead. + + + + + Returns this event's exception's rendered using the + . + + + This event's exception's rendered using the . + + - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. + Returns this event's exception's rendered using the + . - + - Logs a formatted message string with the INFO level. + Fix instance fields that hold volatile data. - A String containing zero or more format items - An Object to format - An Object to format - The message is formatted using the method. See - String.Format for details of the syntax of the format string and the behavior - of the formatting. + Some of the values in instances of + are considered volatile, that is the values are correct at the + time the event is delivered to appenders, but will not be consistent + at any time afterwards. If an event is to be stored and then processed + at a later time these volatile values must be fixed by calling + . There is a performance penalty + incurred by calling but it + is essential to maintaining data consistency. - The string is formatted using the - format provider. To specify a localized provider use the - method. + Calling is equivalent to + calling passing the parameter + false. - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. + See for more + information. - + - Logs a formatted message string with the INFO level. + Fixes instance fields that hold volatile data. - A String containing zero or more format items - An Object to format - An Object to format - An Object to format + Set to true to not fix data that takes a long time to fix. - The message is formatted using the method. See - String.Format for details of the syntax of the format string and the behavior - of the formatting. + Some of the values in instances of + are considered volatile, that is the values are correct at the + time the event is delivered to appenders, but will not be consistent + at any time afterwards. If an event is to be stored and then processed + at a later time these volatile values must be fixed by calling + . There is a performance penalty + for incurred by calling but it + is essential to maintaining data consistency. - The string is formatted using the - format provider. To specify a localized provider use the - method. + The param controls the data that + is fixed. Some of the data that can be fixed takes a long time to + generate, therefore if you do not require those settings to be fixed + they can be ignored by setting the param + to true. This setting will ignore the + and settings. - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. + Set to false to ensure that all + settings are fixed. - + - Logs a formatted message string with the INFO level. + Fix the fields specified by the parameter - An that supplies culture-specific formatting information - A String containing zero or more format items - An Object array containing zero or more objects to format + the fields to fix - The message is formatted using the method. See - String.Format for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. + Only fields specified in the will be fixed. + Fields will not be fixed if they have previously been fixed. + It is not possible to 'unfix' a field. - + - Logs a message object with the WARN level. + Lookup a composite property in this event - the message object to log + the key for the property to lookup + the value for the property - This method first checks if this logger is WARN - enabled by comparing the level of this logger with the - WARN level. If this logger is - WARN enabled, then it converts the message object - (passed as parameter) to a string by invoking the appropriate - . It then - proceeds to call all the registered appenders in this logger and - also higher in the hierarchy depending on the value of the - additivity flag. - - - WARNING Note that passing an to this - method will print the name of the but no - stack trace. To print a stack trace use the - form instead. + This event has composite properties that combine together properties from + several different contexts in the following order: + + + this events properties + + This event has that can be set. These + properties are specific to this event only. + + + + the thread properties + + The that are set on the current + thread. These properties are shared by all events logged on this thread. + + + + the global properties + + The that are set globally. These + properties are shared by all the threads in the AppDomain. + + + - + - Logs a message object with the WARN level + Get all the composite properties in this event - The message object to log. - The exception to log, including its stack trace. + the containing all the properties - Logs a message object with the WARN level including - the stack trace of the - passed as a parameter. + See for details of the composite properties + stored by the event. - See the form for more detailed information. + This method returns a single containing all the + properties defined for this event. - - + - Logs a formatted message string with the WARN level. + The internal logging event data. - A String containing zero or more format items - An Object array containing zero or more objects to format - - - The message is formatted using the method. See - String.Format for details of the syntax of the format string and the behavior - of the formatting. - - - The string is formatted using the - format provider. To specify a localized provider use the - method. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - + - Logs a formatted message string with the WARN level. + The internal logging event data. - A String containing zero or more format items - An Object to format - - - The message is formatted using the method. See - String.Format for details of the syntax of the format string and the behavior - of the formatting. - - - The string is formatted using the - format provider. To specify a localized provider use the - method. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - + - Logs a formatted message string with the WARN level. + The internal logging event data. - A String containing zero or more format items - An Object to format - An Object to format - - - The message is formatted using the method. See - String.Format for details of the syntax of the format string and the behavior - of the formatting. - - - The string is formatted using the - format provider. To specify a localized provider use the - method. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - + - Logs a formatted message string with the WARN level. + The fully qualified Type of the calling + logger class in the stack frame (i.e. the declaring type of the method). + + + + + The application supplied message of logging event. + + + + + The exception that was thrown. - A String containing zero or more format items - An Object to format - An Object to format - An Object to format - - The message is formatted using the method. See - String.Format for details of the syntax of the format string and the behavior - of the formatting. - - - The string is formatted using the - format provider. To specify a localized provider use the - method. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - + This is not serialized. The string representation + is serialized instead. - + - Logs a formatted message string with the WARN level. + The repository that generated the logging event - An that supplies culture-specific formatting information - A String containing zero or more format items - An Object array containing zero or more objects to format - - The message is formatted using the method. See - String.Format for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - + This is not serialized. - + - Logs a message object with the ERROR level. + The fix state for this event - The message object to log. - - This method first checks if this logger is ERROR - enabled by comparing the level of this logger with the - ERROR level. If this logger is - ERROR enabled, then it converts the message object - (passed as parameter) to a string by invoking the appropriate - . It then - proceeds to call all the registered appenders in this logger and - also higher in the hierarchy depending on the value of the - additivity flag. - - - WARNING Note that passing an to this - method will print the name of the but no - stack trace. To print a stack trace use the - form instead. - + These flags indicate which fields have been fixed. + Not serialized. - + - Logs a message object with the ERROR level + Indicated that the internal cache is updateable (ie not fixed) - The message object to log. - The exception to log, including its stack trace. - - Logs a message object with the ERROR level including - the stack trace of the - passed as a parameter. - - - See the form for more detailed information. - + This is a seperate flag to m_fixFlags as it allows incrementel fixing and simpler + changes in the caching strategy. - - + - Logs a formatted message string with the ERROR level. + The key into the Properties map for the host name value. + + + + + The key into the Properties map for the thread identity value. + + + + + The key into the Properties map for the user name value. + + + + + Implementation of wrapper interface. - A String containing zero or more format items - An Object array containing zero or more objects to format - The message is formatted using the method. See - String.Format for details of the syntax of the format string and the behavior - of the formatting. + This implementation of the interface + forwards to the held by the base class. - The string is formatted using the + This logger has methods to allow the caller to log at the following + levels: + + + + DEBUG + + The and methods log messages + at the DEBUG level. That is the level with that name defined in the + repositories . The default value + for this level is . The + property tests if this level is enabled for logging. + + + + INFO + + The and methods log messages + at the INFO level. That is the level with that name defined in the + repositories . The default value + for this level is . The + property tests if this level is enabled for logging. + + + + WARN + + The and methods log messages + at the WARN level. That is the level with that name defined in the + repositories . The default value + for this level is . The + property tests if this level is enabled for logging. + + + + ERROR + + The and methods log messages + at the ERROR level. That is the level with that name defined in the + repositories . The default value + for this level is . The + property tests if this level is enabled for logging. + + + + FATAL + + The and methods log messages + at the FATAL level. That is the level with that name defined in the + repositories . The default value + for this level is . The + property tests if this level is enabled for logging. + + + + + The values for these levels and their semantic meanings can be changed by + configuring the for the repository. + + + Nicko Cadell + Gert Driesen + + + + Construct a new wrapper for the specified logger. + + The logger to wrap. + + + Construct a new wrapper for the specified logger. + + + + + + Virtual method called when the configuration of the repository changes + + the repository holding the levels + + + Virtual method called when the configuration of the repository changes + + + + + + Logs a message object with the DEBUG level. + + The message object to log. + + + This method first checks if this logger is DEBUG + enabled by comparing the level of this logger with the + DEBUG level. If this logger is + DEBUG enabled, then it converts the message object + (passed as parameter) to a string by invoking the appropriate + . It then + proceeds to call all the registered appenders in this logger + and also higher in the hierarchy depending on the value of the + additivity flag. + + + WARNING Note that passing an + to this method will print the name of the + but no stack trace. To print a stack trace use the + form instead. + + + + + + Logs a message object with the DEBUG level + + The message object to log. + The exception to log, including its stack trace. + + + Logs a message object with the DEBUG level including + the stack trace of the passed + as a parameter. + + + See the form for more detailed information. + + + + + + + Logs a formatted message string with the DEBUG level. + + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the format provider. To specify a localized provider use the - method. + method. This method does not take an object to include in the - log event. To pass an use one of the + log event. To pass an use one of the methods instead. - + - Logs a formatted message string with the ERROR level. + Logs a formatted message string with the DEBUG level. A String containing zero or more format items An Object to format @@ -15392,18 +13998,18 @@ The string is formatted using the format provider. To specify a localized provider use the - method. + method. This method does not take an object to include in the - log event. To pass an use one of the + log event. To pass an use one of the methods instead. - + - Logs a formatted message string with the ERROR level. + Logs a formatted message string with the DEBUG level. A String containing zero or more format items An Object to format @@ -15417,18 +14023,18 @@ The string is formatted using the format provider. To specify a localized provider use the - method. + method. This method does not take an object to include in the - log event. To pass an use one of the + log event. To pass an use one of the methods instead. - + - Logs a formatted message string with the ERROR level. + Logs a formatted message string with the DEBUG level. A String containing zero or more format items An Object to format @@ -15443,18 +14049,18 @@ The string is formatted using the format provider. To specify a localized provider use the - method. + method. This method does not take an object to include in the - log event. To pass an use one of the + log event. To pass an use one of the methods instead. - + - Logs a formatted message string with the ERROR level. + Logs a formatted message string with the DEBUG level. An that supplies culture-specific formatting information A String containing zero or more format items @@ -15467,57 +14073,57 @@ This method does not take an object to include in the - log event. To pass an use one of the + log event. To pass an use one of the methods instead. - + - Logs a message object with the FATAL level. + Logs a message object with the INFO level. The message object to log. - This method first checks if this logger is FATAL + This method first checks if this logger is INFO enabled by comparing the level of this logger with the - FATAL level. If this logger is - FATAL enabled, then it converts the message object + INFO level. If this logger is + INFO enabled, then it converts the message object (passed as parameter) to a string by invoking the appropriate . It then - proceeds to call all the registered appenders in this logger and - also higher in the hierarchy depending on the value of the - additivity flag. + proceeds to call all the registered appenders in this logger + and also higher in the hierarchy depending on the value of + the additivity flag. - WARNING Note that passing an to this - method will print the name of the but no - stack trace. To print a stack trace use the - form instead. + WARNING Note that passing an + to this method will print the name of the + but no stack trace. To print a stack trace use the + form instead. - + - Logs a message object with the FATAL level + Logs a message object with the INFO level. The message object to log. The exception to log, including its stack trace. - Logs a message object with the FATAL level including + Logs a message object with the INFO level including the stack trace of the passed as a parameter. - See the form for more detailed information. + See the form for more detailed information. - + - + - Logs a formatted message string with the FATAL level. + Logs a formatted message string with the INFO level. A String containing zero or more format items An Object array containing zero or more objects to format @@ -15530,18 +14136,18 @@ The string is formatted using the format provider. To specify a localized provider use the - method. + method. This method does not take an object to include in the - log event. To pass an use one of the + log event. To pass an use one of the methods instead. - + - Logs a formatted message string with the FATAL level. + Logs a formatted message string with the INFO level. A String containing zero or more format items An Object to format @@ -15554,18 +14160,18 @@ The string is formatted using the format provider. To specify a localized provider use the - method. + method. This method does not take an object to include in the - log event. To pass an use one of the + log event. To pass an use one of the methods instead. - + - Logs a formatted message string with the FATAL level. + Logs a formatted message string with the INFO level. A String containing zero or more format items An Object to format @@ -15579,18 +14185,18 @@ The string is formatted using the format provider. To specify a localized provider use the - method. + method. This method does not take an object to include in the - log event. To pass an use one of the + log event. To pass an use one of the methods instead. - + - Logs a formatted message string with the FATAL level. + Logs a formatted message string with the INFO level. A String containing zero or more format items An Object to format @@ -15605,18 +14211,18 @@ The string is formatted using the format provider. To specify a localized provider use the - method. + method. This method does not take an object to include in the - log event. To pass an use one of the + log event. To pass an use one of the methods instead. - + - Logs a formatted message string with the FATAL level. + Logs a formatted message string with the INFO level. An that supplies culture-specific formatting information A String containing zero or more format items @@ -15629,728 +14235,1169 @@ This method does not take an object to include in the - log event. To pass an use one of the + log event. To pass an use one of the methods instead. - + - Event handler for the event - - the repository - Empty - - - - The fully qualified name of this declaring type not the type of any subclass. + Logs a message object with the WARN level. + the message object to log + + + This method first checks if this logger is WARN + enabled by comparing the level of this logger with the + WARN level. If this logger is + WARN enabled, then it converts the message object + (passed as parameter) to a string by invoking the appropriate + . It then + proceeds to call all the registered appenders in this logger and + also higher in the hierarchy depending on the value of the + additivity flag. + + + WARNING Note that passing an to this + method will print the name of the but no + stack trace. To print a stack trace use the + form instead. + + - + - Checks if this logger is enabled for the DEBUG - level. + Logs a message object with the WARN level - - true if this logger is enabled for DEBUG events, - false otherwise. - + The message object to log. + The exception to log, including its stack trace. - This function is intended to lessen the computational cost of - disabled log debug statements. + Logs a message object with the WARN level including + the stack trace of the + passed as a parameter. - For some log Logger object, when you write: + See the form for more detailed information. - - log.Debug("This is entry number: " + i ); - + + + + + + Logs a formatted message string with the WARN level. + + A String containing zero or more format items + An Object array containing zero or more objects to format + - You incur the cost constructing the message, concatenation in - this case, regardless of whether the message is logged or not. + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. - If you are worried about speed, then you should write: + The string is formatted using the + format provider. To specify a localized provider use the + method. - - if (log.IsDebugEnabled()) - { - log.Debug("This is entry number: " + i ); - } - - This way you will not incur the cost of parameter - construction if debugging is disabled for log. On - the other hand, if the log is debug enabled, you - will incur the cost of evaluating whether the logger is debug - enabled twice. Once in IsDebugEnabled and once in - the Debug. This is an insignificant overhead - since evaluating a logger takes about 1% of the time it - takes to actually log. + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. - + - Checks if this logger is enabled for the INFO level. + Logs a formatted message string with the WARN level. - - true if this logger is enabled for INFO events, - false otherwise. - + A String containing zero or more format items + An Object to format - See for more information and examples - of using this method. + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. - - + - Checks if this logger is enabled for the WARN level. + Logs a formatted message string with the WARN level. - - true if this logger is enabled for WARN events, - false otherwise. - + A String containing zero or more format items + An Object to format + An Object to format - See for more information and examples - of using this method. + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. - - + - Checks if this logger is enabled for the ERROR level. + Logs a formatted message string with the WARN level. - - true if this logger is enabled for ERROR events, - false otherwise. - + A String containing zero or more format items + An Object to format + An Object to format + An Object to format - See for more information and examples of using this method. + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. - - + - Checks if this logger is enabled for the FATAL level. + Logs a formatted message string with the WARN level. - - true if this logger is enabled for FATAL events, - false otherwise. - + An that supplies culture-specific formatting information + A String containing zero or more format items + An Object array containing zero or more objects to format - See for more information and examples of using this method. + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. - - + - provides method information without actually referencing a System.Reflection.MethodBase - as that would require that the containing assembly is loaded. + Logs a message object with the ERROR level. - + The message object to log. + + + This method first checks if this logger is ERROR + enabled by comparing the level of this logger with the + ERROR level. If this logger is + ERROR enabled, then it converts the message object + (passed as parameter) to a string by invoking the appropriate + . It then + proceeds to call all the registered appenders in this logger and + also higher in the hierarchy depending on the value of the + additivity flag. + + + WARNING Note that passing an to this + method will print the name of the but no + stack trace. To print a stack trace use the + form instead. + + - + - When location information is not available the constant - NA is returned. Current value of this string - constant is ?. + Logs a message object with the ERROR level + The message object to log. + The exception to log, including its stack trace. + + + Logs a message object with the ERROR level including + the stack trace of the + passed as a parameter. + + + See the form for more detailed information. + + + - + - constructs a method item for an unknown method. + Logs a formatted message string with the ERROR level. + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + - + - constructs a method item from the name of the method. - - - - - - constructs a method item from the name of the method and its parameters. - - - - - - - constructs a method item from a method base by determining the method name and its parameters. - - - - - - The fully qualified type of the StackFrameItem class. + Logs a formatted message string with the ERROR level. + A String containing zero or more format items + An Object to format - Used by the internal logger to record the Type of the - log message. + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + - + - Gets the method name of the caller making the logging - request. + Logs a formatted message string with the ERROR level. - - The method name of the caller making the logging - request. - + A String containing zero or more format items + An Object to format + An Object to format - Gets the method name of the caller making the logging - request. + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. - + - Gets the method parameters of the caller making - the logging request. + Logs a formatted message string with the ERROR level. - - The method parameters of the caller making - the logging request - + A String containing zero or more format items + An Object to format + An Object to format + An Object to format - Gets the method parameters of the caller making - the logging request. + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. - + - A SecurityContext used by log4net when interacting with protected resources + Logs a formatted message string with the ERROR level. + An that supplies culture-specific formatting information + A String containing zero or more format items + An Object array containing zero or more objects to format - A SecurityContext used by log4net when interacting with protected resources - for example with operating system services. This can be used to impersonate - a principal that has been granted privileges on the system resources. + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. - Nicko Cadell - + - Impersonate this SecurityContext + Logs a message object with the FATAL level. - State supplied by the caller - An instance that will - revoke the impersonation of this SecurityContext, or null + The message object to log. - Impersonate this security context. Further calls on the current - thread should now be made in the security context provided - by this object. When the result - method is called the security - context of the thread should be reverted to the state it was in - before was called. + This method first checks if this logger is FATAL + enabled by comparing the level of this logger with the + FATAL level. If this logger is + FATAL enabled, then it converts the message object + (passed as parameter) to a string by invoking the appropriate + . It then + proceeds to call all the registered appenders in this logger and + also higher in the hierarchy depending on the value of the + additivity flag. + + + WARNING Note that passing an to this + method will print the name of the but no + stack trace. To print a stack trace use the + form instead. - + - The providers default instances. + Logs a message object with the FATAL level + The message object to log. + The exception to log, including its stack trace. - A configured component that interacts with potentially protected system - resources uses a to provide the elevated - privileges required. If the object has - been not been explicitly provided to the component then the component - will request one from this . - - - By default the is - an instance of which returns only - objects. This is a reasonable default - where the privileges required are not know by the system. - - - This default behavior can be overridden by subclassing the - and overriding the method to return - the desired objects. The default provider - can be replaced by programmatically setting the value of the - property. + Logs a message object with the FATAL level including + the stack trace of the + passed as a parameter. - An alternative is to use the log4net.Config.SecurityContextProviderAttribute - This attribute can be applied to an assembly in the same way as the - log4net.Config.XmlConfiguratorAttribute". The attribute takes - the type to use as the as an argument. + See the form for more detailed information. - Nicko Cadell - - - - The default provider - + - + - Protected default constructor to allow subclassing + Logs a formatted message string with the FATAL level. + A String containing zero or more format items + An Object array containing zero or more objects to format - Protected default constructor to allow subclassing + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. - + - Create a SecurityContext for a consumer + Logs a formatted message string with the FATAL level. - The consumer requesting the SecurityContext - An impersonation context + A String containing zero or more format items + An Object to format - The default implementation is to return a . + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. - Subclasses should override this method to provide their own - behavior. + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. - + - Gets or sets the default SecurityContextProvider + Logs a formatted message string with the FATAL level. - - The default SecurityContextProvider - + A String containing zero or more format items + An Object to format + An Object to format - The default provider is used by configured components that - require a and have not had one - given to them. + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. - By default this is an instance of - that returns objects. + The string is formatted using the + format provider. To specify a localized provider use the + method. - The default provider can be set programmatically by setting - the value of this property to a sub class of - that has the desired behavior. + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. - + - provides stack frame information without actually referencing a System.Diagnostics.StackFrame - as that would require that the containing assembly is loaded. + Logs a formatted message string with the FATAL level. - - - - - When location information is not available the constant - NA is returned. Current value of this string - constant is ?. - - - - - returns a stack frame item from a stack frame. This - - - + A String containing zero or more format items + An Object to format + An Object to format + An Object to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + - + - The fully qualified type of the StackFrameItem class. + Logs a formatted message string with the FATAL level. + An that supplies culture-specific formatting information + A String containing zero or more format items + An Object array containing zero or more objects to format - Used by the internal logger to record the Type of the - log message. + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + - + - Gets the fully qualified class name of the caller making the logging - request. + Checks if this logger is enabled for the DEBUG + level. - The fully qualified class name of the caller making the logging - request. + true if this logger is enabled for DEBUG events, + false otherwise. - Gets the fully qualified class name of the caller making the logging - request. + This function is intended to lessen the computational cost of + disabled log debug statements. + + + For some log Logger object, when you write: + + + log.Debug("This is entry number: " + i ); + + + You incur the cost constructing the message, concatenation in + this case, regardless of whether the message is logged or not. + + + If you are worried about speed, then you should write: + + + if (log.IsDebugEnabled()) + { + log.Debug("This is entry number: " + i ); + } + + + This way you will not incur the cost of parameter + construction if debugging is disabled for log. On + the other hand, if the log is debug enabled, you + will incur the cost of evaluating whether the logger is debug + enabled twice. Once in IsDebugEnabled and once in + the Debug. This is an insignificant overhead + since evaluating a logger takes about 1% of the time it + takes to actually log. - + - Gets the file name of the caller. + Checks if this logger is enabled for the INFO level. - The file name of the caller. + true if this logger is enabled for INFO events, + false otherwise. - Gets the file name of the caller. + See for more information and examples + of using this method. + - + - Gets the line number of the caller. + Checks if this logger is enabled for the WARN level. - The line number of the caller. + true if this logger is enabled for WARN events, + false otherwise. - Gets the line number of the caller. + See for more information and examples + of using this method. + - + - Gets the method name of the caller. + Checks if this logger is enabled for the ERROR level. - The method name of the caller. + true if this logger is enabled for ERROR events, + false otherwise. - Gets the method name of the caller. + See for more information and examples of using this method. + - + - Gets all available caller information + Checks if this logger is enabled for the FATAL level. - All available caller information, in the format - fully.qualified.classname.of.caller.methodName(Filename:line) + true if this logger is enabled for FATAL events, + false otherwise. - Gets all available caller information, in the format - fully.qualified.classname.of.caller.methodName(Filename:line) + See for more information and examples of using this method. + - + - An evaluator that triggers after specified number of seconds. + Event handler for the event - - - This evaluator will trigger if the specified time period - has passed since last check. - - - Robert Sevcik + the repository + Empty - + - The default time threshold for triggering in seconds. Zero means it won't trigger at all. + The fully qualified name of this declaring type not the type of any subclass. - + - The time threshold for triggering in seconds. Zero means it won't trigger at all. + provides method information without actually referencing a System.Reflection.MethodBase + as that would require that the containing assembly is loaded. + - + - The UTC time of last check. This gets updated when the object is created and when the evaluator triggers. + constructs a method item for an unknown method. - + - Create a new evaluator using the time threshold in seconds. + constructs a method item from the name of the method. - - - Create a new evaluator using the time threshold in seconds. - - - This evaluator will trigger if the specified time period - has passed since last check. - - + - + - Create a new evaluator using the specified time threshold in seconds. + constructs a method item from the name of the method and its parameters. - - The time threshold in seconds to trigger after. - Zero means it won't trigger at all. - - - - Create a new evaluator using the specified time threshold in seconds. - - - This evaluator will trigger if the specified time period - has passed since last check. - - + + - + - Is this the triggering event? + constructs a method item from a method base by determining the method name and its parameters. - The event to check - This method returns true, if the specified time period - has passed since last check.. - Otherwise it returns false + + + + + Gets the method name of the caller making the logging + request. + + + The method name of the caller making the logging + request. + - This evaluator will trigger if the specified time period - has passed since last check. + Gets the method name of the caller making the logging + request. - + - The time threshold in seconds to trigger after + Gets the method parameters of the caller making + the logging request. - The time threshold in seconds to trigger after. - Zero means it won't trigger at all. + The method parameters of the caller making + the logging request - This evaluator will trigger if the specified time period - has passed since last check. + Gets the method parameters of the caller making + the logging request. - + - Delegate used to handle creation of new wrappers. + The fully qualified type of the StackFrameItem class. - The logger to wrap in a wrapper. - - Delegate used to handle creation of new wrappers. This delegate - is called from the - method to construct the wrapper for the specified logger. - - - The delegate to use is supplied to the - constructor. - + Used by the internal logger to record the Type of the + log message. - + - Maps between logger objects and wrapper objects. + When location information is not available the constant + NA is returned. Current value of this string + constant is ?. - - - This class maintains a mapping between objects and - objects. Use the method to - lookup the for the specified . - + + + + A SecurityContext used by log4net when interacting with protected resources + + - New wrapper instances are created by the - method. The default behavior is for this method to delegate construction - of the wrapper to the delegate supplied - to the constructor. This allows specialization of the behavior without - requiring subclassing of this type. + A SecurityContext used by log4net when interacting with protected resources + for example with operating system services. This can be used to impersonate + a principal that has been granted privileges on the system resources. Nicko Cadell - Gert Driesen - + - Initializes a new instance of the + Impersonate this SecurityContext - The handler to use to create the wrapper objects. + State supplied by the caller + An instance that will + revoke the impersonation of this SecurityContext, or null - Initializes a new instance of the class with - the specified handler to create the wrapper objects. + Impersonate this security context. Further calls on the current + thread should now be made in the security context provided + by this object. When the result + method is called the security + context of the thread should be reverted to the state it was in + before was called. - + - Gets the wrapper object for the specified logger. + The providers default instances. - The wrapper object for the specified logger - If the logger is null then the corresponding wrapper is null. + A configured component that interacts with potentially protected system + resources uses a to provide the elevated + privileges required. If the object has + been not been explicitly provided to the component then the component + will request one from this . - Looks up the wrapper it it has previously been requested and - returns it. If the wrapper has never been requested before then - the virtual method is - called. + By default the is + an instance of which returns only + objects. This is a reasonable default + where the privileges required are not know by the system. + + + This default behavior can be overridden by subclassing the + and overriding the method to return + the desired objects. The default provider + can be replaced by programmatically setting the value of the + property. + + + An alternative is to use the log4net.Config.SecurityContextProviderAttribute + This attribute can be applied to an assembly in the same way as the + log4net.Config.XmlConfiguratorAttribute". The attribute takes + the type to use as the as an argument. + Nicko Cadell - + - Creates the wrapper object for the specified logger. + The default provider - The logger to wrap in a wrapper. - The wrapper object for the logger. + + + + Gets or sets the default SecurityContextProvider + + + The default SecurityContextProvider + - This implementation uses the - passed to the constructor to create the wrapper. This method - can be overridden in a subclass. + The default provider is used by configured components that + require a and have not had one + given to them. + + + By default this is an instance of + that returns objects. + + + The default provider can be set programmatically by setting + the value of this property to a sub class of + that has the desired behavior. - + - Called when a monitored repository shutdown event is received. + Protected default constructor to allow subclassing - The that is shutting down - This method is called when a that this - is holding loggers for has signaled its shutdown - event . The default - behavior of this method is to release the references to the loggers - and their wrappers generated for this repository. + Protected default constructor to allow subclassing - + - Event handler for repository shutdown event. + Create a SecurityContext for a consumer - The sender of the event. - The event args. + The consumer requesting the SecurityContext + An impersonation context + + + The default implementation is to return a . + + + Subclasses should override this method to provide their own + behavior. + + - + - Map of logger repositories to hashtables of ILogger to ILoggerWrapper mappings + provides stack frame information without actually referencing a System.Diagnostics.StackFrame + as that would require that the containing assembly is loaded. + - + - The handler to use to create the extension wrapper objects. + returns a stack frame item from a stack frame. This + + - + - Internal reference to the delegate used to register for repository shutdown events. + Gets the fully qualified class name of the caller making the logging + request. + + The fully qualified class name of the caller making the logging + request. + + + + Gets the fully qualified class name of the caller making the logging + request. + + - + - Gets the map of logger repositories. + Gets the file name of the caller. - Map of logger repositories. + The file name of the caller. - Gets the hashtable that is keyed on . The - values are hashtables keyed on with the - value being the corresponding . + Gets the file name of the caller. - + - Formats a as "HH:mm:ss,fff". + Gets the line number of the caller. + + The line number of the caller. + - Formats a in the format "HH:mm:ss,fff" for example, "15:49:37,459". + Gets the line number of the caller. - Nicko Cadell - Gert Driesen - + - Render a as a string. + Gets the method name of the caller. + + The method name of the caller. + - Interface to abstract the rendering of a - instance into a string. + Gets the method name of the caller. + + + + + Gets all available caller information + + + All available caller information, in the format + fully.qualified.classname.of.caller.methodName(Filename:line) + + - The method is used to render the - date to a text writer. + Gets all available caller information, in the format + fully.qualified.classname.of.caller.methodName(Filename:line) - Nicko Cadell - Gert Driesen - + - Formats the specified date as a string. + The fully qualified type of the StackFrameItem class. + + + Used by the internal logger to record the Type of the + log message. + + + + + When location information is not available the constant + NA is returned. Current value of this string + constant is ?. + + + + + An evaluator that triggers after specified number of seconds. - The date to format. - The writer to write to. - Format the as a string and write it - to the provided. + This evaluator will trigger if the specified time period + has passed since last check. + Robert Sevcik - + - String constant used to specify AbsoluteTimeDateFormat in layouts. Current value is ABSOLUTE. + The time threshold for triggering in seconds. Zero means it won't trigger at all. - + - String constant used to specify DateTimeDateFormat in layouts. Current value is DATE. + The UTC time of last check. This gets updated when the object is created and when the evaluator triggers. - + - String constant used to specify ISO8601DateFormat in layouts. Current value is ISO8601. + The default time threshold for triggering in seconds. Zero means it won't trigger at all. - + - Renders the date into a string. Format is "HH:mm:ss". + Create a new evaluator using the time threshold in seconds. - The date to render into a string. - The string builder to write to. - Subclasses should override this method to render the date - into a string using a precision up to the second. This method - will be called at most once per second and the result will be - reused if it is needed again during the same second. + Create a new evaluator using the time threshold in seconds. + + + This evaluator will trigger if the specified time period + has passed since last check. - + - Renders the date into a string. Format is "HH:mm:ss,fff". + Create a new evaluator using the specified time threshold in seconds. - The date to render into a string. + + The time threshold in seconds to trigger after. + Zero means it won't trigger at all. + + + + Create a new evaluator using the specified time threshold in seconds. + + + This evaluator will trigger if the specified time period + has passed since last check. + + + + + + The time threshold in seconds to trigger after + + + The time threshold in seconds to trigger after. + Zero means it won't trigger at all. + + + + This evaluator will trigger if the specified time period + has passed since last check. + + + + + + Is this the triggering event? + + The event to check + This method returns true, if the specified time period + has passed since last check.. + Otherwise it returns false + + + This evaluator will trigger if the specified time period + has passed since last check. + + + + + + Delegate used to handle creation of new wrappers. + + The logger to wrap in a wrapper. + + + Delegate used to handle creation of new wrappers. This delegate + is called from the + method to construct the wrapper for the specified logger. + + + The delegate to use is supplied to the + constructor. + + + + + + Maps between logger objects and wrapper objects. + + + + This class maintains a mapping between objects and + objects. Use the method to + lookup the for the specified . + + + New wrapper instances are created by the + method. The default behavior is for this method to delegate construction + of the wrapper to the delegate supplied + to the constructor. This allows specialization of the behavior without + requiring subclassing of this type. + + + Nicko Cadell + Gert Driesen + + + + Initializes a new instance of the + + The handler to use to create the wrapper objects. + + + Initializes a new instance of the class with + the specified handler to create the wrapper objects. + + + + + + Gets the wrapper object for the specified logger. + + The wrapper object for the specified logger + + + If the logger is null then the corresponding wrapper is null. + + + Looks up the wrapper it it has previously been requested and + returns it. If the wrapper has never been requested before then + the virtual method is + called. + + + + + + Gets the map of logger repositories. + + + Map of logger repositories. + + + + Gets the hashtable that is keyed on . The + values are hashtables keyed on with the + value being the corresponding . + + + + + + Creates the wrapper object for the specified logger. + + The logger to wrap in a wrapper. + The wrapper object for the logger. + + + This implementation uses the + passed to the constructor to create the wrapper. This method + can be overridden in a subclass. + + + + + + Called when a monitored repository shutdown event is received. + + The that is shutting down + + + This method is called when a that this + is holding loggers for has signaled its shutdown + event . The default + behavior of this method is to release the references to the loggers + and their wrappers generated for this repository. + + + + + + Event handler for repository shutdown event. + + The sender of the event. + The event args. + + + + Map of logger repositories to hashtables of ILogger to ILoggerWrapper mappings + + + + + The handler to use to create the extension wrapper objects. + + + + + Internal reference to the delegate used to register for repository shutdown events. + + + + + Formats a as "HH:mm:ss,fff". + + + + Formats a in the format "HH:mm:ss,fff" for example, "15:49:37,459". + + + Nicko Cadell + Gert Driesen + + + + Renders the date into a string. Format is "HH:mm:ss". + + The date to render into a string. + The string builder to write to. + + + Subclasses should override this method to render the date + into a string using a precision up to the second. This method + will be called at most once per second and the result will be + reused if it is needed again during the same second. + + + + + + Renders the date into a string. Format is "HH:mm:ss,fff". + + The date to render into a string. The writer to write to. @@ -16366,6 +15413,21 @@ + + + String constant used to specify AbsoluteTimeDateFormat in layouts. Current value is ABSOLUTE. + + + + + String constant used to specify DateTimeDateFormat in layouts. Current value is DATE. + + + + + String constant used to specify ISO8601DateFormat in layouts. Current value is ISO8601. + + Last stored time with precision up to the second. @@ -16404,7 +15466,7 @@ - Initializes a new instance of the class. + Initializes a new instance of the class. @@ -16430,6 +15492,36 @@ The format info for the invariant culture.
+ + + Render a as a string. + + + + Interface to abstract the rendering of a + instance into a string. + + + The method is used to render the + date to a text writer. + + + Nicko Cadell + Gert Driesen + + + + Formats the specified date as a string. + + The date to format. + The writer to write to. + + + Format the as a string and write it + to the provided. + + + Formats the as "yyyy-MM-dd HH:mm:ss,fff". @@ -16448,7 +15540,7 @@ - Initializes a new instance of the class. + Initializes a new instance of the class. @@ -16487,7 +15579,7 @@ The format string. - Initializes a new instance of the class + Initializes a new instance of the class with the specified format string. @@ -16511,7 +15603,7 @@
- The format string used to format the . + The format string used to format the . @@ -16535,59 +15627,62 @@ Nicko Cadell Gert Driesen - + - Subclass this type to implement customized logging event filtering + Default constructor + + + + Always returns the integer constant + + the LoggingEvent to filter + Always returns - Users should extend this class to implement customized logging - event filtering. Note that and - , the parent class of all standard - appenders, have built-in filtering rules. It is suggested that you - first use and understand the built-in rules before rushing to write - your own custom filters. - - - This abstract class assumes and also imposes that filters be - organized in a linear chain. The - method of each filter is called sequentially, in the order of their - addition to the chain. - - - The method must return one - of the integer constants , - or . - - - If the value is returned, then the log event is dropped - immediately without consulting with the remaining filters. - - - If the value is returned, then the next filter - in the chain is consulted. If there are no more filters in the - chain, then the log event is logged. Thus, in the presence of no - filters, the default behavior is to log all logging events. - - - If the value is returned, then the log - event is logged without consulting the remaining filters. + Ignores the event being logged and just returns + . This can be used to change the default filter + chain behavior from to . This filter + should only be used as the last filter in the chain + as any further filters will be ignored! + + + + + The return result from + + - The philosophy of log4net filters is largely inspired from the - Linux ipchains. + The return result from - Nicko Cadell - Gert Driesen - + - Implement this interface to provide customized logging event filtering + The log event must be dropped immediately without + consulting with the remaining filters, if any, in the chain. + + + + + This filter is neutral with respect to the log event. + The remaining filters, if any, should be consulted for a final decision. + + + + + The log event must be logged immediately without + consulting with the remaining filters, if any, in the chain. + + + + + Subclass this type to implement customized logging event filtering - Users should implement this interface to implement customized logging + Users should extend this class to implement customized logging event filtering. Note that and , the parent class of all standard appenders, have built-in filtering rules. It is suggested that you @@ -16596,12 +15691,12 @@ This abstract class assumes and also imposes that filters be - organized in a linear chain. The + organized in a linear chain. The method of each filter is called sequentially, in the order of their addition to the chain. - The method must return one + The method must return one of the integer constants , or . @@ -16627,36 +15722,6 @@ Nicko Cadell Gert Driesen - - - Decide if the logging event should be logged through an appender. - - The LoggingEvent to decide upon - The decision of the filter - - - If the decision is , then the event will be - dropped. If the decision is , then the next - filter, if any, will be invoked. If the decision is then - the event will be logged without consulting with other filters in - the chain. - - - - - - Property to get and set the next filter - - - The next filter in the chain - - - - Filters are typically composed into chains. This property allows the next filter in - the chain to be accessed. - - - Points to the next filter in the filter chain. @@ -16723,54 +15788,81 @@ - - - Default constructor - - - + - Always returns the integer constant + Implement this interface to provide customized logging event filtering - the LoggingEvent to filter - Always returns - Ignores the event being logged and just returns - . This can be used to change the default filter - chain behavior from to . This filter - should only be used as the last filter in the chain - as any further filters will be ignored! + Users should implement this interface to implement customized logging + event filtering. Note that and + , the parent class of all standard + appenders, have built-in filtering rules. It is suggested that you + first use and understand the built-in rules before rushing to write + your own custom filters. + + + This abstract class assumes and also imposes that filters be + organized in a linear chain. The + method of each filter is called sequentially, in the order of their + addition to the chain. + + + The method must return one + of the integer constants , + or . + + + If the value is returned, then the log event is dropped + immediately without consulting with the remaining filters. + + + If the value is returned, then the next filter + in the chain is consulted. If there are no more filters in the + chain, then the log event is logged. Thus, in the presence of no + filters, the default behavior is to log all logging events. + + + If the value is returned, then the log + event is logged without consulting the remaining filters. + + + The philosophy of log4net filters is largely inspired from the + Linux ipchains. + Nicko Cadell + Gert Driesen - + - The return result from + Decide if the logging event should be logged through an appender. + The LoggingEvent to decide upon + The decision of the filter - The return result from + If the decision is , then the event will be + dropped. If the decision is , then the next + filter, if any, will be invoked. If the decision is then + the event will be logged without consulting with other filters in + the chain. - - - The log event must be dropped immediately without - consulting with the remaining filters, if any, in the chain. - - - - - This filter is neutral with respect to the log event. - The remaining filters, if any, should be consulted for a final decision. - - - + - The log event must be logged immediately without - consulting with the remaining filters, if any, in the chain. + Property to get and set the next filter + + The next filter in the chain + + + + Filters are typically composed into chains. This property allows the next filter in + the chain to be accessed. + + @@ -16806,23 +15898,6 @@ Default constructor - - - Tests if the of the logging event matches that of the filter - - the event to filter - see remarks - - - If the of the event matches the level of the - filter then the result of the function depends on the - value of . If it is true then - the function will return , it it is false then it - will return . If the does not match then - the result will be . - - - when matching @@ -16851,6 +15926,23 @@ + + + Tests if the of the logging event matches that of the filter + + the event to filter + see remarks + + + If the of the event matches the level of the + filter then the result of the function depends on the + value of . If it is true then + the function will return , it it is false then it + will return . If the does not match then + the result will be . + + + This is a simple filter based on matching. @@ -16889,23 +15981,6 @@ Default constructor - - - Check if the event should be logged. - - the logging event to check - see remarks - - - If the of the logging event is outside the range - matched by this filter then - is returned. If the is matched then the value of - is checked. If it is true then - is returned, otherwise - is returned. - - - when matching and @@ -16946,7 +16021,24 @@ - + + + Check if the event should be logged. + + the logging event to check + see remarks + + + If the of the logging event is outside the range + matched by this filter then + is returned. If the is matched then the value of + is checked. If it is true then + is returned, otherwise + is returned. + + + + Simple filter to match a string in the event's logger name. @@ -16978,26 +16070,6 @@ Default constructor - - - Check if this filter should allow the event to be logged - - the event being logged - see remarks - - - The rendered message is matched against the . - If the equals the beginning of - the incoming () - then a match will have occurred. If no match occurs - this function will return - allowing other filters to check the event. If a match occurs then - the value of is checked. If it is - true then is returned otherwise - is returned. - - - when matching @@ -17028,6 +16100,26 @@ + + + Check if this filter should allow the event to be logged + + the event being logged + see remarks + + + The rendered message is matched against the . + If the equals the beginning of + the incoming () + then a match will have occurred. If no match occurs + this function will return + allowing other filters to check the event. If a match occurs then + the value of is checked. If it is + true then is returned otherwise + is returned. + + + Simple filter to match a keyed string in the @@ -17044,6 +16136,33 @@ Nicko Cadell Gert Driesen + + + Simple filter to match a string in the + + + + Simple filter to match a string in the + + + As the MDC has been replaced with named stacks stored in the + properties collections the should + be used instead. + + + Nicko Cadell + Gert Driesen + + + + Default constructor + + + + Sets the to "NDC". + + + Simple filter to match a string an event property @@ -17056,6 +16175,48 @@ Nicko Cadell + + + The key to use to lookup the string from the event properties + + + + + Default constructor + + + + + The key to lookup in the event properties and then match against. + + + + The key name to use to lookup in the properties map of the + . The match will be performed against + the value of this property if it exists. + + + + + + Check if this filter should allow the event to be logged + + the event being logged + see remarks + + + The event property for the is matched against + the . + If the occurs as a substring within + the property value then a match will have occurred. If no match occurs + this function will return + allowing other filters to check the event. If a match occurs then + the value of is checked. If it is + true then is returned otherwise + is returned. + + + Simple filter to match a string in the rendered message @@ -17111,25 +16272,6 @@ - - - Check if this filter should allow the event to be logged - - the event being logged - see remarks - - - The rendered message is matched against the . - If the occurs as a substring within - the message then a match will have occurred. If no match occurs - this function will return - allowing other filters to check the event. If a match occurs then - the value of is checked. If it is - true then is returned otherwise - is returned. - - - when matching or @@ -17180,17 +16322,7 @@ - - - The key to use to lookup the string from the event properties - - - - - Default constructor - - - + Check if this filter should allow the event to be logged @@ -17198,10 +16330,9 @@ see remarks - The event property for the is matched against - the . + The rendered message is matched against the . If the occurs as a substring within - the property value then a match will have occurred. If no match occurs + the message then a match will have occurred. If no match occurs this function will return allowing other filters to check the event. If a match occurs then the value of is checked. If it is @@ -17210,1199 +16341,1457 @@ - + - The key to lookup in the event properties and then match against. + The log4net Global Context. - The key name to use to lookup in the properties map of the - . The match will be performed against - the value of this property if it exists. + The GlobalContext provides a location for global debugging + information to be stored. - - - - - Simple filter to match a string in the - - - Simple filter to match a string in the + The global context has a properties map and these properties can + be included in the output of log messages. The + supports selecting and outputing these properties. - As the MDC has been replaced with named stacks stored in the - properties collections the should - be used instead. + By default the log4net:HostName property is set to the name of + the current machine. + + + GlobalContext.Properties["hostname"] = Environment.MachineName; + + + Nicko Cadell - Gert Driesen - + - Default constructor + Private Constructor. - - Sets the to "NDC". - + Uses a private access modifier to prevent instantiation of this class. - + - Write the event appdomain name to the output + The global properties map. + + The global properties map. + - Writes the to the output writer. + The global properties map. - Daniel Cazzulino - Nicko Cadell - + - Abstract class that provides the formatting functionality that - derived classes need. + The global context properties instance - - Conversion specifiers in a conversion patterns are parsed to - individual PatternConverters. Each of which is responsible for - converting a logging event in a converter specific manner. - - Nicko Cadell - + - Abstract class that provides the formatting functionality that - derived classes need. + The ILog interface is use by application to log messages into + the log4net framework. - Conversion specifiers in a conversion patterns are parsed to - individual PatternConverters. Each of which is responsible for - converting a logging event in a converter specific manner. + Use the to obtain logger instances + that implement this interface. The + static method is used to get logger instances. - - Nicko Cadell - Gert Driesen - - - - Initial buffer size - - - - - Maximum buffer size before it is recycled - - - - - Protected constructor - - - Initializes a new instance of the class. - + This class contains methods for logging at different levels and also + has properties for determining if those logging levels are + enabled in the current configuration. + + + This interface can be implemented in different ways. This documentation + specifies reasonable behavior that a caller can expect from the actual + implementation, however different implementations reserve the right to + do things differently. + + Simple example of logging messages + + ILog log = LogManager.GetLogger("application-log"); + + log.Info("Application Start"); + log.Debug("This is a debug message"); + + if (log.IsDebugEnabled) + { + log.Debug("This is another debug message"); + } + + + + + Nicko Cadell + Gert Driesen - + + Log a message object with the level. - Evaluate this pattern converter and write the output to a writer. + Log a message object with the level. - that will receive the formatted result. - The state object on which the pattern converter should be executed. + The message object to log. - Derived pattern converters must override this method in order to - convert conversion specifiers in the appropriate way. + This method first checks if this logger is DEBUG + enabled by comparing the level of this logger with the + level. If this logger is + DEBUG enabled, then it converts the message object + (passed as parameter) to a string by invoking the appropriate + . It then + proceeds to call all the registered appenders in this logger + and also higher in the hierarchy depending on the value of + the additivity flag. + + WARNING Note that passing an + to this method will print the name of the + but no stack trace. To print a stack trace use the + form instead. + + - + - Set the next pattern converter in the chains + Log a message object with the level including + the stack trace of the passed + as a parameter. - the pattern converter that should follow this converter in the chain - the next converter + The message object to log. + The exception to log, including its stack trace. - The PatternConverter can merge with its neighbor during this method (or a sub class). - Therefore the return value may or may not be the value of the argument passed in. + See the form for more detailed information. + + - + + Log a formatted string with the level. - Write the pattern converter to the writer with appropriate formatting + Logs a formatted message string with the level. - that will receive the formatted result. - The state object on which the pattern converter should be executed. + A String containing zero or more format items + An Object array containing zero or more objects to format - This method calls to allow the subclass to perform - appropriate conversion of the pattern converter. If formatting options have - been specified via the then this method will - apply those formattings before writing the output. + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + - + - Fast space padding method. + Logs a formatted message string with the level. - to which the spaces will be appended. - The number of spaces to be padded. + A String containing zero or more format items + An Object to format - Fast space padding method. + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + - - - The option string to the converter - - - + - Write an dictionary to a + Logs a formatted message string with the level. - the writer to write to - a to use for object conversion - the value to write to the writer + A String containing zero or more format items + An Object to format + An Object to format - Writes the to a writer in the form: + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. - - {key1=value1, key2=value2, key3=value3} - - If the specified - is not null then it is used to render the key and value to text, otherwise - the object's ToString method is called. + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + - + - Write an dictionary to a + Logs a formatted message string with the level. - the writer to write to - a to use for object conversion - the value to write to the writer + A String containing zero or more format items + An Object to format + An Object to format + An Object to format - Writes the to a writer in the form: + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. - - {key1=value1, key2=value2, key3=value3} - - If the specified - is not null then it is used to render the key and value to text, otherwise - the object's ToString method is called. + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + - + - Write an object to a + Logs a formatted message string with the level. - the writer to write to - a to use for object conversion - the value to write to the writer + An that supplies culture-specific formatting information + A String containing zero or more format items + An Object array containing zero or more objects to format - Writes the Object to a writer. If the specified - is not null then it is used to render the object to text, otherwise - the object's ToString method is called. + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + - + + Log a message object with the level. - Get the next pattern converter in the chain + Logs a message object with the level. - - the next pattern converter in the chain - - Get the next pattern converter in the chain + This method first checks if this logger is INFO + enabled by comparing the level of this logger with the + level. If this logger is + INFO enabled, then it converts the message object + (passed as parameter) to a string by invoking the appropriate + . It then + proceeds to call all the registered appenders in this logger + and also higher in the hierarchy depending on the value of the + additivity flag. + + WARNING Note that passing an + to this method will print the name of the + but no stack trace. To print a stack trace use the + form instead. + The message object to log. + + - + - Gets or sets the formatting info for this converter + Logs a message object with the INFO level including + the stack trace of the passed + as a parameter. - - The formatting info for this converter - + The message object to log. + The exception to log, including its stack trace. - Gets or sets the formatting info for this converter + See the form for more detailed information. + + - - - Gets or sets the option value for this converter - + + Log a formatted message string with the level. - The option for this converter + Logs a formatted message string with the level. + A String containing zero or more format items + An Object array containing zero or more objects to format - Gets or sets the option value for this converter + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + - - - - - - + - Initializes a new instance of the class. + Logs a formatted message string with the level. - - - - Derived pattern converters must override this method in order to - convert conversion specifiers in the correct way. - - that will receive the formatted result. - The on which the pattern converter should be executed. - - - - Derived pattern converters must override this method in order to - convert conversion specifiers in the correct way. - - that will receive the formatted result. - The state object on which the pattern converter should be executed. - - - - Flag indicating if this converter handles exceptions - - - false if this converter handles exceptions - - - - - Flag indicating if this converter handles the logging event exception - - false if this converter handles the logging event exception + A String containing zero or more format items + An Object to format - If this converter handles the exception object contained within - , then this property should be set to - false. Otherwise, if the layout ignores the exception - object, then the property should be set to true. + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. - Set this value to override a this default setting. The default - value is true, this converter does not handle the exception. + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + - + - Write the event appdomain name to the output + Logs a formatted message string with the level. - that will receive the formatted result. - the event being logged + A String containing zero or more format items + An Object to format + An Object to format - Writes the to the output . + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. - - - - - Converter for items in the ASP.Net Cache. - - - Outputs an item from the . + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. - Ron Grabowski - - - - Abstract class that provides access to the current HttpContext () that - derived classes need. - - - This class handles the case when HttpContext.Current is null by writing - to the writer. - - Ron Grabowski - - - - Derived pattern converters must override this method in order to - convert conversion specifiers in the correct way. - - that will receive the formatted result. - The on which the pattern converter should be executed. - The under which the ASP.Net request is running. + + - + - Write the ASP.Net Cache item to the output + Logs a formatted message string with the level. - that will receive the formatted result. - The on which the pattern converter should be executed. - The under which the ASP.Net request is running. + A String containing zero or more format items + An Object to format + An Object to format + An Object to format - Writes out the value of a named property. The property name - should be set in the - property. If no property has been set, all key value pairs from the Cache will - be written to the output. + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. - - - - - Converter for items in the . - - - Outputs an item from the . + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. - Ron Grabowski + + - + - Write the ASP.Net HttpContext item to the output + Logs a formatted message string with the level. - that will receive the formatted result. - The on which the pattern converter should be executed. - The under which the ASP.Net request is running. + An that supplies culture-specific formatting information + A String containing zero or more format items + An Object array containing zero or more objects to format - Writes out the value of a named property. The property name - should be set in the - property. + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + - + + Log a message object with the level. - Converter for items in the ASP.Net Cache. + Log a message object with the level. - Outputs an item from the . + This method first checks if this logger is WARN + enabled by comparing the level of this logger with the + level. If this logger is + WARN enabled, then it converts the message object + (passed as parameter) to a string by invoking the appropriate + . It then + proceeds to call all the registered appenders in this logger + and also higher in the hierarchy depending on the value of the + additivity flag. + + WARNING Note that passing an + to this method will print the name of the + but no stack trace. To print a stack trace use the + form instead. - Ron Grabowski + The message object to log. + + - + - Write the ASP.Net Cache item to the output + Log a message object with the level including + the stack trace of the passed + as a parameter. - that will receive the formatted result. - The on which the pattern converter should be executed. - The under which the ASP.Net request is running. + The message object to log. + The exception to log, including its stack trace. - Writes out the value of a named property. The property name - should be set in the - property. + See the form for more detailed information. + + - + + Log a formatted message string with the level. - Converter for items in the ASP.Net Cache. + Logs a formatted message string with the level. + A String containing zero or more format items + An Object array containing zero or more objects to format - Outputs an item from the . + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. - Ron Grabowski + + - + - Write the ASP.Net Cache item to the output + Logs a formatted message string with the level. - that will receive the formatted result. - The on which the pattern converter should be executed. - The under which the ASP.Net request is running. + A String containing zero or more format items + An Object to format - Writes out the value of a named property. The property name - should be set in the - property. If no property has been set, all key value pairs from the Session will - be written to the output. + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + - + - Date pattern converter, uses a to format - the date of a . + Logs a formatted message string with the level. + A String containing zero or more format items + An Object to format + An Object to format - Render the to the writer as a string. - - - The value of the determines - the formatting of the date. The following values are allowed: - - - Option value - Output - - - ISO8601 - - Uses the formatter. - Formats using the "yyyy-MM-dd HH:mm:ss,fff" pattern. - - - - DATE - - Uses the formatter. - Formats using the "dd MMM yyyy HH:mm:ss,fff" for example, "06 Nov 1994 15:49:37,459". - - - - ABSOLUTE - - Uses the formatter. - Formats using the "HH:mm:ss,yyyy" for example, "15:49:37,459". - - - - other - - Any other pattern string uses the formatter. - This formatter passes the pattern string to the - method. - For details on valid patterns see - DateTimeFormatInfo Class. - - - + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. - The is in the local time zone and is rendered in that zone. - To output the time in Universal time see . + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. - Nicko Cadell + + - + - The used to render the date to a string + Logs a formatted message string with the level. + A String containing zero or more format items + An Object to format + An Object to format + An Object to format - The used to render the date to a string + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + - + - Initialize the converter pattern based on the property. + Logs a formatted message string with the level. + An that supplies culture-specific formatting information + A String containing zero or more format items + An Object array containing zero or more objects to format - This is part of the delayed object - activation scheme. The method must - be called on this object after the configuration properties have - been set. Until is called this - object is in an undefined state and must not be used. + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. - If any of the configuration properties are modified then - must be called again. + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + - + + Log a message object with the level. - Convert the pattern into the rendered message + Logs a message object with the level. - that will receive the formatted result. - the event being logged + The message object to log. - Pass the to the - for it to render it to the writer. + This method first checks if this logger is ERROR + enabled by comparing the level of this logger with the + level. If this logger is + ERROR enabled, then it converts the message object + (passed as parameter) to a string by invoking the appropriate + . It then + proceeds to call all the registered appenders in this logger + and also higher in the hierarchy depending on the value of the + additivity flag. - - The passed is in the local time zone. + WARNING Note that passing an + to this method will print the name of the + but no stack trace. To print a stack trace use the + form instead. + + - + - The fully qualified type of the DatePatternConverter class. + Log a message object with the level including + the stack trace of the passed + as a parameter. + The message object to log. + The exception to log, including its stack trace. - Used by the internal logger to record the Type of the - log message. + + See the form for more detailed information. + + + - + + Log a formatted message string with the level. - Write the exception text to the output + Logs a formatted message string with the level. + A String containing zero or more format items + An Object array containing zero or more objects to format - If an exception object is stored in the logging event - it will be rendered into the pattern output with a - trailing newline. + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. - If there is no exception then nothing will be output - and no trailing newline will be appended. - It is typical to put a newline before the exception - and to have the exception as the last data in the pattern. + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. - Nicko Cadell - - - - Default constructor - + + - + - Write the exception text to the output + Logs a formatted message string with the level. - that will receive the formatted result. - the event being logged + A String containing zero or more format items + An Object to format - If an exception object is stored in the logging event - it will be rendered into the pattern output with a - trailing newline. - - - If there is no exception or the exception property specified - by the Option value does not exist then nothing will be output - and no trailing newline will be appended. - It is typical to put a newline before the exception - and to have the exception as the last data in the pattern. + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. - Recognized values for the Option parameter are: + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. - - - Message - - - Source - - - StackTrace - - - TargetSite - - - HelpLink - - + + - + - Writes the caller location file name to the output + Logs a formatted message string with the level. + A String containing zero or more format items + An Object to format + An Object to format - Writes the value of the for - the event to the output writer. + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. - Nicko Cadell + + - + - Write the caller location file name to the output + Logs a formatted message string with the level. - that will receive the formatted result. - the event being logged + A String containing zero or more format items + An Object to format + An Object to format + An Object to format - Writes the value of the for - the to the output . + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + - + - Write the caller location info to the output + Logs a formatted message string with the level. + An that supplies culture-specific formatting information + A String containing zero or more format items + An Object array containing zero or more objects to format - Writes the to the output writer. + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. - Nicko Cadell + + - + + Log a message object with the level. - Write the caller location info to the output + Log a message object with the level. - that will receive the formatted result. - the event being logged - Writes the to the output writer. + This method first checks if this logger is FATAL + enabled by comparing the level of this logger with the + level. If this logger is + FATAL enabled, then it converts the message object + (passed as parameter) to a string by invoking the appropriate + . It then + proceeds to call all the registered appenders in this logger + and also higher in the hierarchy depending on the value of the + additivity flag. + + WARNING Note that passing an + to this method will print the name of the + but no stack trace. To print a stack trace use the + form instead. + The message object to log. + + - + - Writes the event identity to the output + Log a message object with the level including + the stack trace of the passed + as a parameter. + The message object to log. + The exception to log, including its stack trace. - Writes the value of the to - the output writer. + See the form for more detailed information. - Daniel Cazzulino - Nicko Cadell + + - + + Log a formatted message string with the level. - Writes the event identity to the output + Logs a formatted message string with the level. - that will receive the formatted result. - the event being logged + A String containing zero or more format items + An Object array containing zero or more objects to format - Writes the value of the - to - the output . + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + - + - Write the event level to the output + Logs a formatted message string with the level. + A String containing zero or more format items + An Object to format - Writes the display name of the event - to the writer. + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. - Nicko Cadell + + - + - Write the event level to the output + Logs a formatted message string with the level. - that will receive the formatted result. - the event being logged + A String containing zero or more format items + An Object to format + An Object to format - Writes the of the - to the . + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. - - - - - Write the caller location line number to the output - - - Writes the value of the for - the event to the output writer. + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. - Nicko Cadell + + - + - Write the caller location line number to the output + Logs a formatted message string with the level. - that will receive the formatted result. - the event being logged + A String containing zero or more format items + An Object to format + An Object to format + An Object to format - Writes the value of the for - the to the output . + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. - - - - - Converter for logger name - - - Outputs the of the event. + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. - Nicko Cadell + + - + - Converter to output and truncate '.' separated strings + Logs a formatted message string with the level. + An that supplies culture-specific formatting information + A String containing zero or more format items + An Object array containing zero or more objects to format - This abstract class supports truncating a '.' separated string - to show a specified number of elements from the right hand side. - This is used to truncate class names that are fully qualified. + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. - Subclasses should override the method to - return the fully qualified string. + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. - Nicko Cadell + + - + - Initialize the converter + Checks if this logger is enabled for the level. + + true if this logger is enabled for events, false otherwise. + - This is part of the delayed object - activation scheme. The method must - be called on this object after the configuration properties have - been set. Until is called this - object is in an undefined state and must not be used. + This function is intended to lessen the computational cost of + disabled log debug statements. + For some ILog interface log, when you write: + + log.Debug("This is entry number: " + i ); + - If any of the configuration properties are modified then - must be called again. + You incur the cost constructing the message, string construction and concatenation in + this case, regardless of whether the message is logged or not. - - - - - Get the fully qualified string data - - the event being logged - the fully qualified name - - Overridden by subclasses to get the fully qualified name before the - precision is applied to it. + If you are worried about speed (who isn't), then you should write: + + if (log.IsDebugEnabled) + { + log.Debug("This is entry number: " + i ); + } + - Return the fully qualified '.' (dot/period) separated string. + This way you will not incur the cost of parameter + construction if debugging is disabled for log. On + the other hand, if the log is debug enabled, you + will incur the cost of evaluating whether the logger is debug + enabled twice. Once in and once in + the . This is an insignificant overhead + since evaluating a logger takes about 1% of the time it + takes to actually log. This is the preferred style of logging. + + Alternatively if your logger is available statically then the is debug + enabled state can be stored in a static variable like this: + + + private static readonly bool isDebugEnabled = log.IsDebugEnabled; + + + Then when you come to log you can write: + + + if (isDebugEnabled) + { + log.Debug("This is entry number: " + i ); + } + + + This way the debug enabled state is only queried once + when the class is loaded. Using a private static readonly + variable is the most efficient because it is a run time constant + and can be heavily optimized by the JIT compiler. + + + Of course if you use a static readonly variable to + hold the enabled state of the logger then you cannot + change the enabled state at runtime to vary the logging + that is produced. You have to decide if you need absolute + speed or runtime flexibility. + + - + - Convert the pattern to the rendered message + Checks if this logger is enabled for the level. - that will receive the formatted result. - the event being logged + + true if this logger is enabled for events, false otherwise. + - Render the to the precision - specified by the property. + For more information see . + + + - + - The fully qualified type of the NamedPatternConverter class. + Checks if this logger is enabled for the level. + + true if this logger is enabled for events, false otherwise. + - Used by the internal logger to record the Type of the - log message. + For more information see . + + + - + - Gets the fully qualified name of the logger + Checks if this logger is enabled for the level. - the event being logged - The fully qualified logger name + + true if this logger is enabled for events, false otherwise. + - - Returns the of the . - + For more information see . + + + - + - Writes the event message to the output + Checks if this logger is enabled for the level. + + true if this logger is enabled for events, false otherwise. + - - Uses the method - to write out the event message. - + For more information see . - Nicko Cadell + + + - + - Writes the event message to the output + A flexible layout configurable with pattern string that re-evaluates on each call. - that will receive the formatted result. - the event being logged - - Uses the method - to write out the event message. - + This class is built on and provides all the + features and capabilities of PatternLayout. PatternLayout is a 'static' class + in that its layout is done once at configuration time. This class will recreate + the layout on each reference. + One important difference between PatternLayout and DynamicPatternLayout is the + treatment of the Header and Footer parameters in the configuration. The Header and Footer + parameters for DynamicPatternLayout must be syntactically in the form of a PatternString, + but should not be marked as type log4net.Util.PatternString. Doing so causes the + pattern to be statically converted at configuration time and causes DynamicPatternLayout + to perform the same as PatternLayout. + Please see for complete documentation. + + <layout type="log4net.Layout.DynamicPatternLayout"> + <param name="Header" value="%newline**** Trace Opened Local: %date{yyyy-MM-dd HH:mm:ss.fff} UTC: %utcdate{yyyy-MM-dd HH:mm:ss.fff} ****%newline" /> + <param name="Footer" value="**** Trace Closed %date{yyyy-MM-dd HH:mm:ss.fff} ****%newline" /> + </layout> + - + - Write the method name to the output + The header PatternString + + + + + The footer PatternString + + + + + Constructs a DynamicPatternLayout using the DefaultConversionPattern - Writes the caller location to - the output. + The default pattern just produces the application supplied message. - Nicko Cadell - + - Write the method name to the output + Constructs a DynamicPatternLayout using the supplied conversion pattern - that will receive the formatted result. - the event being logged + the pattern to use - - Writes the caller location to - the output. - - + - Converter to include event NDC + The header for the layout format. + the layout header - Outputs the value of the event property named NDC. - - - The should be used instead. + The Header text will be appended before any logging events + are formatted and appended. + The pattern will be formatted on each get operation. - Nicko Cadell - + - Write the event NDC to the output + The footer for the layout format. - that will receive the formatted result. - the event being logged + the layout footer - As the thread context stacks are now stored in named event properties - this converter simply looks up the value of the NDC property. - - - The should be used instead. + The Footer text will be appended after all the logging events + have been formatted and appended. + The pattern will be formatted on each get operation. - + - Property pattern converter + A Layout that renders only the Exception text from the logging event - Writes out the value of a named property. The property name - should be set in the - property. + A Layout that renders only the Exception text from the logging event. - If the is set to null - then all the properties are written as key value pairs. + This Layout should only be used with appenders that utilize multiple + layouts (e.g. ). Nicko Cadell + Gert Driesen - + - Write the property value to the output + Default constructor - that will receive the formatted result. - the event being logged - Writes out the value of a named property. The property name - should be set in the - property. - - - If the is set to null - then all the properties are written as key value pairs. + Constructs a ExceptionLayout - + - Converter to output the relative time of the event + Activate component options - Converter to output the time of the event relative to the start of the program. + Part of the component activation + framework. + + + This method does nothing as options become effective immediately. - Nicko Cadell - + - Write the relative time to the output + Gets the exception text from the logging event - that will receive the formatted result. + The TextWriter to write the formatted event to the event being logged - Writes out the relative time of the event in milliseconds. - That is the number of milliseconds between the event - and the . + Write the exception string to the . + The exception string is retrieved from . - - - Helper method to get the time difference between two DateTime objects - - start time (in the current local time zone) - end time (in the current local time zone) - the time difference in milliseconds - - + - Write the caller stack frames to the output + Interface implemented by layout objects - Writes the to the output writer, using format: - type3.MethodCall3(type param,...) > type2.MethodCall2(type param,...) > type1.MethodCall1(type param,...) + An object is used to format a + as text. The method is called by an + appender to transform the into a string. + + + The layout can also supply and + text that is appender before any events and after all the events respectively. - Adam Davies + Nicko Cadell + Gert Driesen - + - Write the caller stack frames to the output + Implement this method to create your own layout format. + The TextWriter to write the formatted event to + The event to format - Writes the to the output writer, using format: - type3.MethodCall3 > type2.MethodCall2 > type1.MethodCall1 + This method is called by an appender to format + the as text and output to a writer. + + + If the caller does not have a and prefers the + event to be formatted as a then the following + code can be used to format the event into a . + + StringWriter writer = new StringWriter(); + Layout.Format(writer, loggingEvent); + string formattedEvent = writer.ToString(); + - Michael Cromwell - + - Initialize the converter + The content type output by this layout. + The content type - This is part of the delayed object - activation scheme. The method must - be called on this object after the configuration properties have - been set. Until is called this - object is in an undefined state and must not be used. + The content type output by this layout. - If any of the configuration properties are modified then - must be called again. + This is a MIME type e.g. "text/plain". - + - Write the strack frames to the output + The header for the layout format. - that will receive the formatted result. - the event being logged + the layout header - Writes the to the output writer. + The Header text will be appended before any logging events + are formatted and appended. - - - Returns the Name of the method - - - This method was created, so this class could be used as a base class for StackTraceDetailPatternConverter - string - - + - The fully qualified type of the StackTracePatternConverter class. + The footer for the layout format. + the layout footer - Used by the internal logger to record the Type of the - log message. + + The Footer text will be appended after all the logging events + have been formatted and appended. + - + - The fully qualified type of the StackTraceDetailPatternConverter class. + Flag indicating if this layout handle exceptions + false if this layout handles exceptions - Used by the internal logger to record the Type of the - log message. + + If this layout handles the exception object contained within + , then the layout should return + false. Otherwise, if the layout ignores the exception + object, then the layout should return true. + - + - Converter to include event thread name + Interface for raw layout objects - Writes the to the output. + Interface used to format a + to an object. + + + This interface should not be confused with the + interface. This interface is used in + only certain specialized situations where a raw object is + required rather than a formatted string. The + is not generally useful than this interface. Nicko Cadell + Gert Driesen - + - Write the ThreadName to the output + Implement this method to create your own layout format. - that will receive the formatted result. - the event being logged + The event to format + returns the formatted event - Writes the to the . + Implement this method to create your own layout format. - + - Pattern converter for the class name + Adapts any to a - Outputs the of the event. + Where an is required this adapter + allows a to be specified. Nicko Cadell + Gert Driesen - + - Gets the fully qualified name of the class + The layout to adapt - the event being logged - The fully qualified type name for the caller location + + + + Construct a new adapter + + the layout to adapt - Returns the of the . + Create the adapter for the specified . - - - Converter to include event user name - - Douglas de la Torre - Nicko Cadell - - - - Convert the pattern to the rendered message - - that will receive the formatted result. - the event being logged - - + - Write the TimeStamp to the output + Format the logging event as an object. + The event to format + returns the formatted event - Date pattern converter, uses a to format - the date of a . - - - Uses a to format the - in Universal time. + Format the logging event as an object. - See the for details on the date pattern syntax. + Uses the object supplied to + the constructor to perform the formatting. - - Nicko Cadell - + - Write the TimeStamp to the output + Extend this abstract class to create your own log layout format. - that will receive the formatted result. - the event being logged - Pass the to the - for it to render it to the writer. + This is the base implementation of the + interface. Most layout objects should extend this class. + + + - The passed is in the local time zone, this is converted - to Universal time before it is rendered. + Subclasses must implement the + method. + + + Subclasses should set the in their default + constructor. + - + Nicko Cadell + Gert Driesen - + - The fully qualified type of the UtcDatePatternConverter class. + The header text - Used by the internal logger to record the Type of the - log message. + + See for more information. + - + - A flexible layout configurable with pattern string that re-evaluates on each call. + The footer text - This class is built on and provides all the - features and capabilities of PatternLayout. PatternLayout is a 'static' class - in that its layout is done once at configuration time. This class will recreate - the layout on each reference. - One important difference between PatternLayout and DynamicPatternLayout is the - treatment of the Header and Footer parameters in the configuration. The Header and Footer - parameters for DynamicPatternLayout must be syntactically in the form of a PatternString, - but should not be marked as type log4net.Util.PatternString. Doing so causes the - pattern to be statically converted at configuration time and causes DynamicPatternLayout - to perform the same as PatternLayout. - Please see for complete documentation. - - <layout type="log4net.Layout.DynamicPatternLayout"> - <param name="Header" value="%newline**** Trace Opened Local: %date{yyyy-MM-dd HH:mm:ss.fff} UTC: %utcdate{yyyy-MM-dd HH:mm:ss.fff} ****%newline" /> - <param name="Footer" value="**** Trace Closed %date{yyyy-MM-dd HH:mm:ss.fff} ****%newline" /> - </layout> - + + See for more information. + + + + + + Flag indicating if this layout handles exceptions + + + + false if this layout handles exceptions + + + + + + Empty default constructor + + + + Empty default constructor + + + + + + Activate component options + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + This method must be implemented by the subclass. + + + + + + Implement this method to create your own layout format. + + The TextWriter to write the formatted event to + The event to format + + + This method is called by an appender to format + the as text. + + + + + + Convenience method for easily formatting the logging event into a string variable. + + + + Creates a new StringWriter instance to store the formatted logging event. + + + + + The content type output by this layout. + + The content type is "text/plain" + + + The content type output by this layout. + + + This base class uses the value "text/plain". + To change this value a subclass must override this + property. + + + + + + The header for the layout format. + + the layout header + + + The Header text will be appended before any logging events + are formatted and appended. + + + + + + The footer for the layout format. + + the layout footer + + + The Footer text will be appended after all the logging events + have been formatted and appended. + + + + + + Flag indicating if this layout handles exceptions + + false if this layout handles exceptions + + + If this layout handles the exception object contained within + , then the layout should return + false. Otherwise, if the layout ignores the exception + object, then the layout should return true. + + + Set this value to override a this default setting. The default + value is true, this layout does not handle the exception. + @@ -18471,8 +17860,8 @@ appdomain - Used to output the friendly name of the AppDomain where the - logging event was generated. + Used to output the friendly name of the AppDomain where the + logging event was generated. @@ -18536,89 +17925,89 @@ Equivalent to date - date - - - Used to output the date of the logging event in the local time zone. - To output the date in universal time use the %utcdate pattern. - The date conversion - specifier may be followed by a date format specifier enclosed - between braces. For example, %date{HH:mm:ss,fff} or - %date{dd MMM yyyy HH:mm:ss,fff}. If no date format specifier is - given then ISO8601 format is - assumed (). - - - The date format specifier admits the same syntax as the - time pattern string of the . - - - For better results it is recommended to use the log4net date - formatters. These can be specified using one of the strings - "ABSOLUTE", "DATE" and "ISO8601" for specifying - , - and respectively - . For example, - %date{ISO8601} or %date{ABSOLUTE}. - - - These dedicated date formatters perform significantly - better than . - - - - - exception - - - Used to output the exception passed in with the log message. - - - If an exception object is stored in the logging event - it will be rendered into the pattern output with a - trailing newline. - If there is no exception then nothing will be output - and no trailing newline will be appended. - It is typical to put a newline before the exception - and to have the exception as the last data in the pattern. - - - + date + + + Used to output the date of the logging event in the local time zone. + To output the date in universal time use the %utcdate pattern. + The date conversion + specifier may be followed by a date format specifier enclosed + between braces. For example, %date{HH:mm:ss,fff} or + %date{dd MMM yyyy HH:mm:ss,fff}. If no date format specifier is + given then ISO8601 format is + assumed (). + + + The date format specifier admits the same syntax as the + time pattern string of the . + + + For better results it is recommended to use the log4net date + formatters. These can be specified using one of the strings + "ABSOLUTE", "DATE" and "ISO8601" for specifying + , + and respectively + . For example, + %date{ISO8601} or %date{ABSOLUTE}. + + + These dedicated date formatters perform significantly + better than . + + + + + exception + + + Used to output the exception passed in with the log message. + + + If an exception object is stored in the logging event + it will be rendered into the pattern output with a + trailing newline. + If there is no exception then nothing will be output + and no trailing newline will be appended. + It is typical to put a newline before the exception + and to have the exception as the last data in the pattern. + + + F Equivalent to file - - file - - - Used to output the file name where the logging request was - issued. - - - WARNING Generating caller location information is - extremely slow. Its use should be avoided unless execution speed - is not an issue. - - - See the note below on the availability of caller location information. - - - - - identity - - - Used to output the user name for the currently active user - (Principal.Identity.Name). - - - WARNING Generating caller information is - extremely slow. Its use should be avoided unless execution speed - is not an issue. - - - + + file + + + Used to output the file name where the logging request was + issued. + + + WARNING Generating caller location information is + extremely slow. Its use should be avoided unless execution speed + is not an issue. + + + See the note below on the availability of caller location information. + + + + + identity + + + Used to output the user name for the currently active user + (Principal.Identity.Name). + + + WARNING Generating caller information is + extremely slow. Its use should be avoided unless execution speed + is not an issue. + + + l Equivalent to location @@ -18627,72 +18016,72 @@ L Equivalent to line - - location - - - Used to output location information of the caller which generated - the logging event. - - - The location information depends on the CLI implementation but - usually consists of the fully qualified name of the calling - method followed by the callers source the file name and line - number between parentheses. - - - The location information can be very useful. However, its - generation is extremely slow. Its use should be avoided - unless execution speed is not an issue. - - - See the note below on the availability of caller location information. - - - - - level - - - Used to output the level of the logging event. - - - - - line - - - Used to output the line number from where the logging request - was issued. - - - WARNING Generating caller location information is - extremely slow. Its use should be avoided unless execution speed - is not an issue. - - - See the note below on the availability of caller location information. - - - + + location + + + Used to output location information of the caller which generated + the logging event. + + + The location information depends on the CLI implementation but + usually consists of the fully qualified name of the calling + method followed by the callers source the file name and line + number between parentheses. + + + The location information can be very useful. However, its + generation is extremely slow. Its use should be avoided + unless execution speed is not an issue. + + + See the note below on the availability of caller location information. + + + + + level + + + Used to output the level of the logging event. + + + + + line + + + Used to output the line number from where the logging request + was issued. + + + WARNING Generating caller location information is + extremely slow. Its use should be avoided unless execution speed + is not an issue. + + + See the note below on the availability of caller location information. + + + logger - Used to output the logger of the logging event. The - logger conversion specifier can be optionally followed by - precision specifier, that is a decimal constant in - brackets. + Used to output the logger of the logging event. The + logger conversion specifier can be optionally followed by + precision specifier, that is a decimal constant in + brackets. - - If a precision specifier is given, then only the corresponding - number of right most components of the logger name will be - printed. By default the logger name is printed in full. - - - For example, for the logger name "a.b.c" the pattern - %logger{2} will output "b.c". - + + If a precision specifier is given, then only the corresponding + number of right most components of the logger name will be + printed. By default the logger name is printed in full. + + + For example, for the logger name "a.b.c" the pattern + %logger{2} will output "b.c". + @@ -18703,69 +18092,69 @@ M Equivalent to method - - message - - - Used to output the application supplied message associated with - the logging event. - - - - - mdc - - - The MDC (old name for the ThreadContext.Properties) is now part of the - combined event properties. This pattern is supported for compatibility - but is equivalent to property. - - - - - method - - - Used to output the method name where the logging request was - issued. - - - WARNING Generating caller location information is - extremely slow. Its use should be avoided unless execution speed - is not an issue. - - - See the note below on the availability of caller location information. - - - + + message + + + Used to output the application supplied message associated with + the logging event. + + + + + mdc + + + The MDC (old name for the ThreadContext.Properties) is now part of the + combined event properties. This pattern is supported for compatibility + but is equivalent to property. + + + + + method + + + Used to output the method name where the logging request was + issued. + + + WARNING Generating caller location information is + extremely slow. Its use should be avoided unless execution speed + is not an issue. + + + See the note below on the availability of caller location information. + + + n Equivalent to newline - - newline - - - Outputs the platform dependent line separator character or - characters. - - - This conversion pattern offers the same performance as using - non-portable line separator strings such as "\n", or "\r\n". - Thus, it is the preferred way of specifying a line separator. - - - - - ndc - - - Used to output the NDC (nested diagnostic context) associated - with the thread that generated the logging event. - - - + + newline + + + Outputs the platform dependent line separator character or + characters. + + + This conversion pattern offers the same performance as using + non-portable line separator strings such as "\n", or "\r\n". + Thus, it is the preferred way of specifying a line separator. + + + + + ndc + + + Used to output the NDC (nested diagnostic context) associated + with the thread that generated the logging event. + + + p Equivalent to level @@ -18778,192 +18167,192 @@ properties Equivalent to property - - property - - - Used to output the an event specific property. The key to - lookup must be specified within braces and directly following the - pattern specifier, e.g. %property{user} would include the value - from the property that is keyed by the string 'user'. Each property value - that is to be included in the log must be specified separately. - Properties are added to events by loggers or appenders. By default - the log4net:HostName property is set to the name of machine on - which the event was originally logged. - - - If no key is specified, e.g. %property then all the keys and their - values are printed in a comma separated list. - - - The properties of an event are combined from a number of different - contexts. These are listed below in the order in which they are searched. - - - - the event properties - - The event has that can be set. These - properties are specific to this event only. - - - - the thread properties - - The that are set on the current - thread. These properties are shared by all events logged on this thread. - - - - the global properties - - The that are set globally. These - properties are shared by all the threads in the AppDomain. - - - - - - + + property + + + Used to output the an event specific property. The key to + lookup must be specified within braces and directly following the + pattern specifier, e.g. %property{user} would include the value + from the property that is keyed by the string 'user'. Each property value + that is to be included in the log must be specified separately. + Properties are added to events by loggers or appenders. By default + the log4net:HostName property is set to the name of machine on + which the event was originally logged. + + + If no key is specified, e.g. %property then all the keys and their + values are printed in a comma separated list. + + + The properties of an event are combined from a number of different + contexts. These are listed below in the order in which they are searched. + + + + the event properties + + The event has that can be set. These + properties are specific to this event only. + + + + the thread properties + + The that are set on the current + thread. These properties are shared by all events logged on this thread. + + + + the global properties + + The that are set globally. These + properties are shared by all the threads in the AppDomain. + + + + + + r Equivalent to timestamp - - stacktrace - - - Used to output the stack trace of the logging event - The stack trace level specifier may be enclosed - between braces. For example, %stacktrace{level}. - If no stack trace level specifier is given then 1 is assumed - - - Output uses the format: - type3.MethodCall3 > type2.MethodCall2 > type1.MethodCall1 - + + stacktrace + + + Used to output the stack trace of the logging event + The stack trace level specifier may be enclosed + between braces. For example, %stacktrace{level}. + If no stack trace level specifier is given then 1 is assumed + + + Output uses the format: + type3.MethodCall3 > type2.MethodCall2 > type1.MethodCall1 + This pattern is not available for Compact Framework assemblies. - - - - stacktracedetail - - - Used to output the stack trace of the logging event - The stack trace level specifier may be enclosed - between braces. For example, %stacktracedetail{level}. - If no stack trace level specifier is given then 1 is assumed - - - Output uses the format: - type3.MethodCall3(type param,...) > type2.MethodCall2(type param,...) > type1.MethodCall1(type param,...) - + + + + stacktracedetail + + + Used to output the stack trace of the logging event + The stack trace level specifier may be enclosed + between braces. For example, %stacktracedetail{level}. + If no stack trace level specifier is given then 1 is assumed + + + Output uses the format: + type3.MethodCall3(type param,...) > type2.MethodCall2(type param,...) > type1.MethodCall1(type param,...) + This pattern is not available for Compact Framework assemblies. - - + + t Equivalent to thread - - timestamp - - - Used to output the number of milliseconds elapsed since the start - of the application until the creation of the logging event. - - - - - thread - - - Used to output the name of the thread that generated the - logging event. Uses the thread number if no name is available. - - - + + timestamp + + + Used to output the number of milliseconds elapsed since the start + of the application until the creation of the logging event. + + + + + thread + + + Used to output the name of the thread that generated the + logging event. Uses the thread number if no name is available. + + + - type - - - Used to output the fully qualified type name of the caller - issuing the logging request. This conversion specifier - can be optionally followed by precision specifier, that - is a decimal constant in brackets. - - - If a precision specifier is given, then only the corresponding - number of right most components of the class name will be - printed. By default the class name is output in fully qualified form. - - - For example, for the class name "log4net.Layout.PatternLayout", the - pattern %type{1} will output "PatternLayout". - - - WARNING Generating the caller class information is - slow. Thus, its use should be avoided unless execution speed is - not an issue. - - - See the note below on the availability of caller location information. - - + type + + + Used to output the fully qualified type name of the caller + issuing the logging request. This conversion specifier + can be optionally followed by precision specifier, that + is a decimal constant in brackets. + + + If a precision specifier is given, then only the corresponding + number of right most components of the class name will be + printed. By default the class name is output in fully qualified form. + + + For example, for the class name "log4net.Layout.PatternLayout", the + pattern %type{1} will output "PatternLayout". + + + WARNING Generating the caller class information is + slow. Thus, its use should be avoided unless execution speed is + not an issue. + + + See the note below on the availability of caller location information. + + u Equivalent to identity - - username - - - Used to output the WindowsIdentity for the currently - active user. - - - WARNING Generating caller WindowsIdentity information is - extremely slow. Its use should be avoided unless execution speed - is not an issue. - - - + + username + + + Used to output the WindowsIdentity for the currently + active user. + + + WARNING Generating caller WindowsIdentity information is + extremely slow. Its use should be avoided unless execution speed + is not an issue. + + + - utcdate - - - Used to output the date of the logging event in universal time. - The date conversion - specifier may be followed by a date format specifier enclosed - between braces. For example, %utcdate{HH:mm:ss,fff} or - %utcdate{dd MMM yyyy HH:mm:ss,fff}. If no date format specifier is - given then ISO8601 format is - assumed (). - - - The date format specifier admits the same syntax as the - time pattern string of the . - - - For better results it is recommended to use the log4net date - formatters. These can be specified using one of the strings - "ABSOLUTE", "DATE" and "ISO8601" for specifying - , - and respectively - . For example, - %utcdate{ISO8601} or %utcdate{ABSOLUTE}. - - - These dedicated date formatters perform significantly - better than . - - - + utcdate + + + Used to output the date of the logging event in universal time. + The date conversion + specifier may be followed by a date format specifier enclosed + between braces. For example, %utcdate{HH:mm:ss,fff} or + %utcdate{dd MMM yyyy HH:mm:ss,fff}. If no date format specifier is + given then ISO8601 format is + assumed (). + + + The date format specifier admits the same syntax as the + time pattern string of the . + + + For better results it is recommended to use the log4net date + formatters. These can be specified using one of the strings + "ABSOLUTE", "DATE" and "ISO8601" for specifying + , + and respectively + . For example, + %utcdate{ISO8601} or %utcdate{ABSOLUTE}. + + + These dedicated date formatters perform significantly + better than . + + + w Equivalent to username @@ -18976,14 +18365,14 @@ X Equivalent to mdc - - % - - - The sequence %% outputs a single percent sign. - - - + + % + + + The sequence %% outputs a single percent sign. + + + The single letter patterns are deprecated in favor of the @@ -19027,82 +18416,82 @@ conversion specifier.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Format modifierleft justifyminimum widthmaximum widthcomment
%20loggerfalse20none - - Left pad with spaces if the logger name is less than 20 - characters long. - -
%-20loggertrue20none - - Right pad with spaces if the logger - name is less than 20 characters long. - -
%.30loggerNAnone30 - - Truncate from the beginning if the logger - name is longer than 30 characters. - -
%20.30loggerfalse2030 - - Left pad with spaces if the logger name is shorter than 20 - characters. However, if logger name is longer than 30 characters, - then truncate from the beginning. - -
%-20.30loggertrue2030 - - Right pad with spaces if the logger name is shorter than 20 - characters. However, if logger name is longer than 30 characters, - then truncate from the beginning. - -
-
- - Note about caller location information.
- The following patterns %type %file %line %method %location %class %C %F %L %l %M - all generate caller location information. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Format modifierleft justifyminimum widthmaximum widthcomment
%20loggerfalse20none + + Left pad with spaces if the logger name is less than 20 + characters long. + +
%-20loggertrue20none + + Right pad with spaces if the logger + name is less than 20 characters long. + +
%.30loggerNAnone30 + + Truncate from the beginning if the logger + name is longer than 30 characters. + +
%20.30loggerfalse2030 + + Left pad with spaces if the logger name is shorter than 20 + characters. However, if logger name is longer than 30 characters, + then truncate from the beginning. + +
%-20.30loggertrue2030 + + Right pad with spaces if the logger name is shorter than 20 + characters. However, if logger name is longer than 30 characters, + then truncate from the beginning. + +
+ + + Note about caller location information.
+ The following patterns %type %file %line %method %location %class %C %F %L %l %M + all generate caller location information. Location information uses the System.Diagnostics.StackTrace class to generate a call stack. The caller's information is then extracted from this stack.
@@ -19152,2175 +18541,3153 @@ Douglas de la Torre Daniel Cazzulino
- + - Extend this abstract class to create your own log layout format. + Default pattern string for log output. - This is the base implementation of the - interface. Most layout objects should extend this class. + Default pattern string for log output. + Currently set to the string "%message%newline" + which just prints the application supplied message. + + + + A detailed conversion pattern + - - - Subclasses must implement the - method. - - Subclasses should set the in their default - constructor. + A conversion pattern which includes Time, Thread, Logger, and Nested Context. + Current value is %timestamp [%thread] %level %logger %ndc - %message%newline. - - Nicko Cadell - Gert Driesen - + - Interface implemented by layout objects + Internal map of converter identifiers to converter types. - An object is used to format a - as text. The method is called by an - appender to transform the into a string. + This static map is overridden by the m_converterRegistry instance map + + + + + the pattern + + + + + the head of the pattern converter chain + + + + + patterns defined on this PatternLayout only + + + + + Initialize the global registry + + - The layout can also supply and - text that is appender before any events and after all the events respectively. + Defines the builtin global rules. - Nicko Cadell - Gert Driesen - + - Implement this method to create your own layout format. + Constructs a PatternLayout using the DefaultConversionPattern - The TextWriter to write the formatted event to - The event to format - This method is called by an appender to format - the as text and output to a writer. + The default pattern just produces the application supplied message. - If the caller does not have a and prefers the - event to be formatted as a then the following - code can be used to format the event into a . + Note to Inheritors: This constructor calls the virtual method + . If you override this method be + aware that it will be called before your is called constructor. + + + As per the contract the + method must be called after the properties on this object have been + configured. - - StringWriter writer = new StringWriter(); - Layout.Format(writer, loggingEvent); - string formattedEvent = writer.ToString(); - - + - The content type output by this layout. + Constructs a PatternLayout using the supplied conversion pattern - The content type + the pattern to use - The content type output by this layout. + Note to Inheritors: This constructor calls the virtual method + . If you override this method be + aware that it will be called before your is called constructor. - This is a MIME type e.g. "text/plain". + When using this constructor the method + need not be called. This may not be the case when using a subclass. - + - The header for the layout format. + The pattern formatting string - the layout header - The Header text will be appended before any logging events - are formatted and appended. + The ConversionPattern option. This is the string which + controls formatting and consists of a mix of literal content and + conversion specifiers. - + - The footer for the layout format. + Create the pattern parser instance - the layout footer + the pattern to parse + The that will format the event - The Footer text will be appended after all the logging events - have been formatted and appended. + Creates the used to parse the conversion string. Sets the + global and instance rules on the . - + - Flag indicating if this layout handle exceptions + Initialize layout options - false if this layout handles exceptions - If this layout handles the exception object contained within - , then the layout should return - false. Otherwise, if the layout ignores the exception - object, then the layout should return true. + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. - + - The header text + Produces a formatted string as specified by the conversion pattern. + the event being logged + The TextWriter to write the formatted event to - See for more information. + Parse the using the patter format + specified in the property. - + - The footer text + Add a converter to this PatternLayout + the converter info - See for more information. + This version of the method is used by the configurator. + Programmatic users should use the alternative method. - + - Flag indicating if this layout handles exceptions + Add a converter to this PatternLayout + the name of the conversion pattern for this converter + the type of the converter - false if this layout handles exceptions + Add a named pattern converter to this instance. This + converter will be used in the formatting of the event. + This method must be called before . + + + The specified must extend the + type. - + - Empty default constructor + Write the event appdomain name to the output - Empty default constructor + Writes the to the output writer. + Daniel Cazzulino + Nicko Cadell - + - Activate component options + Write the event appdomain name to the output + that will receive the formatted result. + the event being logged - This is part of the delayed object - activation scheme. The method must - be called on this object after the configuration properties have - been set. Until is called this - object is in an undefined state and must not be used. - - - If any of the configuration properties are modified then - must be called again. - - - This method must be implemented by the subclass. + Writes the to the output . - + - Implement this method to create your own layout format. + Converter for items in the ASP.Net Cache. - The TextWriter to write the formatted event to - The event to format - This method is called by an appender to format - the as text. + Outputs an item from the . + Ron Grabowski - + - Convenience method for easily formatting the logging event into a string variable. + Write the ASP.Net Cache item to the output - + that will receive the formatted result. + The on which the pattern converter should be executed. + The under which the ASP.Net request is running. - Creates a new StringWriter instance to store the formatted logging event. + + Writes out the value of a named property. The property name + should be set in the + property. If no property has been set, all key value pairs from the Cache will + be written to the output. + - + - The content type output by this layout. + Converter for items in the . - The content type is "text/plain" - The content type output by this layout. - - - This base class uses the value "text/plain". - To change this value a subclass must override this - property. + Outputs an item from the . + Ron Grabowski - + - The header for the layout format. + Write the ASP.Net HttpContext item to the output - the layout header + that will receive the formatted result. + The on which the pattern converter should be executed. + The under which the ASP.Net request is running. - The Header text will be appended before any logging events - are formatted and appended. + Writes out the value of a named property. The property name + should be set in the + property. - + - The footer for the layout format. + Abstract class that provides access to the current HttpContext () that + derived classes need. - the layout footer - - The Footer text will be appended after all the logging events - have been formatted and appended. - + This class handles the case when HttpContext.Current is null by writing + to the writer. + Ron Grabowski - + - Flag indicating if this layout handles exceptions + Derived pattern converters must override this method in order to + convert conversion specifiers in the correct way. - false if this layout handles exceptions - - - If this layout handles the exception object contained within - , then the layout should return - false. Otherwise, if the layout ignores the exception - object, then the layout should return true. - - - Set this value to override a this default setting. The default - value is true, this layout does not handle the exception. - - + that will receive the formatted result. + The on which the pattern converter should be executed. + The under which the ASP.Net request is running. - + - Default pattern string for log output. + Converter for items in the ASP.Net Cache. - Default pattern string for log output. - Currently set to the string "%message%newline" - which just prints the application supplied message. + Outputs an item from the . + Ron Grabowski - + - A detailed conversion pattern + Write the ASP.Net Cache item to the output + that will receive the formatted result. + The on which the pattern converter should be executed. + The under which the ASP.Net request is running. - A conversion pattern which includes Time, Thread, Logger, and Nested Context. - Current value is %timestamp [%thread] %level %logger %ndc - %message%newline. + Writes out the value of a named property. The property name + should be set in the + property. - + - Internal map of converter identifiers to converter types. + Converter for items in the ASP.Net Cache. - This static map is overridden by the m_converterRegistry instance map + Outputs an item from the . + Ron Grabowski - - - the pattern - - - - - the head of the pattern converter chain - - - - - patterns defined on this PatternLayout only - - - + - Initialize the global registry + Write the ASP.Net Cache item to the output + that will receive the formatted result. + The on which the pattern converter should be executed. + The under which the ASP.Net request is running. - Defines the builtin global rules. + Writes out the value of a named property. The property name + should be set in the + property. If no property has been set, all key value pairs from the Session will + be written to the output. - + - Constructs a PatternLayout using the DefaultConversionPattern + Date pattern converter, uses a to format + the date of a . - The default pattern just produces the application supplied message. - - - Note to Inheritors: This constructor calls the virtual method - . If you override this method be - aware that it will be called before your is called constructor. + Render the to the writer as a string. - As per the contract the - method must be called after the properties on this object have been - configured. - - - - - - Constructs a PatternLayout using the supplied conversion pattern - - the pattern to use - - - Note to Inheritors: This constructor calls the virtual method - . If you override this method be - aware that it will be called before your is called constructor. + The value of the determines + the formatting of the date. The following values are allowed: + + + Option value + Output + + + ISO8601 + + Uses the formatter. + Formats using the "yyyy-MM-dd HH:mm:ss,fff" pattern. + + + + DATE + + Uses the formatter. + Formats using the "dd MMM yyyy HH:mm:ss,fff" for example, "06 Nov 1994 15:49:37,459". + + + + ABSOLUTE + + Uses the formatter. + Formats using the "HH:mm:ss,yyyy" for example, "15:49:37,459". + + + + other + + Any other pattern string uses the formatter. + This formatter passes the pattern string to the + method. + For details on valid patterns see + DateTimeFormatInfo Class. + + + - When using this constructor the method - need not be called. This may not be the case when using a subclass. + The is in the local time zone and is rendered in that zone. + To output the time in Universal time see . + Nicko Cadell - + - Create the pattern parser instance + The used to render the date to a string - the pattern to parse - The that will format the event - Creates the used to parse the conversion string. Sets the - global and instance rules on the . + The used to render the date to a string - + - Initialize layout options + Initialize the converter pattern based on the property. This is part of the delayed object - activation scheme. The method must + activation scheme. The method must be called on this object after the configuration properties have - been set. Until is called this + been set. Until is called this object is in an undefined state and must not be used. If any of the configuration properties are modified then - must be called again. + must be called again. - + - Produces a formatted string as specified by the conversion pattern. + Convert the pattern into the rendered message + that will receive the formatted result. the event being logged - The TextWriter to write the formatted event to - Parse the using the patter format - specified in the property. + Pass the to the + for it to render it to the writer. + + + The passed is in the local time zone. - + - Add a converter to this PatternLayout + The fully qualified type of the DatePatternConverter class. - the converter info - - This version of the method is used by the configurator. - Programmatic users should use the alternative method. - + Used by the internal logger to record the Type of the + log message. - + - Add a converter to this PatternLayout + Write the exception text to the output - the name of the conversion pattern for this converter - the type of the converter - Add a named pattern converter to this instance. This - converter will be used in the formatting of the event. - This method must be called before . + If an exception object is stored in the logging event + it will be rendered into the pattern output with a + trailing newline. - The specified must extend the - type. + If there is no exception then nothing will be output + and no trailing newline will be appended. + It is typical to put a newline before the exception + and to have the exception as the last data in the pattern. + Nicko Cadell - + - The pattern formatting string + Default constructor + + + + + Write the exception text to the output + that will receive the formatted result. + the event being logged - The ConversionPattern option. This is the string which - controls formatting and consists of a mix of literal content and - conversion specifiers. + If an exception object is stored in the logging event + it will be rendered into the pattern output with a + trailing newline. + + + If there is no exception or the exception property specified + by the Option value does not exist then nothing will be output + and no trailing newline will be appended. + It is typical to put a newline before the exception + and to have the exception as the last data in the pattern. + + + Recognized values for the Option parameter are: + + + Message + + + Source + + + StackTrace + + + TargetSite + + + HelpLink + + - - - The header PatternString - - - - - The footer PatternString - - - + - Constructs a DynamicPatternLayout using the DefaultConversionPattern + Writes the caller location file name to the output - The default pattern just produces the application supplied message. + Writes the value of the for + the event to the output writer. + Nicko Cadell - + - Constructs a DynamicPatternLayout using the supplied conversion pattern + Write the caller location file name to the output - the pattern to use + that will receive the formatted result. + the event being logged + + Writes the value of the for + the to the output . + - + - The header for the layout format. + Write the caller location info to the output - the layout header - The Header text will be appended before any logging events - are formatted and appended. + Writes the to the output writer. - The pattern will be formatted on each get operation. + Nicko Cadell - + - The footer for the layout format. + Write the caller location info to the output - the layout footer + that will receive the formatted result. + the event being logged - The Footer text will be appended after all the logging events - have been formatted and appended. + Writes the to the output writer. - The pattern will be formatted on each get operation. - + - A Layout that renders only the Exception text from the logging event + Writes the event identity to the output - A Layout that renders only the Exception text from the logging event. - - - This Layout should only be used with appenders that utilize multiple - layouts (e.g. ). + Writes the value of the to + the output writer. + Daniel Cazzulino Nicko Cadell - Gert Driesen - + - Default constructor + Writes the event identity to the output + that will receive the formatted result. + the event being logged - Constructs a ExceptionLayout + Writes the value of the + to + the output . - + - Activate component options + Write the event level to the output - Part of the component activation - framework. - - - This method does nothing as options become effective immediately. + Writes the display name of the event + to the writer. + Nicko Cadell - + - Gets the exception text from the logging event + Write the event level to the output - The TextWriter to write the formatted event to + that will receive the formatted result. the event being logged - Write the exception string to the . - The exception string is retrieved from . + Writes the of the + to the . - + - Interface for raw layout objects + Write the caller location line number to the output - Interface used to format a - to an object. - - - This interface should not be confused with the - interface. This interface is used in - only certain specialized situations where a raw object is - required rather than a formatted string. The - is not generally useful than this interface. + Writes the value of the for + the event to the output writer. Nicko Cadell - Gert Driesen - + - Implement this method to create your own layout format. + Write the caller location line number to the output - The event to format - returns the formatted event + that will receive the formatted result. + the event being logged - Implement this method to create your own layout format. + Writes the value of the for + the to the output . - + - Adapts any to a + Converter for logger name - Where an is required this adapter - allows a to be specified. + Outputs the of the event. Nicko Cadell - Gert Driesen - + - The layout to adapt + Gets the fully qualified name of the logger - - - - Construct a new adapter - - the layout to adapt + the event being logged + The fully qualified logger name - Create the adapter for the specified . + Returns the of the . - + - Format the logging event as an object. + Writes the event message to the output - The event to format - returns the formatted event - Format the logging event as an object. - - - Uses the object supplied to - the constructor to perform the formatting. + Uses the method + to write out the event message. + Nicko Cadell - + - Type converter for the interface + Writes the event message to the output + that will receive the formatted result. + the event being logged - Used to convert objects to the interface. - Supports converting from the interface to - the interface using the . + Uses the method + to write out the event message. - Nicko Cadell - Gert Driesen - + - Interface supported by type converters + Write the method name to the output - This interface supports conversion from arbitrary types - to a single target type. See . + Writes the caller location to + the output. Nicko Cadell - Gert Driesen - + - Can the source type be converted to the type supported by this object + Write the method name to the output - the type to convert - true if the conversion is possible + that will receive the formatted result. + the event being logged - Test if the can be converted to the - type supported by this converter. + Writes the caller location to + the output. - + - Convert the source object to the type supported by this object + Converter to output and truncate '.' separated strings - the object to convert - the converted object - Converts the to the type supported - by this converter. + This abstract class supports truncating a '.' separated string + to show a specified number of elements from the right hand side. + This is used to truncate class names that are fully qualified. + + + Subclasses should override the method to + return the fully qualified string. + Nicko Cadell - + - Can the sourceType be converted to an + Initialize the converter - the source to be to be converted - true if the source type can be converted to - Test if the can be converted to a - . Only is supported - as the . + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. - + - Convert the value to a object + Get the fully qualified string data - the value to convert - the object + the event being logged + the fully qualified name - Convert the object to a - object. If the object - is a then the - is used to adapt between the two interfaces, otherwise an - exception is thrown. + Overridden by subclasses to get the fully qualified name before the + precision is applied to it. + + + Return the fully qualified '.' (dot/period) separated string. - + - Extract the value of a property from the + Convert the pattern to the rendered message + that will receive the formatted result. + the event being logged - - Extract the value of a property from the - + Render the to the precision + specified by the property. - Nicko Cadell - + - Constructs a RawPropertyLayout + The fully qualified type of the NamedPatternConverter class. + + Used by the internal logger to record the Type of the + log message. + - + - Lookup the property for + Converter to include event NDC - The event to format - returns property value - Looks up and returns the object value of the property - named . If there is no property defined - with than name then null will be returned. + Outputs the value of the event property named NDC. + + + The should be used instead. + Nicko Cadell - + - The name of the value to lookup in the LoggingEvent Properties collection. + Write the event NDC to the output - - Value to lookup in the LoggingEvent Properties collection - + that will receive the formatted result. + the event being logged - String name of the property to lookup in the . + As the thread context stacks are now stored in named event properties + this converter simply looks up the value of the NDC property. + + + The should be used instead. - + - Extract the date from the + Abstract class that provides the formatting functionality that + derived classes need. - - Extract the date from the - + Conversion specifiers in a conversion patterns are parsed to + individual PatternConverters. Each of which is responsible for + converting a logging event in a converter specific manner. Nicko Cadell - Gert Driesen - + - Constructs a RawTimeStampLayout + Initializes a new instance of the class. - + - Gets the as a . + Flag indicating if this converter handles the logging event exception - The event to format - returns the time stamp + false if this converter handles the logging event exception - Gets the as a . + If this converter handles the exception object contained within + , then this property should be set to + false. Otherwise, if the layout ignores the exception + object, then the property should be set to true. - The time stamp is in local time. To format the time stamp - in universal time use . + Set this value to override a this default setting. The default + value is true, this converter does not handle the exception. - + - Extract the date from the + Derived pattern converters must override this method in order to + convert conversion specifiers in the correct way. - - - Extract the date from the - - - Nicko Cadell - Gert Driesen + that will receive the formatted result. + The on which the pattern converter should be executed. - + - Constructs a RawUtcTimeStampLayout + Derived pattern converters must override this method in order to + convert conversion specifiers in the correct way. + that will receive the formatted result. + The state object on which the pattern converter should be executed. - + - Gets the as a . + Flag indicating if this converter handles exceptions - The event to format - returns the time stamp - - Gets the as a . - - - The time stamp is in universal time. To format the time stamp - in local time use . - + false if this converter handles exceptions - + - A very simple layout + Property pattern converter - SimpleLayout consists of the level of the log statement, - followed by " - " and then the log message itself. For example, - - DEBUG - Hello world - + Writes out the value of a named property. The property name + should be set in the + property. + + + If the is set to null + then all the properties are written as key value pairs. Nicko Cadell - Gert Driesen - - - - Constructs a SimpleLayout - - + - Initialize layout options + Write the property value to the output + that will receive the formatted result. + the event being logged - This is part of the delayed object - activation scheme. The method must - be called on this object after the configuration properties have - been set. Until is called this - object is in an undefined state and must not be used. + Writes out the value of a named property. The property name + should be set in the + property. - If any of the configuration properties are modified then - must be called again. + If the is set to null + then all the properties are written as key value pairs. - + - Produces a simple formatted output. + Converter to output the relative time of the event - the event being logged - The TextWriter to write the formatted event to - Formats the event as the level of the even, - followed by " - " and then the log message itself. The - output is terminated by a newline. + Converter to output the time of the event relative to the start of the program. + Nicko Cadell - - - Layout that formats the log events as XML elements. - - - - The output of the 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 external entity - in a separate file to form a correct XML file. - - - For example, if abc is the name of the file where - the output goes, then a well-formed XML file would - be: - - - <?xml version="1.0" ?> - - <!DOCTYPE log4net:events SYSTEM "log4net-events.dtd" [<!ENTITY data SYSTEM "abc">]> - - <log4net:events version="1.2" xmlns:log4net="http://logging.apache.org/log4net/schemas/log4net-events-1.2> - &data; - </log4net:events> - - - This approach enforces the independence of the - and the appender where it is embedded. - - - The version attribute helps components to correctly - interpret output generated by . The value of - this attribute should be "1.2" for release 1.2 and later. - - - Alternatively the Header and Footer properties can be - configured to output the correct XML header, open tag and close tag. - When setting the Header and Footer properties it is essential - that the underlying data store not be appendable otherwise the data - will become invalid XML. - - - Nicko Cadell - Gert Driesen - - + - Layout that formats the log events as XML elements. + Write the relative time to the output + that will receive the formatted result. + the event being logged - This is an abstract class that must be subclassed by an implementation - to conform to a specific schema. - - - Deriving classes must implement the method. + Writes out the relative time of the event in milliseconds. + That is the number of milliseconds between the event + and the . - Nicko Cadell - Gert Driesen - + - Protected constructor to support subclasses + Helper method to get the time difference between two DateTime objects + + start time (in the current local time zone) + end time (in the current local time zone) + the time difference in milliseconds + + + + Write the caller stack frames to the output - Initializes a new instance of the class - with no location info. + Writes the to the output writer, using format: + type3.MethodCall3(type param,...) > type2.MethodCall2(type param,...) > type1.MethodCall1(type param,...) + Adam Davies - + - Protected constructor to support subclasses + The fully qualified type of the StackTraceDetailPatternConverter class. - - The parameter determines whether - location information will be output by the layout. If - is set to true, then the - file name and line number of the statement at the origin of the log - statement will be output. - - - If you are embedding this layout within an SMTPAppender - then make sure to set the LocationInfo option of that - appender as well. - + Used by the internal logger to record the Type of the + log message. - + - Initialize layout options + Write the caller stack frames to the output - This is part of the delayed object - activation scheme. The method must - be called on this object after the configuration properties have - been set. Until is called this - object is in an undefined state and must not be used. - - - If any of the configuration properties are modified then - must be called again. + Writes the to the output writer, using format: + type3.MethodCall3 > type2.MethodCall2 > type1.MethodCall1 + Michael Cromwell - + - Produces a formatted string. + Initialize the converter - The event being logged. - The TextWriter to write the formatted event to - Format the and write it to the . + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. - This method creates an that writes to the - . The is passed - to the method. Subclasses should override the - method rather than this method. + If any of the configuration properties are modified then + must be called again. - + - Does the actual writing of the XML. + Write the strack frames to the output - The writer to use to output the event to. - The event to write. + that will receive the formatted result. + the event being logged - Subclasses should override this method to format - the as XML. + Writes the to the output writer. - + - Flag to indicate if location information should be included in - the XML events. + Returns the Name of the method + + This method was created, so this class could be used as a base class for StackTraceDetailPatternConverter + string - + - The string to replace invalid chars with + The fully qualified type of the StackTracePatternConverter class. + + Used by the internal logger to record the Type of the + log message. + - + - Gets a value indicating whether to include location information in - the XML events. + Converter to include event thread name - - true if location information should be included in the XML - events; otherwise, false. - - If is set to true, then the file - name and line number of the statement at the origin of the log - statement will be output. + Writes the to the output. + + Nicko Cadell + + + + Write the ThreadName to the output + + that will receive the formatted result. + the event being logged + - If you are embedding this layout within an SMTPAppender - then make sure to set the LocationInfo option of that - appender as well. + Writes the to the . - + - The string to replace characters that can not be expressed in XML with. + Pattern converter for the class name + - Not all characters may be expressed in XML. This property contains the - string to replace those that can not with. This defaults to a ?. Set it - to the empty string to simply remove offending characters. For more - details on the allowed character ranges see http://www.w3.org/TR/REC-xml/#charsets - Character replacement will occur in the log message, the property names - and the property values. + Outputs the of the event. -
+ Nicko Cadell
- + - Gets the content type output by this layout. + Gets the fully qualified name of the class - - As this is the XML layout, the value is always "text/xml". - + the event being logged + The fully qualified type name for the caller location - As this is the XML layout, the value is always "text/xml". + Returns the of the . - + - Constructs an XmlLayout + Converter to include event user name + Douglas de la Torre + Nicko Cadell - + - Constructs an XmlLayout. + Convert the pattern to the rendered message - - - The LocationInfo 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. - - - If you are embedding this layout within an SmtpAppender - then make sure to set the LocationInfo option of that - appender as well. - - + that will receive the formatted result. + the event being logged - + - Initialize layout options + Write the TimeStamp to the output - This is part of the delayed object - activation scheme. The method must - be called on this object after the configuration properties have - been set. Until is called this - object is in an undefined state and must not be used. + Date pattern converter, uses a to format + the date of a . - If any of the configuration properties are modified then - must be called again. + Uses a to format the + in Universal time. - Builds a cache of the element names + See the for details on the date pattern syntax. + + Nicko Cadell - + - Does the actual writing of the XML. + Write the TimeStamp to the output - The writer to use to output the event to. - The event to write. + that will receive the formatted result. + the event being logged - Override the base class method - to write the to the . + Pass the to the + for it to render it to the writer. + + + The passed is in the local time zone, this is converted + to Universal time before it is rendered. + - + - The prefix to use for all generated element names + The fully qualified type of the UtcDatePatternConverter class. + + Used by the internal logger to record the Type of the + log message. + - + - The prefix to use for all element names + Type converter for the interface - The default prefix is log4net. Set this property - to change the prefix. If the prefix is set to an empty string - then no prefix will be written. + Used to convert objects to the interface. + Supports converting from the interface to + the interface using the . + Nicko Cadell + Gert Driesen - + - Set whether or not to base64 encode the message. + Can the sourceType be converted to an + the source to be to be converted + true if the source type can be converted to - 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 ) will not be performed - on the log message. + Test if the can be converted to a + . Only is supported + as the . - + - Set whether or not to base64 encode the property values. + Convert the value to a object + the value to convert + the object - 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 ) will not be performed - on the property values. + Convert the object to a + object. If the object + is a then the + is used to adapt between the two interfaces, otherwise an + exception is thrown. - + - Layout that formats the log events as XML elements compatible with the log4j schema + Extract the value of a property from the - Formats the log events according to the http://logging.apache.org/log4j schema. + Extract the value of a property from the Nicko Cadell - - - The 1st of January 1970 in UTC - - - - - Constructs an XMLLayoutSchemaLog4j - - - + - Constructs an XMLLayoutSchemaLog4j. + Constructs a RawPropertyLayout - - - The LocationInfo 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. - - - If you are embedding this layout within an SMTPAppender - then make sure to set the LocationInfo option of that - appender as well. - - - + - Actually do the writing of the xml + The name of the value to lookup in the LoggingEvent Properties collection. - the writer to use - the event to write + + Value to lookup in the LoggingEvent Properties collection + - Generate XML that is compatible with the log4j schema. + String name of the property to lookup in the . - + - The version of the log4j schema to use. + Lookup the property for + The event to format + returns property value - Only version 1.2 of the log4j schema is supported. + Looks up and returns the object value of the property + named . If there is no property defined + with than name then null will be returned. - + - The default object Renderer. + Extract the date from the - The default renderer supports rendering objects and collections to strings. - - - See the method for details of the output. + Extract the date from the Nicko Cadell Gert Driesen - + - Implement this interface in order to render objects as strings + Constructs a RawTimeStampLayout - - - Certain types require special case conversion to - string form. This conversion is done by an object renderer. - Object renderers implement the - interface. - - - Nicko Cadell - Gert Driesen - + - Render the object to a string + Gets the as a . - The map used to lookup renderers - The object to render - The writer to render to + The event to format + returns the time stamp - Render the object to a - string. + Gets the as a . - The parameter is - provided to lookup and render other objects. This is - very useful where contains - nested objects of unknown type. The - method can be used to render these objects. + The time stamp is in local time. To format the time stamp + in universal time use . - + - Default constructor + Extract the date from the - Default constructor + Extract the date from the + Nicko Cadell + Gert Driesen - + - Render the object to a string + Constructs a RawUtcTimeStampLayout - The map used to lookup renderers - The object to render - The writer to render to - - - Render the object to a string. - - - The parameter is - provided to lookup and render other objects. This is - very useful where contains - nested objects of unknown type. The - method can be used to render these objects. - - - The default renderer supports rendering objects to strings as follows: - - - - Value - Rendered String - - - null - - "(null)" - - - - - - - For a one dimensional array this is the - array type name, an open brace, followed by a comma - separated list of the elements (using the appropriate - renderer), followed by a close brace. - - - For example: int[] {1, 2, 3}. - - - If the array is not one dimensional the - Array.ToString() is returned. - - - - - , & - - - Rendered as an open brace, followed by a comma - separated list of the elements (using the appropriate - renderer), followed by a close brace. - - - For example: {a, b, c}. - - - All collection classes that implement its subclasses, - or generic equivalents all implement the interface. - - - - - - - - Rendered as the key, an equals sign ('='), and the value (using the appropriate - renderer). - - - For example: key=value. - - - - - other - - Object.ToString() - - - - - + - Render the array argument into a string + Gets the as a . - The map used to lookup renderers - the array to render - The writer to render to + The event to format + returns the time stamp - For a one dimensional array this is the - array type name, an open brace, followed by a comma - separated list of the elements (using the appropriate - renderer), followed by a close brace. For example: - int[] {1, 2, 3}. + Gets the as a . - If the array is not one dimensional the - Array.ToString() is returned. + The time stamp is in universal time. To format the time stamp + in local time use . - + - Render the enumerator argument into a string + A very simple layout - The map used to lookup renderers - the enumerator to render - The writer to render to - Rendered as an open brace, followed by a comma - separated list of the elements (using the appropriate - renderer), followed by a close brace. For example: - {a, b, c}. + SimpleLayout consists of the level of the log statement, + followed by " - " and then the log message itself. For example, + + DEBUG - Hello world + + Nicko Cadell + Gert Driesen - + - Render the DictionaryEntry argument into a string + Constructs a SimpleLayout - The map used to lookup renderers - the DictionaryEntry to render - The writer to render to - - - Render the key, an equals sign ('='), and the value (using the appropriate - renderer). For example: key=value. - - - + - Map class objects to an . + Initialize layout options - Maintains a mapping between types that require special - rendering and the that - is used to render them. + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. - The method is used to render an - object using the appropriate renderers defined in this map. + If any of the configuration properties are modified then + must be called again. - Nicko Cadell - Gert Driesen - + - Default Constructor + Produces a simple formatted output. + the event being logged + The TextWriter to write the formatted event to - Default constructor. - - + Formats the event as the level of the even, + followed by " - " and then the log message itself. The + output is terminated by a newline. + + - + + + Layout that formats the log events as XML elements. + + + + The output of the 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 external entity + in a separate file to form a correct XML file. + + + For example, if abc is the name of the file where + the output goes, then a well-formed XML file would + be: + + + <?xml version="1.0" ?> + + <!DOCTYPE log4net:events SYSTEM "log4net-events.dtd" [<!ENTITY data SYSTEM "abc">]> + + <log4net:events version="1.2" xmlns:log4net="http://logging.apache.org/log4net/schemas/log4net-events-1.2> + &data; + </log4net:events> + + + This approach enforces the independence of the + and the appender where it is embedded. + + + The version attribute helps components to correctly + interpret output generated by . The value of + this attribute should be "1.2" for release 1.2 and later. + + + Alternatively the Header and Footer properties can be + configured to output the correct XML header, open tag and close tag. + When setting the Header and Footer properties it is essential + that the underlying data store not be appendable otherwise the data + will become invalid XML. + + + Nicko Cadell + Gert Driesen + + - Render using the appropriate renderer. + Constructs an XmlLayout + + + + + Constructs an XmlLayout. - the object to render to a string - the object rendered as a string - This is a convenience method used to render an object to a string. - The alternative method - should be used when streaming output to a . + The LocationInfo 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. + + + If you are embedding this layout within an SmtpAppender + then make sure to set the LocationInfo option of that + appender as well. - + - Render using the appropriate renderer. + The prefix to use for all element names - the object to render to a string - The writer to render to - Find the appropriate renderer for the type of the - parameter. This is accomplished by calling the - method. Once a renderer is found, it is - applied on the object and the result is returned - as a . + The default prefix is log4net. Set this property + to change the prefix. If the prefix is set to an empty string + then no prefix will be written. - + - Gets the renderer for the specified object type + Set whether or not to base64 encode the message. - the object to lookup the renderer for - the renderer for - - Gets the renderer for the specified object type. - - - Syntactic sugar method that calls - with the type of the object parameter. - + + 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 ) will not be performed + on the log message. + - + - Gets the renderer for the specified type + Set whether or not to base64 encode the property values. - the type to lookup the renderer for - the renderer for the specified type - Returns the renderer for the specified type. - If no specific renderer has been defined the - will be returned. + 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 ) will not be performed + on the property values. - + - Internal function to recursively search interfaces + Initialize layout options - the type to lookup the renderer for - the renderer for the specified type + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + Builds a cache of the element names + + - + - Clear the map of renderers + Does the actual writing of the XML. + The writer to use to output the event to. + The event to write. - Clear the custom renderers defined by using - . The - cannot be removed. + Override the base class method + to write the to the . - + - Register an for . + The prefix to use for all generated element names + + + + + Layout that formats the log events as XML elements. - the type that will be rendered by - the renderer for - Register an object renderer for a specific source type. - This renderer will be returned from a call to - specifying the same as an argument. + This is an abstract class that must be subclassed by an implementation + to conform to a specific schema. + + + Deriving classes must implement the method. + Nicko Cadell + Gert Driesen - + - Get the default renderer instance + Protected constructor to support subclasses - the default renderer - Get the default renderer + Initializes a new instance of the class + with no location info. - + - Interface implemented by logger repository plugins. + Protected constructor to support subclasses - Plugins define additional behavior that can be associated - with a . - The held by the - property is used to store the plugins for a repository. + The parameter determines whether + location information will be output by the layout. If + is set to true, then the + file name and line number of the statement at the origin of the log + statement will be output. - The log4net.Config.PluginAttribute can be used to - attach plugins to repositories created using configuration - attributes. + If you are embedding this layout within an SMTPAppender + then make sure to set the LocationInfo option of that + appender as well. - Nicko Cadell - Gert Driesen - + - Attaches the plugin to the specified . + Gets a value indicating whether to include location information in + the XML events. - The that this plugin should be attached to. + + true if location information should be included in the XML + events; otherwise, false. + - A plugin may only be attached to a single repository. + If is set to true, then the file + name and line number of the statement at the origin of the log + statement will be output. - This method is called when the plugin is attached to the repository. + If you are embedding this layout within an SMTPAppender + then make sure to set the LocationInfo option of that + appender as well. - + - Is called when the plugin is to shutdown. - + The string to replace characters that can not be expressed in XML with. - This method is called to notify the plugin that - it should stop operating and should detach from - the repository. + Not all characters may be expressed in XML. This property contains the + string to replace those that can not with. This defaults to a ?. Set it + to the empty string to simply remove offending characters. For more + details on the allowed character ranges see http://www.w3.org/TR/REC-xml/#charsets + Character replacement will occur in the log message, the property names + and the property values. +
- + - Gets the name of the plugin. + Initialize layout options - - The name of the plugin. - - Plugins are stored in the - keyed by name. Each plugin instance attached to a - repository must be a unique name. + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. - + - A strongly-typed collection of objects. + Gets the content type output by this layout. - Nicko Cadell - - - - Creates a read-only wrapper for a PluginCollection instance. - - list to create a readonly wrapper arround - - A PluginCollection wrapper that is read-only. - + + As this is the XML layout, the value is always "text/xml". + + + + As this is the XML layout, the value is always "text/xml". + + - + - Initializes a new instance of the PluginCollection class - that is empty and has the default initial capacity. + Produces a formatted string. + The event being logged. + The TextWriter to write the formatted event to + + + Format the and write it to the . + + + This method creates an that writes to the + . The is passed + to the method. Subclasses should override the + method rather than this method. + + - + - Initializes a new instance of the PluginCollection class - that has the specified initial capacity. + Does the actual writing of the XML. - - The number of elements that the new PluginCollection is initially capable of storing. - + The writer to use to output the event to. + The event to write. + + + Subclasses should override this method to format + the as XML. + + - + - Initializes a new instance of the PluginCollection class - that contains elements copied from the specified PluginCollection. + Flag to indicate if location information should be included in + the XML events. - The PluginCollection whose elements are copied to the new collection. - + - Initializes a new instance of the PluginCollection class - that contains elements copied from the specified array. + The string to replace invalid chars with - The array whose elements are copied to the new list. - + - Initializes a new instance of the PluginCollection class - that contains elements copied from the specified collection. + Layout that formats the log events as XML elements compatible with the log4j schema - The collection whose elements are copied to the new list. + + + Formats the log events according to the http://logging.apache.org/log4j schema. + + + Nicko Cadell - + - Allow subclasses to avoid our default constructors + The 1st of January 1970 in UTC - - - + - Copies the entire PluginCollection to a one-dimensional - array. + Constructs an XMLLayoutSchemaLog4j - The one-dimensional array to copy to. - + - Copies the entire PluginCollection to a one-dimensional - array, starting at the specified index of the target array. + Constructs an XMLLayoutSchemaLog4j. - The one-dimensional array to copy to. - The zero-based index in at which copying begins. + + + The LocationInfo 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. + + + If you are embedding this layout within an SMTPAppender + then make sure to set the LocationInfo option of that + appender as well. + + - + - Adds a to the end of the PluginCollection. + The version of the log4j schema to use. - The to be added to the end of the PluginCollection. - The index at which the value has been added. + + + Only version 1.2 of the log4j schema is supported. + + - + - Removes all elements from the PluginCollection. + Actually do the writing of the xml + the writer to use + the event to write + + + Generate XML that is compatible with the log4j schema. + + - + - Creates a shallow copy of the . + The log4net Logical Thread Context. - A new with a shallow copy of the collection data. + + + The LogicalThreadContext provides a location for specific debugging + information to be stored. + The LogicalThreadContext properties override any or + properties with the same name. + + + For .NET Standard 1.3 this class uses + System.Threading.AsyncLocal rather than . + + + The Logical Thread Context has a properties map and a stack. + The properties and stack can + be included in the output of log messages. The + supports selecting and outputting these properties. + + + The Logical Thread Context provides a diagnostic context for the current call context. + This is an instrument for distinguishing interleaved log + output from different sources. Log output is typically interleaved + when a server handles multiple clients near-simultaneously. + + + The Logical Thread Context is managed on a per basis. + + + The requires a link time + for the + . + If the calling code does not have this permission then this context will be disabled. + It will not store any property values set on it. + + + Example of using the thread context properties to store a username. + + LogicalThreadContext.Properties["user"] = userName; + log.Info("This log message has a LogicalThreadContext Property called 'user'"); + + + Example of how to push a message into the context stack + + using(LogicalThreadContext.Stacks["LDC"].Push("my context message")) + { + log.Info("This log message has a LogicalThreadContext Stack message that includes 'my context message'"); + + } // at the end of the using block the message is automatically popped + + + + Nicko Cadell - + - Determines whether a given is in the PluginCollection. + Private Constructor. - The to check for. - true if is found in the PluginCollection; otherwise, false. + + + Uses a private access modifier to prevent instantiation of this class. + + - + - Returns the zero-based index of the first occurrence of a - in the PluginCollection. + The thread properties map - The to locate in the PluginCollection. - - The zero-based index of the first occurrence of - in the entire PluginCollection, if found; otherwise, -1. - + + The thread properties map + + + + The LogicalThreadContext properties override any + or properties with the same name. + + - + - Inserts an element into the PluginCollection at the specified index. + The thread stacks - The zero-based index at which should be inserted. - The to insert. - - is less than zero - -or- - is equal to or greater than . - + + stack map + + + + The logical thread stacks. + + - + - Removes the first occurrence of a specific from the PluginCollection. + The thread context properties instance - The to remove from the PluginCollection. - - The specified was not found in the PluginCollection. - - + - Removes the element at the specified index of the PluginCollection. + The thread context stacks instance - The zero-based index of the element to remove. - - is less than zero. - -or- - is equal to or greater than . - - + - Returns an enumerator that can iterate through the PluginCollection. + This class is used by client applications to request logger instances. - An for the entire PluginCollection. - - - - Adds the elements of another PluginCollection to the current PluginCollection. - - The PluginCollection whose elements should be added to the end of the current PluginCollection. - The new of the PluginCollection. - - - - Adds the elements of a array to the current PluginCollection. - - The array whose elements should be added to the end of the PluginCollection. - The new of the PluginCollection. + + + This class has static methods that are used by a client to request + a logger instance. The method is + used to retrieve a logger. + + + See the interface for more details. + + + Simple example of logging messages + + ILog log = LogManager.GetLogger("application-log"); + + log.Info("Application Start"); + log.Debug("This is a debug message"); + + if (log.IsDebugEnabled) + { + log.Debug("This is another debug message"); + } + + + + + Nicko Cadell + Gert Driesen - + - Adds the elements of a collection to the current PluginCollection. + Initializes a new instance of the class. - The collection whose elements should be added to the end of the PluginCollection. - The new of the PluginCollection. + + Uses a private access modifier to prevent instantiation of this class. + - + + Returns the named logger if it exists. - Sets the capacity to the actual number of elements. + Returns the named logger if it exists. + + + If the named logger exists (in the default repository) then it + returns a reference to the logger, otherwise it returns null. + + + The fully qualified logger name to look for. + The logger found, or null if no logger could be found. - - - is less than zero. - -or- - is equal to or greater than . - - - - - is less than zero. - -or- - is equal to or greater than . - - - + + Get the currently defined loggers. - Gets the number of elements actually contained in the PluginCollection. + Returns all the currently defined loggers in the default repository. + + The root logger is not included in the returned array. + + All the defined loggers. - + + Get or create a logger. - Gets a value indicating whether access to the collection is synchronized (thread-safe). + Retrieves or creates a named logger. - false, because the backing type is an array, which is never thread-safe. + + + Retrieves a logger named as the + parameter. If the named logger already exists, then the + existing instance will be returned. Otherwise, a new instance is + created. + + By default, loggers do not have a set level but inherit + it from the hierarchy. This is one of the central features of + log4net. + + + The name of the logger to retrieve. + The logger with the name specified. - + - Gets an object that can be used to synchronize access to the collection. + Returns the named logger if it exists. - - An object that can be used to synchronize access to the collection. - + + + If the named logger exists (in the specified repository) then it + returns a reference to the logger, otherwise it returns + null. + + + The repository to lookup in. + The fully qualified logger name to look for. + + The logger found, or null if the logger doesn't exist in the specified + repository. + - + - Gets or sets the at the specified index. + Returns the named logger if it exists. - - The at the specified index. - - The zero-based index of the element to get or set. - - is less than zero. - -or- - is equal to or greater than . - + + + If the named logger exists (in the repository for the specified assembly) then it + returns a reference to the logger, otherwise it returns + null. + + + The assembly to use to lookup the repository. + The fully qualified logger name to look for. + + The logger, or null if the logger doesn't exist in the specified + assembly's repository. + - + - Gets a value indicating whether the collection has a fixed size. + Returns all the currently defined loggers in the specified repository. - true if the collection has a fixed size; otherwise, false. The default is false. + The repository to lookup in. + + The root logger is not included in the returned array. + + All the defined loggers. - + - Gets a value indicating whether the IList is read-only. + Returns all the currently defined loggers in the specified assembly's repository. - true if the collection is read-only; otherwise, false. The default is false. + The assembly to use to lookup the repository. + + The root logger is not included in the returned array. + + All the defined loggers. - + - Gets or sets the number of elements the PluginCollection can contain. + Retrieves or creates a named logger. - - The number of elements the PluginCollection can contain. - + + + Retrieve a logger named as the + parameter. If the named logger already exists, then the + existing instance will be returned. Otherwise, a new instance is + created. + + + By default, loggers do not have a set level but inherit + it from the hierarchy. This is one of the central features of + log4net. + + + The repository to lookup in. + The name of the logger to retrieve. + The logger with the name specified. - + - Supports type-safe iteration over a . + Retrieves or creates a named logger. - + + + Retrieve a logger named as the + parameter. If the named logger already exists, then the + existing instance will be returned. Otherwise, a new instance is + created. + + + By default, loggers do not have a set level but inherit + it from the hierarchy. This is one of the central features of + log4net. + + + The assembly to use to lookup the repository. + The name of the logger to retrieve. + The logger with the name specified. - + - Advances the enumerator to the next element in the collection. + Shorthand for . - - true if the enumerator was successfully advanced to the next element; - false if the enumerator has passed the end of the collection. - - - The collection was modified after the enumerator was created. - + + Get the logger for the fully qualified name of the type specified. + + The full name of will be used as the name of the logger to retrieve. + The logger with the name specified. - + - Sets the enumerator to its initial position, before the first element in the collection. + Shorthand for . + + Gets the logger for the fully qualified name of the type specified. + + The repository to lookup in. + The full name of will be used as the name of the logger to retrieve. + The logger with the name specified. - + - Gets the current element in the collection. + Shorthand for . + + Gets the logger for the fully qualified name of the type specified. + + The assembly to use to lookup the repository. + The full name of will be used as the name of the logger to retrieve. + The logger with the name specified. - + - Type visible only to our subclasses - Used to access protected constructor + Shuts down the log4net system. - - - - - A value + + + Calling this method will safely close and remove all + appenders in all the loggers including root contained in all the + default repositories. + + + Some appenders need to be closed before the application exists. + Otherwise, pending logging events might be lost. + + The shutdown method is careful to close nested + appenders before closing regular appenders. This is allows + configurations where a regular appender is attached to a logger + and again to a nested appender. + + + + + Shutdown a logger repository. + + Shuts down the default repository. + + + + Calling this method will safely close and remove all + appenders in all the loggers including root contained in the + default repository. + + Some appenders need to be closed before the application exists. + Otherwise, pending logging events might be lost. + + The shutdown method is careful to close nested + appenders before closing regular appenders. This is allows + configurations where a regular appender is attached to a logger + and again to a nested appender. + + + + + + Shuts down the repository for the repository specified. + + + + Calling this method will safely close and remove all + appenders in all the loggers including root contained in the + specified. + + + Some appenders need to be closed before the application exists. + Otherwise, pending logging events might be lost. + + The shutdown method is careful to close nested + appenders before closing regular appenders. This is allows + configurations where a regular appender is attached to a logger + and again to a nested appender. + + + The repository to shutdown. + + + + Shuts down the repository specified. + + + + Calling this method will safely close and remove all + appenders in all the loggers including root contained in the + repository. The repository is looked up using + the specified. + + + Some appenders need to be closed before the application exists. + Otherwise, pending logging events might be lost. + + + The shutdown method is careful to close nested + appenders before closing regular appenders. This is allows + configurations where a regular appender is attached to a logger + and again to a nested appender. + + + The assembly to use to lookup the repository. + + + Reset the configuration of a repository + + Resets all values contained in this repository instance to their defaults. + + + + Resets all values contained in the repository instance to their + defaults. This removes all appenders from all loggers, sets + the level of all non-root loggers to null, + sets their additivity flag to true and sets the level + of the root logger to . Moreover, + message disabling is set to its default "off" value. + + + + + + Resets all values contained in this repository instance to their defaults. + + + + Reset all values contained in the repository instance to their + defaults. This removes all appenders from all loggers, sets + the level of all non-root loggers to null, + sets their additivity flag to true and sets the level + of the root logger to . Moreover, + message disabling is set to its default "off" value. + + + The repository to reset. + + + + Resets all values contained in this repository instance to their defaults. + + + + Reset all values contained in the repository instance to their + defaults. This removes all appenders from all loggers, sets + the level of all non-root loggers to null, + sets their additivity flag to true and sets the level + of the root logger to . Moreover, + message disabling is set to its default "off" value. + + + The assembly to use to lookup the repository to reset. + + + Get the logger repository. + + Returns the default instance. + + + + Gets the for the repository specified + by the callers assembly (). + + + The instance for the default repository. + + + + Returns the default instance. + + The default instance. + + + Gets the for the repository specified + by the argument. + + + The repository to lookup in. + + + + Returns the default instance. + + The default instance. + + + Gets the for the repository specified + by the argument. + + + The assembly to use to lookup the repository. + + + Get a logger repository. + + Returns the default instance. + + + + Gets the for the repository specified + by the callers assembly (). + + + The instance for the default repository. + + + + Returns the default instance. + + The default instance. + + + Gets the for the repository specified + by the argument. + + + The repository to lookup in. + + + + Returns the default instance. + + The default instance. + + + Gets the for the repository specified + by the argument. + + + The assembly to use to lookup the repository. + + + Create a domain + + Creates a repository with the specified repository type. + + + + CreateDomain is obsolete. Use CreateRepository instead of CreateDomain. + + + The created will be associated with the repository + specified such that a call to will return + the same repository instance. + + + A that implements + and has a no arg constructor. An instance of this type will be created to act + as the for the repository specified. + The created for the repository. + + + Create a logger repository. + + Creates a repository with the specified repository type. + + A that implements + and has a no arg constructor. An instance of this type will be created to act + as the for the repository specified. + The created for the repository. + + + The created will be associated with the repository + specified such that a call to will return + the same repository instance. + + + + + + Creates a repository with the specified name. + + + + CreateDomain is obsolete. Use CreateRepository instead of CreateDomain. + + + Creates the default type of which is a + object. + + + The name must be unique. Repositories cannot be redefined. + An will be thrown if the repository already exists. + + + The name of the repository, this must be unique amongst repositories. + The created for the repository. + The specified repository already exists. + + + + Creates a repository with the specified name. + + + + Creates the default type of which is a + object. + + + The name must be unique. Repositories cannot be redefined. + An will be thrown if the repository already exists. + + + The name of the repository, this must be unique amongst repositories. + The created for the repository. + The specified repository already exists. + + + + Creates a repository with the specified name and repository type. + + + + CreateDomain is obsolete. Use CreateRepository instead of CreateDomain. + + + The name must be unique. Repositories cannot be redefined. + An will be thrown if the repository already exists. + + + The name of the repository, this must be unique to the repository. + A that implements + and has a no arg constructor. An instance of this type will be created to act + as the for the repository specified. + The created for the repository. + The specified repository already exists. + + + + Creates a repository with the specified name and repository type. + + + + The name must be unique. Repositories cannot be redefined. + An will be thrown if the repository already exists. + + + The name of the repository, this must be unique to the repository. + A that implements + and has a no arg constructor. An instance of this type will be created to act + as the for the repository specified. + The created for the repository. + The specified repository already exists. + + + + Creates a repository for the specified assembly and repository type. + + + + CreateDomain is obsolete. Use CreateRepository instead of CreateDomain. + + + The created will be associated with the repository + specified such that a call to with the + same assembly specified will return the same repository instance. + + + The assembly to use to get the name of the repository. + A that implements + and has a no arg constructor. An instance of this type will be created to act + as the for the repository specified. + The created for the repository. + + + + Creates a repository for the specified assembly and repository type. + + + + The created will be associated with the repository + specified such that a call to with the + same assembly specified will return the same repository instance. + + + The assembly to use to get the name of the repository. + A that implements + and has a no arg constructor. An instance of this type will be created to act + as the for the repository specified. + The created for the repository. + + + + Gets the list of currently defined repositories. + + + + Get an array of all the objects that have been created. + + + An array of all the known objects. + + + + Flushes logging events buffered in all configured appenders in the default repository. + + The maximum time in milliseconds to wait for logging events from asycnhronous appenders to be flushed. + True if all logging events were flushed successfully, else false. + + + + Looks up the wrapper object for the logger specified. + + The logger to get the wrapper for. + The wrapper for the logger specified. + + + + Looks up the wrapper objects for the loggers specified. + + The loggers to get the wrappers for. + The wrapper objects for the loggers specified. + + + + Create the objects used by + this manager. + + The logger to wrap. + The wrapper for the logger specified. + + + + The wrapper map to use to hold the objects. + + + + + Implementation of Mapped Diagnostic Contexts. + + + + + The MDC is deprecated and has been replaced by the . + The current MDC implementation forwards to the ThreadContext.Properties. + + + + The MDC class is similar to the class except that it is + based on a map instead of a stack. It provides mapped + diagnostic contexts. A Mapped Diagnostic Context, or + MDC in short, is an instrument for distinguishing interleaved log + output from different sources. Log output is typically interleaved + when a server handles multiple clients near-simultaneously. + + + The MDC is managed on a per thread basis. + + + + Nicko Cadell + Gert Driesen + + + + Initializes a new instance of the class. + + Uses a private access modifier to prevent instantiation of this class. + - + - Supports simple iteration over a . + Gets the context value identified by the parameter. - + The key to lookup in the MDC. + The string value held for the key, or a null reference if no corresponding value is found. + + + + The MDC is deprecated and has been replaced by the . + The current MDC implementation forwards to the ThreadContext.Properties. + + + + If the parameter does not look up to a + previously defined context then null will be returned. + + - + - Initializes a new instance of the Enumerator class. + Add an entry to the MDC - + The key to store the value under. + The value to store. + + + + The MDC is deprecated and has been replaced by the . + The current MDC implementation forwards to the ThreadContext.Properties. + + + + Puts a context value (the parameter) as identified + with the parameter into the current thread's + context map. + + + If a value is already defined for the + specified then the value will be replaced. If the + is specified as null then the key value mapping will be removed. + + + + + + Removes the key value mapping for the key specified. + + The key to remove. + + + + The MDC is deprecated and has been replaced by the . + The current MDC implementation forwards to the ThreadContext.Properties. + + + + Remove the specified entry from this thread's MDC + + + + + + Clear all entries in the MDC + + + + + The MDC is deprecated and has been replaced by the . + The current MDC implementation forwards to the ThreadContext.Properties. + + + + Remove all the entries from this thread's MDC + + + + + + Implementation of Nested Diagnostic Contexts. + + + + + The NDC is deprecated and has been replaced by the . + The current NDC implementation forwards to the ThreadContext.Stacks["NDC"]. + + + + A Nested Diagnostic Context, or NDC in short, is an instrument + to distinguish interleaved log output from different sources. Log + output is typically interleaved when a server handles multiple + clients near-simultaneously. + + + Interleaved log output can still be meaningful if each log entry + from different contexts had a distinctive stamp. This is where NDCs + come into play. + + + Note that NDCs are managed on a per thread basis. The NDC class + is made up of static methods that operate on the context of the + calling thread. + + + How to push a message into the context + + using(NDC.Push("my context message")) + { + ... all log calls will have 'my context message' included ... + + } // at the end of the using block the message is automatically removed + + + + Nicko Cadell + Gert Driesen + + + + Initializes a new instance of the class. + + + Uses a private access modifier to prevent instantiation of this class. + + + + + Gets the current context depth. + + The current context depth. + + + + The NDC is deprecated and has been replaced by the . + The current NDC implementation forwards to the ThreadContext.Stacks["NDC"]. + + + + The number of context values pushed onto the context stack. + + + Used to record the current depth of the context. This can then + be restored using the method. + + + + + + + Clears all the contextual information held on the current thread. + + + + + The NDC is deprecated and has been replaced by the . + The current NDC implementation forwards to the ThreadContext.Stacks["NDC"]. + + + + Clears the stack of NDC data held on the current thread. + + + + + + Creates a clone of the stack of context information. + + A clone of the context info for this thread. + + + + The NDC is deprecated and has been replaced by the . + The current NDC implementation forwards to the ThreadContext.Stacks["NDC"]. + + + + The results of this method can be passed to the + method to allow child threads to inherit the context of their + parent thread. + + + + + + Inherits the contextual information from another thread. + + The context stack to inherit. + + + + The NDC is deprecated and has been replaced by the . + The current NDC implementation forwards to the ThreadContext.Stacks["NDC"]. + + + + This thread will use the context information from the stack + supplied. This can be used to initialize child threads with + the same contextual information as their parent threads. These + contexts will NOT be shared. Any further contexts that + are pushed onto the stack will not be visible to the other. + Call to obtain a stack to pass to + this method. + + + + + + Removes the top context from the stack. + + + The message in the context that was removed from the top + of the stack. + + + + + The NDC is deprecated and has been replaced by the . + The current NDC implementation forwards to the ThreadContext.Stacks["NDC"]. + + + + Remove the top context from the stack, and return + it to the caller. If the stack is empty then an + empty string (not null) is returned. + + + + + + Pushes a new context message. + + The new context message. + + An that can be used to clean up + the context stack. + + + + + The NDC is deprecated and has been replaced by the . + The current NDC implementation forwards to the ThreadContext.Stacks["NDC"]. + + + + Pushes a new context onto the context stack. An + is returned that can be used to clean up the context stack. This + can be easily combined with the using keyword to scope the + context. + + + Simple example of using the Push method with the using keyword. + + using(log4net.NDC.Push("NDC_Message")) + { + log.Warn("This should have an NDC message"); + } + + - + - Advances the enumerator to the next element in the collection. + Pushes a new context message. + The new context message string format. + Arguments to be passed into messageFormat. - true if the enumerator was successfully advanced to the next element; - false if the enumerator has passed the end of the collection. + An that can be used to clean up + the context stack. - - The collection was modified after the enumerator was created. - + + + + The NDC is deprecated and has been replaced by the . + The current NDC implementation forwards to the ThreadContext.Stacks["NDC"]. + + + + Pushes a new context onto the context stack. An + is returned that can be used to clean up the context stack. This + can be easily combined with the using keyword to scope the + context. + + + Simple example of using the Push method with the using keyword. + + var someValue = "ExampleContext" + using(log4net.NDC.PushFormat("NDC_Message {0}", someValue)) + { + log.Warn("This should have an NDC message"); + } + + - + - Sets the enumerator to its initial position, before the first element in the collection. + Removes the context information for this thread. It is + not required to call this method. + + + + The NDC is deprecated and has been replaced by the . + The current NDC implementation forwards to the ThreadContext.Stacks["NDC"]. + + + + This method is not implemented. + + - + - Gets the current element in the collection. + Forces the stack depth to be at most . - - The current element in the collection. - - - - + The maximum depth of the stack + + + + The NDC is deprecated and has been replaced by the . + The current NDC implementation forwards to the ThreadContext.Stacks["NDC"]. + + + + Forces the stack depth to be at most . + This may truncate the head of the stack. This only affects the + stack in the current thread. Also it does not prevent it from + growing, it only sets the maximum depth at the time of the + call. This can be used to return to a known context depth. + + - + - Map of repository plugins. + The default object Renderer. - This class is a name keyed map of the plugins that are - attached to a repository. + The default renderer supports rendering objects and collections to strings. + + + See the method for details of the output. Nicko Cadell Gert Driesen - + - Constructor + Default constructor - The repository that the plugins should be attached to. - Initialize a new instance of the class with a - repository that the plugins should be attached to. + Default constructor - + - Adds a to the map. + Render the object to a string - The to add to the map. + The map used to lookup renderers + The object to render + The writer to render to - The will be attached to the repository when added. + Render the object to a string. - If there already exists a plugin with the same name - attached to the repository then the old plugin will - be and replaced with - the new plugin. + The parameter is + provided to lookup and render other objects. This is + very useful where contains + nested objects of unknown type. The + method can be used to render these objects. + + + The default renderer supports rendering objects to strings as follows: + + + Value + Rendered String + + + null + + "(null)" + + + + + + + For a one dimensional array this is the + array type name, an open brace, followed by a comma + separated list of the elements (using the appropriate + renderer), followed by a close brace. + + + For example: int[] {1, 2, 3}. + + + If the array is not one dimensional the + Array.ToString() is returned. + + + + + , & + + + Rendered as an open brace, followed by a comma + separated list of the elements (using the appropriate + renderer), followed by a close brace. + + + For example: {a, b, c}. + + + All collection classes that implement its subclasses, + or generic equivalents all implement the interface. + + + + + + + + Rendered as the key, an equals sign ('='), and the value (using the appropriate + renderer). + + + For example: key=value. + + + + + other + + Object.ToString() + + + - + - Removes a from the map. + Render the array argument into a string - The to remove from the map. + The map used to lookup renderers + the array to render + The writer to render to - Remove a specific plugin from this map. - + For a one dimensional array this is the + array type name, an open brace, followed by a comma + separated list of the elements (using the appropriate + renderer), followed by a close brace. For example: + int[] {1, 2, 3}. + + + If the array is not one dimensional the + Array.ToString() is returned. + - + - Gets a by name. + Render the enumerator argument into a string - The name of the to lookup. - - The from the map with the name specified, or - null if no plugin is found. - + The map used to lookup renderers + the enumerator to render + The writer to render to - Lookup a plugin by name. If the plugin is not found null - will be returned. - + Rendered as an open brace, followed by a comma + separated list of the elements (using the appropriate + renderer), followed by a close brace. For example: + {a, b, c}. + - + - Gets all possible plugins as a list of objects. + Render the DictionaryEntry argument into a string - All possible plugins as a list of objects. + The map used to lookup renderers + the DictionaryEntry to render + The writer to render to - Get a collection of all the plugins defined in this map. - + Render the key, an equals sign ('='), and the value (using the appropriate + renderer). For example: key=value. + - + - Base implementation of + Implement this interface in order to render objects as strings - Default abstract implementation of the - interface. This base class can be used by implementors - of the interface. + Certain types require special case conversion to + string form. This conversion is done by an object renderer. + Object renderers implement the + interface. Nicko Cadell Gert Driesen - + - Constructor + Render the object to a string - the name of the plugin + The map used to lookup renderers + The object to render + The writer to render to - Initializes a new Plugin with the specified name. + + Render the object to a + string. + + + The parameter is + provided to lookup and render other objects. This is + very useful where contains + nested objects of unknown type. The + method can be used to render these objects. + - + - Attaches this plugin to a . + Map class objects to an . - The that this plugin should be attached to. - A plugin may only be attached to a single repository. + Maintains a mapping between types that require special + rendering and the that + is used to render them. - This method is called when the plugin is attached to the repository. + The method is used to render an + object using the appropriate renderers defined in this map. + Nicko Cadell + Gert Driesen - + - Is called when the plugin is to shutdown. + Render using the appropriate renderer. + the object to render to a string + the object rendered as a string - This method is called to notify the plugin that - it should stop operating and should detach from - the repository. + This is a convenience method used to render an object to a string. + The alternative method + should be used when streaming output to a . - + - The name of this plugin. + Render using the appropriate renderer. + the object to render to a string + The writer to render to + + + Find the appropriate renderer for the type of the + parameter. This is accomplished by calling the + method. Once a renderer is found, it is + applied on the object and the result is returned + as a . + + - + - The repository this plugin is attached to. + Gets the renderer for the specified object type + + the object to lookup the renderer for + the renderer for + + + Gets the renderer for the specified object type. + + + Syntactic sugar method that calls + with the type of the object parameter. + + + + + + Gets the renderer for the specified type + + the type to lookup the renderer for + the renderer for the specified type + + + Returns the renderer for the specified type. + If no specific renderer has been defined the + will be returned. + + + + + + Internal function to recursively search interfaces + the type to lookup the renderer for + the renderer for the specified type - + - Gets or sets the name of the plugin. + Get the default renderer instance - - The name of the plugin. - + the default renderer - Plugins are stored in the - keyed by name. Each plugin instance attached to a - repository must be a unique name. - - - The name of the plugin must not change one the - plugin has been attached to a repository. + Get the default renderer - + - The repository for this plugin + Clear the map of renderers - - The that this plugin is attached to. - - Gets or sets the that this plugin is - attached to. + Clear the custom renderers defined by using + . The + cannot be removed. - + - Plugin that listens for events from the + Register an for . + the type that will be rendered by + the renderer for - This plugin publishes an instance of - on a specified . This listens for logging events delivered from - a remote . - - - When an event is received it is relogged within the attached repository - as if it had been raised locally. + Register an object renderer for a specific source type. + This renderer will be returned from a call to + specifying the same as an argument. - Nicko Cadell - Gert Driesen - + - Default constructor + Interface implemented by logger repository plugins. - Initializes a new instance of the class. + Plugins define additional behavior that can be associated + with a . + The held by the + property is used to store the plugins for a repository. - The property must be set. + The log4net.Config.PluginAttribute can be used to + attach plugins to repositories created using configuration + attributes. + Nicko Cadell + Gert Driesen - + - Construct with sink Uri. + Gets the name of the plugin. - The name to publish the sink under in the remoting infrastructure. - See for more details. + + The name of the plugin. + - Initializes a new instance of the class - with specified name. + Plugins are stored in the + keyed by name. Each plugin instance attached to a + repository must be a unique name. - + - Attaches this plugin to a . + Attaches the plugin to the specified . The that this plugin should be attached to. @@ -21332,1896 +21699,1803 @@ - + Is called when the plugin is to shutdown. - When the plugin is shutdown the remote logging - sink is disconnected. + This method is called to notify the plugin that + it should stop operating and should detach from + the repository. - + - The fully qualified type of the RemoteLoggingServerPlugin class. + Interface used to create plugins. - Used by the internal logger to record the Type of the - log message. + + Interface used to create a plugin. + + Nicko Cadell + Gert Driesen - + - Gets or sets the URI of this sink. + Creates the plugin object. - - The URI of this sink. - + the new plugin instance - This is the name under which the object is marshaled. - + Create and return a new plugin instance. - + - Delivers objects to a remote sink. + A strongly-typed collection of objects. - - - Internal class used to listen for logging events - and deliver them to the local repository. - - + Nicko Cadell - + - Constructor + Supports type-safe iteration over a . - The repository to log to. - - - Initializes a new instance of the for the - specified . - - + - + - Logs the events to the repository. + Gets the current element in the collection. - The events to log. - - - The events passed are logged to the - - - + - Obtains a lifetime service object to control the lifetime - policy for this instance. + Advances the enumerator to the next element in the collection. - null to indicate that this instance should live forever. - - - Obtains a lifetime service object to control the lifetime - policy for this instance. This object should live forever - therefore this implementation returns null. - - + + true if the enumerator was successfully advanced to the next element; + false if the enumerator has passed the end of the collection. + + + The collection was modified after the enumerator was created. + - + - The underlying that events should - be logged to. + Sets the enumerator to its initial position, before the first element in the collection. - + - Default implementation of + Creates a read-only wrapper for a PluginCollection instance. - - - This default implementation of the - interface is used to create the default subclass - of the object. - - - Nicko Cadell - Gert Driesen + list to create a readonly wrapper arround + + A PluginCollection wrapper that is read-only. + - + - Interface abstracts creation of instances + Initializes a new instance of the PluginCollection class + that is empty and has the default initial capacity. - - - This interface is used by the to - create new objects. - - - The method is called - to create a named . - - - Implement this interface to create new subclasses of . - - - Nicko Cadell - Gert Driesen - + + + Initializes a new instance of the PluginCollection class + that has the specified initial capacity. + + + The number of elements that the new PluginCollection is initially capable of storing. + + + - Create a new instance + Initializes a new instance of the PluginCollection class + that contains elements copied from the specified PluginCollection. - The that will own the . - The name of the . - The instance for the specified name. - - - Create a new instance with the - specified name. - - - Called by the to create - new named instances. - - - If the is null then the root logger - must be returned. - - + The PluginCollection whose elements are copied to the new collection. - + - Default constructor + Initializes a new instance of the PluginCollection class + that contains elements copied from the specified array. - - - Initializes a new instance of the class. - - + The array whose elements are copied to the new list. - + - Create a new instance + Initializes a new instance of the PluginCollection class + that contains elements copied from the specified collection. + + The collection whose elements are copied to the new list. + + + + Type visible only to our subclasses + Used to access protected constructor + + + + + + A value - The that will own the . - The name of the . - The instance for the specified name. - - - Create a new instance with the - specified name. - - - Called by the to create - new named instances. - - - If the is null then the root logger - must be returned. - - - + - Default internal subclass of + Allow subclasses to avoid our default constructors - - - This subclass has no additional behavior over the - class but does allow instances - to be created. - - + + - + - Implementation of used by + Gets the number of elements actually contained in the PluginCollection. - - - Internal class used to provide implementation of - interface. Applications should use to get - logger instances. - - - This is one of the central classes in the log4net implementation. One of the - distinctive features of log4net are hierarchical loggers and their - evaluation. The organizes the - instances into a rooted tree hierarchy. - - - The class is abstract. Only concrete subclasses of - can be created. The - is used to create instances of this type for the . - - - Nicko Cadell - Gert Driesen - Aspi Havewala - Douglas de la Torre - + - This constructor created a new instance and - sets its name. + Copies the entire PluginCollection to a one-dimensional + array. - The name of the . - - - This constructor is protected and designed to be used by - a subclass that is not abstract. - - - Loggers are constructed by - objects. See for the default - logger creator. - - + The one-dimensional array to copy to. - + - Add to the list of appenders of this - Logger instance. + Copies the entire PluginCollection to a one-dimensional + array, starting at the specified index of the target array. - An appender to add to this logger - - - Add to the list of appenders of this - Logger instance. - - - If is already in the list of - appenders, then it won't be added again. - - + The one-dimensional array to copy to. + The zero-based index in at which copying begins. - + - Look for the appender named as name + Gets a value indicating whether access to the collection is synchronized (thread-safe). - The name of the appender to lookup - The appender with the name specified, or null. - - - Returns the named appender, or null if the appender is not found. - - + false, because the backing type is an array, which is never thread-safe. - + - Remove all previously added appenders from this Logger instance. + Gets an object that can be used to synchronize access to the collection. - - - Remove all previously added appenders from this Logger instance. - - - This is useful when re-reading configuration information. - - + + An object that can be used to synchronize access to the collection. + - + - Remove the appender passed as parameter form the list of appenders. + Gets or sets the at the specified index. - The appender to remove - The appender removed from the list - - - Remove the appender passed as parameter form the list of appenders. - The appender removed is not closed. - If you are discarding the appender you must call - on the appender removed. - - + + The at the specified index. + + The zero-based index of the element to get or set. + + is less than zero. + -or- + is equal to or greater than . + - + - Remove the appender passed as parameter form the list of appenders. + Adds a to the end of the PluginCollection. - The name of the appender to remove - The appender removed from the list - - - Remove the named appender passed as parameter form the list of appenders. - The appender removed is not closed. - If you are discarding the appender you must call - on the appender removed. - - + The to be added to the end of the PluginCollection. + The index at which the value has been added. - + - This generic form is intended to be used by wrappers. + Removes all elements from the PluginCollection. - The declaring type of the method that is - the stack boundary into the logging system for this call. - The level of the message to be logged. - The message object to log. - The exception to log, including its stack trace. - - - Generate a logging event for the specified using - the and . - - - This method must not throw any exception to the caller. - - - + - This is the most generic printing method that is intended to be used - by wrappers. + Creates a shallow copy of the . - The event being logged. - - - Logs the specified logging event through this logger. - - - This method must not throw any exception to the caller. - - + A new with a shallow copy of the collection data. - + - Checks if this logger is enabled for a given passed as parameter. + Determines whether a given is in the PluginCollection. - The level to check. + The to check for. + true if is found in the PluginCollection; otherwise, false. + + + + Returns the zero-based index of the first occurrence of a + in the PluginCollection. + + The to locate in the PluginCollection. - true if this logger is enabled for level, otherwise false. + The zero-based index of the first occurrence of + in the entire PluginCollection, if found; otherwise, -1. - - - Test if this logger is going to log events of the specified . - - - This method must not throw any exception to the caller. - - - + - Deliver the to the attached appenders. + Inserts an element into the PluginCollection at the specified index. - The event to log. - - - Call the appenders in the hierarchy starting at - this. If no appenders could be found, emit a - warning. - - - This method calls all the appenders inherited from the - hierarchy circumventing any evaluation of whether to log or not - to log the particular log request. - - + The zero-based index at which should be inserted. + The to insert. + + is less than zero + -or- + is equal to or greater than . + - + - Closes all attached appenders implementing the interface. + Removes the first occurrence of a specific from the PluginCollection. - - - Used to ensure that the appenders are correctly shutdown. - - + The to remove from the PluginCollection. + + The specified was not found in the PluginCollection. + - + - This is the most generic printing method. This generic form is intended to be used by wrappers + Removes the element at the specified index of the PluginCollection. - The level of the message to be logged. - The message object to log. - The exception to log, including its stack trace. - - - Generate a logging event for the specified using - the . - - + The zero-based index of the element to remove. + + is less than zero. + -or- + is equal to or greater than . + - + - Creates a new logging event and logs the event without further checks. + Gets a value indicating whether the collection has a fixed size. - The declaring type of the method that is - the stack boundary into the logging system for this call. - The level of the message to be logged. - The message object to log. - The exception to log, including its stack trace. - - - Generates a logging event and delivers it to the attached - appenders. - - + true if the collection has a fixed size; otherwise, false. The default is false. - + - Creates a new logging event and logs the event without further checks. + Gets a value indicating whether the IList is read-only. - The event being logged. - - - Delivers the logging event to the attached appenders. - - + true if the collection is read-only; otherwise, false. The default is false. - + - The fully qualified type of the Logger class. + Returns an enumerator that can iterate through the PluginCollection. + An for the entire PluginCollection. - + - The name of this logger. + Gets or sets the number of elements the PluginCollection can contain. + + The number of elements the PluginCollection can contain. + - + - The assigned level of this logger. + Adds the elements of another PluginCollection to the current PluginCollection. - - - The level variable need not be - assigned a value in which case it is inherited - form the hierarchy. - - + The PluginCollection whose elements should be added to the end of the current PluginCollection. + The new of the PluginCollection. - + - The parent of this logger. + Adds the elements of a array to the current PluginCollection. - - - The parent of this logger. - All loggers have at least one ancestor which is the root logger. - - + The array whose elements should be added to the end of the PluginCollection. + The new of the PluginCollection. - + - Loggers need to know what Hierarchy they are in. + Adds the elements of a collection to the current PluginCollection. - - - Loggers need to know what Hierarchy they are in. - The hierarchy that this logger is a member of is stored - here. - - + The collection whose elements should be added to the end of the PluginCollection. + The new of the PluginCollection. - + - Helper implementation of the interface + Sets the capacity to the actual number of elements. - + + + is less than zero. + -or- + is equal to or greater than . + + + + + is less than zero. + -or- + is equal to or greater than . + + + - Flag indicating if child loggers inherit their parents appenders + Supports simple iteration over a . - - - Additivity is set to true by default, that is children inherit - the appenders of their ancestors by default. If this variable is - set to false then the appenders found in the - ancestors of this logger are not used. However, the children - of this logger will inherit its appenders, unless the children - have their additivity flag set to false too. See - the user manual for more details. - - + - + - Lock to protect AppenderAttachedImpl variable m_appenderAttachedImpl + Initializes a new instance of the Enumerator class. + - + - Gets or sets the parent logger in the hierarchy. + Gets the current element in the collection. - The parent logger in the hierarchy. + The current element in the collection. - - - Part of the Composite pattern that makes the hierarchy. - The hierarchy is parent linked rather than child linked. - - - + - Gets or sets a value indicating if child loggers inherit their parent's appenders. + Advances the enumerator to the next element in the collection. + + + true if the enumerator was successfully advanced to the next element; + false if the enumerator has passed the end of the collection. + + + The collection was modified after the enumerator was created. + + + + + Sets the enumerator to its initial position, before the first element in the collection. + + + + + + + + Map of repository plugins. - - true if child loggers inherit their parent's appenders. - - Additivity is set to true by default, that is children inherit - the appenders of their ancestors by default. If this variable is - set to false then the appenders found in the - ancestors of this logger are not used. However, the children - of this logger will inherit its appenders, unless the children - have their additivity flag set to false too. See - the user manual for more details. + This class is a name keyed map of the plugins that are + attached to a repository. + Nicko Cadell + Gert Driesen - + - Gets the effective level for this logger. + Constructor - The nearest level in the logger hierarchy. + The repository that the plugins should be attached to. - Starting from this logger, searches the logger hierarchy for a - non-null level and returns it. Otherwise, returns the level of the - root logger. + Initialize a new instance of the class with a + repository that the plugins should be attached to. - The Logger class is designed so that this method executes as - quickly as possible. - + - Gets or sets the where this - Logger instance is attached to. + Gets a by name. - The hierarchy that this logger belongs to. + The name of the to lookup. + + The from the map with the name specified, or + null if no plugin is found. + - This logger must be attached to a single . + Lookup a plugin by name. If the plugin is not found null + will be returned. - + - Gets or sets the assigned , if any, for this Logger. + Gets all possible plugins as a list of objects. - - The of this logger. - + All possible plugins as a list of objects. - The assigned can be null. + Get a collection of all the plugins defined in this map. - + - Get the appenders contained in this logger as an - . + Adds a to the map. - A collection of the appenders in this logger + The to add to the map. - Get the appenders contained in this logger as an - . If no appenders - can be found, then a is returned. + The will be attached to the repository when added. + + + If there already exists a plugin with the same name + attached to the repository then the old plugin will + be and replaced with + the new plugin. - + - Gets the logger name. + Removes a from the map. - - The name of the logger. - + The to remove from the map. - The name of this logger + Remove a specific plugin from this map. - + - Gets the where this - Logger instance is attached to. + Base implementation of - - The that this logger belongs to. - - Gets the where this - Logger instance is attached to. + Default abstract implementation of the + interface. This base class can be used by implementors + of the interface. + Nicko Cadell + Gert Driesen - + - Construct a new Logger + Constructor - the name of the logger + the name of the plugin - - Initializes a new instance of the class - with the specified name. - + Initializes a new Plugin with the specified name. - + - Delegate used to handle logger creation event notifications. + Gets or sets the name of the plugin. - The in which the has been created. - The event args that hold the instance that has been created. + + The name of the plugin. + - Delegate used to handle logger creation event notifications. + Plugins are stored in the + keyed by name. Each plugin instance attached to a + repository must be a unique name. + + + The name of the plugin must not change one the + plugin has been attached to a repository. - + - Provides data for the event. + Attaches this plugin to a . + The that this plugin should be attached to. - A event is raised every time a - is created. + A plugin may only be attached to a single repository. + + + This method is called when the plugin is attached to the repository. - - - The created - - - + - Constructor + Is called when the plugin is to shutdown. - The that has been created. - Initializes a new instance of the event argument - class,with the specified . + This method is called to notify the plugin that + it should stop operating and should detach from + the repository. - + - Gets the that has been created. + The repository for this plugin - The that has been created. + The that this plugin is attached to. - The that has been created. + Gets or sets the that this plugin is + attached to. - + - Hierarchical organization of loggers + The name of this plugin. - - - The casual user should not have to deal with this class - directly. - - - This class is specialized in retrieving loggers by name and - also maintaining the logger hierarchy. Implements the - interface. - - - The structure of the logger hierarchy is maintained by the - method. The hierarchy is such that children - link to their parent but parents do not have any references to their - children. Moreover, loggers can be instantiated in any order, in - particular descendant before ancestor. - - - In case a descendant is created before a particular ancestor, - then it creates a provision node for the ancestor and adds itself - to the provision node. Other descendants of the same ancestor add - themselves to the previously created provision node. - - - Nicko Cadell - Gert Driesen - + - Base implementation of + The repository this plugin is attached to. + + + + + Plugin that listens for events from the - Default abstract implementation of the interface. + This plugin publishes an instance of + on a specified . This listens for logging events delivered from + a remote . - Skeleton implementation of the interface. - All types can extend this type. + When an event is received it is relogged within the attached repository + as if it had been raised locally. Nicko Cadell Gert Driesen - + - Interface implemented by logger repositories. + Default constructor - This interface is implemented by logger repositories. e.g. - . + Initializes a new instance of the class. - This interface is used by the - to obtain interfaces. + The property must be set. - Nicko Cadell - Gert Driesen - + - Check if the named logger exists in the repository. If so return - its reference, otherwise returns null. + Construct with sink Uri. - The name of the logger to lookup - The Logger object with the name specified + The name to publish the sink under in the remoting infrastructure. + See for more details. - If the names logger exists it is returned, otherwise - null is returned. + Initializes a new instance of the class + with specified name. - + - Returns all the currently defined loggers as an Array. + Gets or sets the URI of this sink. - All the defined loggers + + The URI of this sink. + - Returns all the currently defined loggers as an Array. + This is the name under which the object is marshaled. + - + - Returns a named logger instance + Attaches this plugin to a . - The name of the logger to retrieve - The logger object with the name specified + The that this plugin should be attached to. - Returns a named logger instance. + A plugin may only be attached to a single repository. - If a logger of that name already exists, then it will be - returned. Otherwise, a new logger will be instantiated and - then linked with its existing ancestors as well as children. + This method is called when the plugin is attached to the repository. - - Shutdown the repository + + + Is called when the plugin is to shutdown. + - Shutting down a repository will safely close and remove - all appenders in all loggers including the root logger. - - - Some appenders need to be closed before the - application exists. Otherwise, pending logging events might be - lost. - - - The method is careful to close nested - appenders before closing regular appenders. This is allows - configurations where a regular appender is attached to a logger - and again to a nested appender. + When the plugin is shutdown the remote logging + sink is disconnected. - + - Reset the repositories configuration to a default state + The fully qualified type of the RemoteLoggingServerPlugin class. - - Reset all values contained in this instance to their - default state. - - - Existing loggers are not removed. They are just reset. - - - This method should be used sparingly and with care as it will - block all logging until it is completed. - + Used by the internal logger to record the Type of the + log message. - + - Log the through this repository. + Delivers objects to a remote sink. - the event to log - This method should not normally be used to log. - The interface should be used - for routine logging. This interface can be obtained - using the method. - - - The logEvent is delivered to the appropriate logger and - that logger is then responsible for logging the event. + Internal class used to listen for logging events + and deliver them to the local repository. - + - Returns all the Appenders that are configured as an Array. + Constructor - All the Appenders + The repository to log to. - Returns all the Appenders that are configured as an Array. + Initializes a new instance of the for the + specified . - + - The name of the repository + Logs the events to the repository. - - The name of the repository - + The events to log. - The name of the repository. + The events passed are logged to the - + - RendererMap accesses the object renderer map for this repository. + Obtains a lifetime service object to control the lifetime + policy for this instance. - - RendererMap accesses the object renderer map for this repository. - + null to indicate that this instance should live forever. - RendererMap accesses the object renderer map for this repository. - - - The RendererMap holds a mapping between types and - objects. + Obtains a lifetime service object to control the lifetime + policy for this instance. This object should live forever + therefore this implementation returns null. - + - The plugin map for this repository. + The underlying that events should + be logged to. - - The plugin map for this repository. - - - - The plugin map holds the instances - that have been attached to this repository. - - - + - Get the level map for the Repository. + + + + + + + + + + + + - - - Get the level map for the Repository. - - - The level map defines the mappings between - level names and objects in - this repository. - - - + - The threshold for all events in this repository + Default implementation of - - The threshold for all events in this repository - - The threshold for all events in this repository. + This default implementation of the + interface is used to create the default subclass + of the object. + Nicko Cadell + Gert Driesen - + - Flag indicates if this repository has been configured. + Default constructor - - Flag indicates if this repository has been configured. - - Flag indicates if this repository has been configured. + Initializes a new instance of the class. - - - Collection of internal messages captured during the most - recent configuration process. - - - + - Event to notify that the repository has been shutdown. + Create a new instance - - Event to notify that the repository has been shutdown. - + The that will own the . + The name of the . + The instance for the specified name. - Event raised when the repository has been shutdown. + Create a new instance with the + specified name. + + + Called by the to create + new named instances. + + + If the is null then the root logger + must be returned. - + - Event to notify that the repository has had its configuration reset. + Default internal subclass of - - Event to notify that the repository has had its configuration reset. - - Event raised when the repository's configuration has been - reset to default. + This subclass has no additional behavior over the + class but does allow instances + to be created. - + - Event to notify that the repository has had its configuration changed. + Construct a new Logger - - Event to notify that the repository has had its configuration changed. - + the name of the logger - Event raised when the repository's configuration has been changed. + Initializes a new instance of the class + with the specified name. - + - Repository specific properties + Delegate used to handle logger creation event notifications. - - Repository specific properties - + The in which the has been created. + The event args that hold the instance that has been created. - These properties can be specified on a repository specific basis. + Delegate used to handle logger creation event notifications. - + - Default Constructor + Provides data for the event. - Initializes the repository with default (empty) properties. + A event is raised every time a + is created. - + - Construct the repository using specific properties + The created - the properties to set for this repository - - - Initializes the repository with specified properties. - - - + - Test if logger exists + Constructor - The name of the logger to lookup - The Logger object with the name specified + The that has been created. - Check if the named logger exists in the repository. If so return - its reference, otherwise returns null. + Initializes a new instance of the event argument + class,with the specified . - + - Returns all the currently defined loggers in the repository + Gets the that has been created. - All the defined loggers + + The that has been created. + - Returns all the currently defined loggers in the repository as an Array. + The that has been created. - + - Return a new logger instance + Hierarchical organization of loggers - The name of the logger to retrieve - The logger object with the name specified - Return a new logger instance. + The casual user should not have to deal with this class + directly. - If a logger of that name already exists, then it will be - returned. Otherwise, a new logger will be instantiated and - then linked with its existing ancestors as well as children. + This class is specialized in retrieving loggers by name and + also maintaining the logger hierarchy. Implements the + interface. + + + The structure of the logger hierarchy is maintained by the + method. The hierarchy is such that children + link to their parent but parents do not have any references to their + children. Moreover, loggers can be instantiated in any order, in + particular descendant before ancestor. + + + In case a descendant is created before a particular ancestor, + then it creates a provision node for the ancestor and adds itself + to the provision node. Other descendants of the same ancestor add + themselves to the previously created provision node. + Nicko Cadell + Gert Driesen - + - Shutdown the repository + Event used to notify that a logger has been created. - Shutdown the repository. Can be overridden in a subclass. - This base class implementation notifies the - listeners and all attached plugins of the shutdown event. + Event raised when a logger is created. - + - Reset the repositories configuration to a default state + Default constructor - Reset all values contained in this instance to their - default state. - - - Existing loggers are not removed. They are just reset. - - - This method should be used sparingly and with care as it will - block all logging until it is completed. + Initializes a new instance of the class. - + - Log the logEvent through this repository. + Construct with properties - the event to log + The properties to pass to this repository. - This method should not normally be used to log. - The interface should be used - for routine logging. This interface can be obtained - using the method. - - - The logEvent is delivered to the appropriate logger and - that logger is then responsible for logging the event. + Initializes a new instance of the class. - + - Returns all the Appenders that are configured as an Array. + Construct with a logger factory - All the Appenders + The factory to use to create new logger instances. - Returns all the Appenders that are configured as an Array. + Initializes a new instance of the class with + the specified . - + - The fully qualified type of the LoggerRepositorySkeleton class. + Construct with properties and a logger factory + The properties to pass to this repository. + The factory to use to create new logger instances. - Used by the internal logger to record the Type of the - log message. + + Initializes a new instance of the class with + the specified . + - + - Adds an object renderer for a specific class. + Has no appender warning been emitted - The type that will be rendered by the renderer supplied. - The object renderer used to render the object. - Adds an object renderer for a specific class. + Flag to indicate if we have already issued a warning + about not having an appender warning. - + - Notify the registered listeners that the repository is shutting down + Get the root of this hierarchy - Empty EventArgs - Notify any listeners that this repository is shutting down. + Get the root of this hierarchy. - + - Notify the registered listeners that the repository has had its configuration reset + Gets or sets the default instance. - Empty EventArgs + The default - Notify any listeners that this repository's configuration has been reset. + The logger factory is used to create logger instances. - + - Notify the registered listeners that the repository has had its configuration changed + Test if a logger exists - Empty EventArgs + The name of the logger to lookup + The Logger object with the name specified - Notify any listeners that this repository's configuration has changed. + Check if the named logger exists in the hierarchy. If so return + its reference, otherwise returns null. - + - Raise a configuration changed event on this repository + Returns all the currently defined loggers in the hierarchy as an Array - EventArgs.Empty + All the defined loggers - Applications that programmatically change the configuration of the repository should - raise this event notification to notify listeners. + Returns all the currently defined loggers in the hierarchy as an Array. + The root logger is not included in the returned + enumeration. - - - Flushes all configured Appenders that implement . - - The maximum time in milliseconds to wait for logging events from asycnhronous appenders to be flushed, - or to wait indefinitely. - True if all logging events were flushed successfully, else false. - - + - The name of the repository + Return a new logger instance named as the first parameter using + the default factory. - - The string name of the repository - - The name of this repository. The name is - used to store and lookup the repositories - stored by the . + Return a new logger instance named as the first parameter using + the default factory. + + + If a logger of that name already exists, then it will be + returned. Otherwise, a new logger will be instantiated and + then linked with its existing ancestors as well as children. + The name of the logger to retrieve + The logger object with the name specified - + - The threshold for all events in this repository + Shutting down a hierarchy will safely close and remove + all appenders in all loggers including the root logger. - - The threshold for all events in this repository - - The threshold for all events in this repository + Shutting down a hierarchy will safely close and remove + all appenders in all loggers including the root logger. + + + Some appenders need to be closed before the + application exists. Otherwise, pending logging events might be + lost. + + + The Shutdown method is careful to close nested + appenders before closing regular appenders. This is allows + configurations where a regular appender is attached to a logger + and again to a nested appender. - + - RendererMap accesses the object renderer map for this repository. + Reset all values contained in this hierarchy instance to their default. - - RendererMap accesses the object renderer map for this repository. - - RendererMap accesses the object renderer map for this repository. + Reset all values contained in this hierarchy instance to their + default. This removes all appenders from all loggers, sets + the level of all non-root loggers to null, + sets their additivity flag to true and sets the level + of the root logger to . Moreover, + message disabling is set its default "off" value. - The RendererMap holds a mapping between types and - objects. + Existing loggers are not removed. They are just reset. + + + This method should be used sparingly and with care as it will + block all logging until it is completed. - + - The plugin map for this repository. + Log the logEvent through this hierarchy. - - The plugin map for this repository. - + the event to log - The plugin map holds the instances - that have been attached to this repository. + This method should not normally be used to log. + The interface should be used + for routine logging. This interface can be obtained + using the method. + + + The logEvent is delivered to the appropriate logger and + that logger is then responsible for logging the event. - + - Get the level map for the Repository. + Returns all the Appenders that are currently configured + An array containing all the currently configured appenders - Get the level map for the Repository. + Returns all the instances that are currently configured. + All the loggers are searched for appenders. The appenders may also be containers + for appenders and these are also searched for additional loggers. - The level map defines the mappings between - level names and objects in - this repository. + The list returned is unordered but does not contain duplicates. - + - Flag indicates if this repository has been configured. + Collect the appenders from an . + The appender may also be a container. - - Flag indicates if this repository has been configured. - + + + + + + Collect the appenders from an container + + + + + + + Initialize the log4net system using the specified appender + + the appender to use to log all logging events + + + + Initialize the log4net system using the specified appenders + + the appenders to use to log all logging events + + + + Initialize the log4net system using the specified appenders + + the appenders to use to log all logging events - Flag indicates if this repository has been configured. + This method provides the same functionality as the + method implemented + on this object, but it is protected and therefore can be called by subclasses. - + - Contains a list of internal messages captures during the - last configuration. + Initialize the log4net system using the specified config + the element containing the root of the config - + - Event to notify that the repository has been shutdown. + Initialize the log4net system using the specified config - - Event to notify that the repository has been shutdown. - + the element containing the root of the config - Event raised when the repository has been shutdown. + This method provides the same functionality as the + method implemented + on this object, but it is protected and therefore can be called by subclasses. - + - Event to notify that the repository has had its configuration reset. + Test if this hierarchy is disabled for the specified . - - Event to notify that the repository has had its configuration reset. - + The level to check against. + + true if the repository is disabled for the level argument, false otherwise. + - Event raised when the repository's configuration has been - reset to default. + If this hierarchy has not been configured then this method will + always return true. + + + This method will return true if this repository is + disabled for level object passed as parameter and + false otherwise. + + + See also the property. - + - Event to notify that the repository has had its configuration changed. + Clear all logger definitions from the internal hashtable - - Event to notify that the repository has had its configuration changed. - - Event raised when the repository's configuration has been changed. + This call will clear all logger definitions from the internal + hashtable. Invoking this method will irrevocably mess up the + logger hierarchy. + + + You should really know what you are doing before + invoking this method. - + - Repository specific properties + Return a new logger instance named as the first parameter using + . - - Repository specific properties - + The name of the logger to retrieve + The factory that will make the new logger instance + The logger object with the name specified - These properties can be specified on a repository specific basis + + If a logger of that name already exists, then it will be + returned. Otherwise, a new logger will be instantiated by the + parameter and linked with its existing + ancestors as well as children. + - + - Basic Configurator interface for repositories + Sends a logger creation event to all registered listeners + The newly created logger - - Interface used by basic configurator to configure a - with a default . - - - A should implement this interface to support - configuration by the . - + Raises the logger creation event. - Nicko Cadell - Gert Driesen - + - Initialize the repository using the specified appender + Updates all the parents of the specified logger - the appender to use to log all logging events + The logger to update the parents for - Configure the repository to route all logging events to the - specified appender. + This method loops through all the potential parents of + . There 3 possible cases: + + + No entry for the potential parent of exists + + We create a ProvisionNode for this potential + parent and insert in that provision node. + + + + The entry is of type Logger for the potential parent. + + The entry is 's nearest existing parent. We + update 's parent field with this entry. We also break from + he loop because updating our parent's parent is our parent's + responsibility. + + + + The entry is of type ProvisionNode for this potential parent. + + We add to the list of children for this + potential parent. + + + - + - Initialize the repository using the specified appenders + Replace a with a in the hierarchy. - the appenders to use to log all logging events + + - Configure the repository to route all logging events to the - specified appenders. + We update the links for all the children that placed themselves + in the provision node 'pn'. The second argument 'log' is a + reference for the newly created Logger, parent of all the + children in 'pn'. + + + We loop on all the children 'c' in 'pn'. + + + If the child 'c' has been already linked to a child of + 'log' then there is no need to update 'c'. + + + Otherwise, we set log's parent field to c's parent and set + c's parent field to log. - + - Configure repository using XML + Define or redefine a Level using the values in the argument + the level values - Interface used by Xml configurator to configure a . + Define or redefine a Level using the values in the argument - A should implement this interface to support - configuration by the . + Supports setting levels via the configuration file. - Nicko Cadell - Gert Driesen - + - Initialize the repository using the specified config + A class to hold the value, name and display name for a level - the element containing the root of the config - The schema for the XML configuration data is defined by - the implementation. + A class to hold the value, name and display name for a level - + - Default constructor + Value of the level - Initializes a new instance of the class. + If the value is not set (defaults to -1) the value will be looked + up for the current level with the same name. - + - Construct with properties + Name of the level - The properties to pass to this repository. + + The name of the level + - Initializes a new instance of the class. + The name of the level. - + - Construct with a logger factory + Display name for the level - The factory to use to create new logger instances. + + The display name of the level + - Initializes a new instance of the class with - the specified . + The display name of the level. - + - Construct with properties and a logger factory + Override Object.ToString to return sensible debug info - The properties to pass to this repository. - The factory to use to create new logger instances. - - - Initializes a new instance of the class with - the specified . - - + string info about this object - + - Test if a logger exists + Set a Property using the values in the argument - The name of the logger to lookup - The Logger object with the name specified + the property value - Check if the named logger exists in the hierarchy. If so return - its reference, otherwise returns null. + Set a Property using the values in the argument. + + + Supports setting property values via the configuration file. - + - Returns all the currently defined loggers in the hierarchy as an Array + The fully qualified type of the Hierarchy class. - All the defined loggers - - Returns all the currently defined loggers in the hierarchy as an Array. - The root logger is not included in the returned - enumeration. - + Used by the internal logger to record the Type of the + log message. - + - Return a new logger instance named as the first parameter using - the default factory. + Interface abstracts creation of instances - Return a new logger instance named as the first parameter using - the default factory. + This interface is used by the to + create new objects. - If a logger of that name already exists, then it will be - returned. Otherwise, a new logger will be instantiated and - then linked with its existing ancestors as well as children. + The method is called + to create a named . + + + Implement this interface to create new subclasses of . - The name of the logger to retrieve - The logger object with the name specified + Nicko Cadell + Gert Driesen - + - Shutting down a hierarchy will safely close and remove - all appenders in all loggers including the root logger. + Create a new instance + The that will own the . + The name of the . + The instance for the specified name. - Shutting down a hierarchy will safely close and remove - all appenders in all loggers including the root logger. + Create a new instance with the + specified name. - Some appenders need to be closed before the - application exists. Otherwise, pending logging events might be - lost. + Called by the to create + new named instances. - The Shutdown method is careful to close nested - appenders before closing regular appenders. This is allows - configurations where a regular appender is attached to a logger - and again to a nested appender. + If the is null then the root logger + must be returned. - + - Reset all values contained in this hierarchy instance to their default. + Implementation of used by - Reset all values contained in this hierarchy instance to their - default. This removes all appenders from all loggers, sets - the level of all non-root loggers to null, - sets their additivity flag to true and sets the level - of the root logger to . Moreover, - message disabling is set its default "off" value. + Internal class used to provide implementation of + interface. Applications should use to get + logger instances. - Existing loggers are not removed. They are just reset. + This is one of the central classes in the log4net implementation. One of the + distinctive features of log4net are hierarchical loggers and their + evaluation. The organizes the + instances into a rooted tree hierarchy. - This method should be used sparingly and with care as it will - block all logging until it is completed. + The class is abstract. Only concrete subclasses of + can be created. The + is used to create instances of this type for the . + Nicko Cadell + Gert Driesen + Aspi Havewala + Douglas de la Torre - + - Log the logEvent through this hierarchy. + This constructor created a new instance and + sets its name. - the event to log + The name of the . - This method should not normally be used to log. - The interface should be used - for routine logging. This interface can be obtained - using the method. + This constructor is protected and designed to be used by + a subclass that is not abstract. - The logEvent is delivered to the appropriate logger and - that logger is then responsible for logging the event. + Loggers are constructed by + objects. See for the default + logger creator. - + - Returns all the Appenders that are currently configured + Gets or sets the parent logger in the hierarchy. - An array containing all the currently configured appenders + + The parent logger in the hierarchy. + - Returns all the instances that are currently configured. - All the loggers are searched for appenders. The appenders may also be containers - for appenders and these are also searched for additional loggers. - - - The list returned is unordered but does not contain duplicates. + Part of the Composite pattern that makes the hierarchy. + The hierarchy is parent linked rather than child linked. - - - Collect the appenders from an . - The appender may also be a container. - - - - - + - Collect the appenders from an container + Gets or sets a value indicating if child loggers inherit their parent's appenders. - - + + true if child loggers inherit their parent's appenders. + + + + Additivity is set to true by default, that is children inherit + the appenders of their ancestors by default. If this variable is + set to false then the appenders found in the + ancestors of this logger are not used. However, the children + of this logger will inherit its appenders, unless the children + have their additivity flag set to false too. See + the user manual for more details. + + - + - Initialize the log4net system using the specified appender + Gets the effective level for this logger. - the appender to use to log all logging events + The nearest level in the logger hierarchy. + + + Starting from this logger, searches the logger hierarchy for a + non-null level and returns it. Otherwise, returns the level of the + root logger. + + The Logger class is designed so that this method executes as + quickly as possible. + - + - Initialize the log4net system using the specified appenders + Gets or sets the where this + Logger instance is attached to. - the appenders to use to log all logging events + The hierarchy that this logger belongs to. + + + This logger must be attached to a single . + + - + - Initialize the log4net system using the specified appenders + Gets or sets the assigned , if any, for this Logger. - the appenders to use to log all logging events + + The of this logger. + - This method provides the same functionality as the - method implemented - on this object, but it is protected and therefore can be called by subclasses. + The assigned can be null. - + - Initialize the log4net system using the specified config + Add to the list of appenders of this + Logger instance. - the element containing the root of the config + An appender to add to this logger + + + Add to the list of appenders of this + Logger instance. + + + If is already in the list of + appenders, then it won't be added again. + + - + - Initialize the log4net system using the specified config + Get the appenders contained in this logger as an + . - the element containing the root of the config + A collection of the appenders in this logger - This method provides the same functionality as the - method implemented - on this object, but it is protected and therefore can be called by subclasses. + Get the appenders contained in this logger as an + . If no appenders + can be found, then a is returned. - + - Test if this hierarchy is disabled for the specified . + Look for the appender named as name - The level to check against. - - true if the repository is disabled for the level argument, false otherwise. - + The name of the appender to lookup + The appender with the name specified, or null. - If this hierarchy has not been configured then this method will - always return true. - - - This method will return true if this repository is - disabled for level object passed as parameter and - false otherwise. - - - See also the property. + Returns the named appender, or null if the appender is not found. - + - Clear all logger definitions from the internal hashtable + Remove all previously added appenders from this Logger instance. - This call will clear all logger definitions from the internal - hashtable. Invoking this method will irrevocably mess up the - logger hierarchy. + Remove all previously added appenders from this Logger instance. - You should really know what you are doing before - invoking this method. + This is useful when re-reading configuration information. - + - Return a new logger instance named as the first parameter using - . + Remove the appender passed as parameter form the list of appenders. - The name of the logger to retrieve - The factory that will make the new logger instance - The logger object with the name specified + The appender to remove + The appender removed from the list - If a logger of that name already exists, then it will be - returned. Otherwise, a new logger will be instantiated by the - parameter and linked with its existing - ancestors as well as children. + Remove the appender passed as parameter form the list of appenders. + The appender removed is not closed. + If you are discarding the appender you must call + on the appender removed. - + - Sends a logger creation event to all registered listeners + Remove the appender passed as parameter form the list of appenders. - The newly created logger + The name of the appender to remove + The appender removed from the list - Raises the logger creation event. + + Remove the named appender passed as parameter form the list of appenders. + The appender removed is not closed. + If you are discarding the appender you must call + on the appender removed. + - + - Updates all the parents of the specified logger + Gets the logger name. - The logger to update the parents for + + The name of the logger. + - This method loops through all the potential parents of - . There 3 possible cases: + The name of this logger - - - No entry for the potential parent of exists - - We create a ProvisionNode for this potential - parent and insert in that provision node. - - - - The entry is of type Logger for the potential parent. - - The entry is 's nearest existing parent. We - update 's parent field with this entry. We also break from - he loop because updating our parent's parent is our parent's - responsibility. - - - - The entry is of type ProvisionNode for this potential parent. - - We add to the list of children for this - potential parent. - - - - + - Replace a with a in the hierarchy. + This generic form is intended to be used by wrappers. - - + The declaring type of the method that is + the stack boundary into the logging system for this call. + The level of the message to be logged. + The message object to log. + The exception to log, including its stack trace. - We update the links for all the children that placed themselves - in the provision node 'pn'. The second argument 'log' is a - reference for the newly created Logger, parent of all the - children in 'pn'. - - - We loop on all the children 'c' in 'pn'. - - - If the child 'c' has been already linked to a child of - 'log' then there is no need to update 'c'. + Generate a logging event for the specified using + the and . - Otherwise, we set log's parent field to c's parent and set - c's parent field to log. + This method must not throw any exception to the caller. - + - Define or redefine a Level using the values in the argument + This is the most generic printing method that is intended to be used + by wrappers. - the level values + The event being logged. - Define or redefine a Level using the values in the argument + Logs the specified logging event through this logger. - Supports setting levels via the configuration file. + This method must not throw any exception to the caller. - + - Set a Property using the values in the argument + Checks if this logger is enabled for a given passed as parameter. - the property value + The level to check. + + true if this logger is enabled for level, otherwise false. + - Set a Property using the values in the argument. + Test if this logger is going to log events of the specified . - Supports setting property values via the configuration file. + This method must not throw any exception to the caller. - + - The fully qualified type of the Hierarchy class. + Gets the where this + Logger instance is attached to. + + The that this logger belongs to. + - Used by the internal logger to record the Type of the - log message. + + Gets the where this + Logger instance is attached to. + - + - Event used to notify that a logger has been created. + Deliver the to the attached appenders. + The event to log. - Event raised when a logger is created. + Call the appenders in the hierarchy starting at + this. If no appenders could be found, emit a + warning. + + + This method calls all the appenders inherited from the + hierarchy circumventing any evaluation of whether to log or not + to log the particular log request. - + - Has no appender warning been emitted + Closes all attached appenders implementing the interface. - Flag to indicate if we have already issued a warning - about not having an appender warning. + Used to ensure that the appenders are correctly shutdown. - + - Get the root of this hierarchy + This is the most generic printing method. This generic form is intended to be used by wrappers + The level of the message to be logged. + The message object to log. + The exception to log, including its stack trace. - Get the root of this hierarchy. + Generate a logging event for the specified using + the . - + - Gets or sets the default instance. + Creates a new logging event and logs the event without further checks. - The default + The declaring type of the method that is + the stack boundary into the logging system for this call. + The level of the message to be logged. + The message object to log. + The exception to log, including its stack trace. - The logger factory is used to create logger instances. + Generates a logging event and delivers it to the attached + appenders. - + - A class to hold the value, name and display name for a level + Creates a new logging event and logs the event without further checks. + The event being logged. - A class to hold the value, name and display name for a level + Delivers the logging event to the attached appenders. - + - Override Object.ToString to return sensible debug info + The fully qualified type of the Logger class. - string info about this object - + - Value of the level + The name of this logger. + + + + + The assigned level of this logger. - If the value is not set (defaults to -1) the value will be looked - up for the current level with the same name. + The level variable need not be + assigned a value in which case it is inherited + form the hierarchy. - + - Name of the level + The parent of this logger. - - The name of the level - - The name of the level. + The parent of this logger. + All loggers have at least one ancestor which is the root logger. - + - Display name for the level + Loggers need to know what Hierarchy they are in. - - The display name of the level - - The display name of the level. + Loggers need to know what Hierarchy they are in. + The hierarchy that this logger is a member of is stored + here. + + + + + + Helper implementation of the interface + + + + + Flag indicating if child loggers inherit their parents appenders + + + + Additivity is set to true by default, that is children inherit + the appenders of their ancestors by default. If this variable is + set to false then the appenders found in the + ancestors of this logger are not used. However, the children + of this logger will inherit its appenders, unless the children + have their additivity flag set to false too. See + the user manual for more details. + + + Lock to protect AppenderAttachedImpl variable m_appenderAttachedImpl + + Used internally to accelerate hash table searches. @@ -23247,7 +23521,7 @@ - Initializes a new instance of the class + Initializes a new instance of the class with the specified name. @@ -23276,12 +23550,12 @@ - Determines whether two instances + Determines whether two instances are equal. - The to compare with the current . + The to compare with the current . - true if the specified is equal to the current ; otherwise, false. + true if the specified is equal to the current ; otherwise, false. @@ -23296,8 +23570,8 @@ instances are used in the - when there is no specified - for that node. + when there is no specified + for that node. A provision node holds a list of child loggers on behalf of @@ -23314,18 +23588,18 @@ A child logger to add to this node. - Initializes a new instance of the class + Initializes a new instance of the class with the specified child logger. - The sits at the root of the logger hierarchy tree. + The sits at the root of the logger hierarchy tree. - The is a regular except + The is a regular except that it provides several guarantees. @@ -23345,7 +23619,7 @@ The level to assign to the root logger. - Initializes a new instance of the class with + Initializes a new instance of the class with the specified logging level. @@ -23354,15 +23628,6 @@ - - - The fully qualified type of the RootLogger class. - - - Used by the internal logger to record the Type of the - log message. - - Gets the assigned level value without walking the logger hierarchy. @@ -23390,6 +23655,15 @@ + + + The fully qualified type of the RootLogger class. + + + Used by the internal logger to record the Type of the + log message. + + Initializes the log4net environment using an XML DOM. @@ -23409,8 +23683,8 @@ The hierarchy to build. - Initializes a new instance of the class - with the specified . + Initializes a new instance of the class + with the specified . @@ -23610,21 +23884,46 @@ log message. - + - + Basic Configurator interface for repositories + + + Interface used by basic configurator to configure a + with a default . + + + A should implement this interface to support + configuration by the . + + + Nicko Cadell + Gert Driesen - + - + Initialize the repository using the specified appender - + the appender to use to log all logging events + + + Configure the repository to route all logging events to the + specified appender. + + - + - + Initialize the repository using the specified appenders + the appenders to use to log all logging events + + + Configure the repository to route all logging events to the + specified appenders. + + @@ -23662,2506 +23961,2945 @@ - + - Write the name of the current AppDomain to the output + Interface implemented by logger repositories. - Write the name of the current AppDomain to the output writer + This interface is implemented by logger repositories. e.g. + . + + + This interface is used by the + to obtain interfaces. Nicko Cadell + Gert Driesen - + - Write the name of the current AppDomain to the output + The name of the repository - the writer to write to - null, state is not set + + The name of the repository + - Writes name of the current AppDomain to the output . + The name of the repository. - + - AppSetting pattern converter + RendererMap accesses the object renderer map for this repository. + + RendererMap accesses the object renderer map for this repository. + - This pattern converter reads appSettings from the application configuration file. + RendererMap accesses the object renderer map for this repository. - If the is specified then that will be used to - lookup a single appSettings value. If no is specified - then all appSettings will be dumped as a list of key value pairs. + The RendererMap holds a mapping between types and + objects. + + + + + The plugin map for this repository. + + + The plugin map for this repository. + + - A typical use is to specify a base directory for log files, e.g. - - - - - ... - - - ]]> - + The plugin map holds the instances + that have been attached to this repository. - + - Write the property value to the output + Get the level map for the Repository. - that will receive the formatted result. - null, state is not set - Writes out the value of a named property. The property name - should be set in the - property. + Get the level map for the Repository. - If the is set to null - then all the properties are written as key value pairs. + The level map defines the mappings between + level names and objects in + this repository. - + - Write the current date to the output + The threshold for all events in this repository + + The threshold for all events in this repository + - Date pattern converter, uses a to format - the current date and time to the writer as a string. + The threshold for all events in this repository. + + + + + Check if the named logger exists in the repository. If so return + its reference, otherwise returns null. + + The name of the logger to lookup + The Logger object with the name specified + - The value of the determines - the formatting of the date. The following values are allowed: - - - Option value - Output - - - ISO8601 - - Uses the formatter. - Formats using the "yyyy-MM-dd HH:mm:ss,fff" pattern. - - - - DATE - - Uses the formatter. - Formats using the "dd MMM yyyy HH:mm:ss,fff" for example, "06 Nov 1994 15:49:37,459". - - - - ABSOLUTE - - Uses the formatter. - Formats using the "HH:mm:ss,fff" for example, "15:49:37,459". - - - - other - - Any other pattern string uses the formatter. - This formatter passes the pattern string to the - method. - For details on valid patterns see - DateTimeFormatInfo Class. - - - + If the names logger exists it is returned, otherwise + null is returned. + + + + + Returns all the currently defined loggers as an Array. + + All the defined loggers + - The date and time is in the local time zone and is rendered in that zone. - To output the time in Universal time see . + Returns all the currently defined loggers as an Array. - Nicko Cadell - + - The used to render the date to a string + Returns a named logger instance + The name of the logger to retrieve + The logger object with the name specified - The used to render the date to a string + Returns a named logger instance. + + + If a logger of that name already exists, then it will be + returned. Otherwise, a new logger will be instantiated and + then linked with its existing ancestors as well as children. - + + Shutdown the repository + + + Shutting down a repository will safely close and remove + all appenders in all loggers including the root logger. + + + Some appenders need to be closed before the + application exists. Otherwise, pending logging events might be + lost. + + + The method is careful to close nested + appenders before closing regular appenders. This is allows + configurations where a regular appender is attached to a logger + and again to a nested appender. + + + + - Initialize the converter options + Reset the repositories configuration to a default state - This is part of the delayed object - activation scheme. The method must - be called on this object after the configuration properties have - been set. Until is called this - object is in an undefined state and must not be used. + Reset all values contained in this instance to their + default state. - If any of the configuration properties are modified then - must be called again. + Existing loggers are not removed. They are just reset. + + + This method should be used sparingly and with care as it will + block all logging until it is completed. - + - Write the current date to the output + Log the through this repository. - that will receive the formatted result. - null, state is not set + the event to log + + + This method should not normally be used to log. + The interface should be used + for routine logging. This interface can be obtained + using the method. + + + The logEvent is delivered to the appropriate logger and + that logger is then responsible for logging the event. + + + + + + Flag indicates if this repository has been configured. + + + Flag indicates if this repository has been configured. + - Pass the current date and time to the - for it to render it to the writer. - - - The date and time passed is in the local time zone. + Flag indicates if this repository has been configured. - + - The fully qualified type of the DatePatternConverter class. + Collection of internal messages captured during the most + recent configuration process. - - Used by the internal logger to record the Type of the - log message. - - + - Write an folder path to the output + Event to notify that the repository has been shutdown. + + Event to notify that the repository has been shutdown. + - Write an special path environment folder path to the output writer. - The value of the determines - the name of the variable to output. - should be a value in the enumeration. + Event raised when the repository has been shutdown. - Ron Grabowski - + - Write an special path environment folder path to the output + Event to notify that the repository has had its configuration reset. - the writer to write to - null, state is not set + + Event to notify that the repository has had its configuration reset. + - Writes the special path environment folder path to the output . - The name of the special path environment folder path to output must be set - using the - property. + Event raised when the repository's configuration has been + reset to default. - + - The fully qualified type of the EnvironmentFolderPathPatternConverter class. + Event to notify that the repository has had its configuration changed. + + Event to notify that the repository has had its configuration changed. + - Used by the internal logger to record the Type of the - log message. + + Event raised when the repository's configuration has been changed. + - + - Write an environment variable to the output + Repository specific properties + + Repository specific properties + - Write an environment variable to the output writer. - The value of the determines - the name of the variable to output. + These properties can be specified on a repository specific basis. - Nicko Cadell - + - Write an environment variable to the output + Returns all the Appenders that are configured as an Array. - the writer to write to - null, state is not set + All the Appenders - Writes the environment variable to the output . - The name of the environment variable to output must be set - using the - property. + Returns all the Appenders that are configured as an Array. - + - The fully qualified type of the EnvironmentPatternConverter class. + Configure repository using XML - Used by the internal logger to record the Type of the - log message. + + Interface used by Xml configurator to configure a . + + + A should implement this interface to support + configuration by the . + + Nicko Cadell + Gert Driesen - + - Write the current thread identity to the output + Initialize the repository using the specified config + the element containing the root of the config - Write the current thread identity to the output writer + The schema for the XML configuration data is defined by + the implementation. - Nicko Cadell - + - Write the current thread identity to the output + Base implementation of - the writer to write to - null, state is not set - Writes the current thread identity to the output . + Default abstract implementation of the interface. + + + Skeleton implementation of the interface. + All types can extend this type. + Nicko Cadell + Gert Driesen - + - The fully qualified type of the IdentityPatternConverter class. + Default Constructor - Used by the internal logger to record the Type of the - log message. + + Initializes the repository with default (empty) properties. + - + - Pattern converter for literal string instances in the pattern + Construct the repository using specific properties + the properties to set for this repository - Writes the literal string value specified in the - property to - the output. + Initializes the repository with specified properties. - Nicko Cadell - + - Set the next converter in the chain + The name of the repository - The next pattern converter in the chain - The next pattern converter + + The string name of the repository + - Special case the building of the pattern converter chain - for instances. Two adjacent - literals in the pattern can be represented by a single combined - pattern converter. This implementation detects when a - is added to the chain - after this converter and combines its value with this converter's - literal value. + The name of this repository. The name is + used to store and lookup the repositories + stored by the . - + - Write the literal to the output + The threshold for all events in this repository - the writer to write to - null, not set + + The threshold for all events in this repository + - Override the formatting behavior to ignore the FormattingInfo - because we have a literal instead. - - - Writes the value of - to the output . + The threshold for all events in this repository - + - Convert this pattern into the rendered message + RendererMap accesses the object renderer map for this repository. - that will receive the formatted result. - null, not set + + RendererMap accesses the object renderer map for this repository. + - This method is not used. + RendererMap accesses the object renderer map for this repository. + + + The RendererMap holds a mapping between types and + objects. - + - Writes a newline to the output + The plugin map for this repository. + + The plugin map for this repository. + - Writes the system dependent line terminator to the output. - This behavior can be overridden by setting the : + The plugin map holds the instances + that have been attached to this repository. - - - Option Value - Output - - - DOS - DOS or Windows line terminator "\r\n" - - - UNIX - UNIX line terminator "\n" - - - Nicko Cadell - + - Initialize the converter + Get the level map for the Repository. - This is part of the delayed object - activation scheme. The method must - be called on this object after the configuration properties have - been set. Until is called this - object is in an undefined state and must not be used. + Get the level map for the Repository. - If any of the configuration properties are modified then - must be called again. + The level map defines the mappings between + level names and objects in + this repository. - + - Write the current process ID to the output + Test if logger exists + The name of the logger to lookup + The Logger object with the name specified - Write the current process ID to the output writer + Check if the named logger exists in the repository. If so return + its reference, otherwise returns null. - Nicko Cadell - + - Write the current process ID to the output + Returns all the currently defined loggers in the repository - the writer to write to - null, state is not set + All the defined loggers - Write the current process ID to the output . + Returns all the currently defined loggers in the repository as an Array. - + - The fully qualified type of the ProcessIdPatternConverter class. + Return a new logger instance + The name of the logger to retrieve + The logger object with the name specified - Used by the internal logger to record the Type of the - log message. + + Return a new logger instance. + + + If a logger of that name already exists, then it will be + returned. Otherwise, a new logger will be instantiated and + then linked with its existing ancestors as well as children. + - + - Property pattern converter + Shutdown the repository - This pattern converter reads the thread and global properties. - The thread properties take priority over global properties. - See for details of the - thread properties. See for - details of the global properties. - - - If the is specified then that will be used to - lookup a single property. If no is specified - then all properties will be dumped as a list of key value pairs. + Shutdown the repository. Can be overridden in a subclass. + This base class implementation notifies the + listeners and all attached plugins of the shutdown event. - Nicko Cadell - + - Write the property value to the output + Reset the repositories configuration to a default state - that will receive the formatted result. - null, state is not set - Writes out the value of a named property. The property name - should be set in the - property. + Reset all values contained in this instance to their + default state. - If the is set to null - then all the properties are written as key value pairs. + Existing loggers are not removed. They are just reset. + + + This method should be used sparingly and with care as it will + block all logging until it is completed. - + - A Pattern converter that generates a string of random characters + Log the logEvent through this repository. + the event to log - The converter generates a string of random characters. By default - the string is length 4. This can be changed by setting the - to the string value of the length required. - - - The random characters in the string are limited to uppercase letters - and numbers only. + This method should not normally be used to log. + The interface should be used + for routine logging. This interface can be obtained + using the method. - The random number generator used by this class is not cryptographically secure. + The logEvent is delivered to the appropriate logger and + that logger is then responsible for logging the event. - Nicko Cadell - + - Shared random number generator + Flag indicates if this repository has been configured. + + Flag indicates if this repository has been configured. + + + + Flag indicates if this repository has been configured. + + - + - Length of random string to generate. Default length 4. + Contains a list of internal messages captures during the + last configuration. - + - Initialize the converter options + Event to notify that the repository has been shutdown. + + Event to notify that the repository has been shutdown. + - This is part of the delayed object - activation scheme. The method must - be called on this object after the configuration properties have - been set. Until is called this - object is in an undefined state and must not be used. - - - If any of the configuration properties are modified then - must be called again. + Event raised when the repository has been shutdown. - + - Write a randoim string to the output + Event to notify that the repository has had its configuration reset. - the writer to write to - null, state is not set + + Event to notify that the repository has had its configuration reset. + - Write a randoim string to the output . + Event raised when the repository's configuration has been + reset to default. - + - The fully qualified type of the RandomStringPatternConverter class. + Event to notify that the repository has had its configuration changed. + + Event to notify that the repository has had its configuration changed. + - Used by the internal logger to record the Type of the - log message. + + Event raised when the repository's configuration has been changed. + - + - Write the current threads username to the output + Repository specific properties + + Repository specific properties + - - Write the current threads username to the output writer - + These properties can be specified on a repository specific basis - Nicko Cadell - + - Write the current threads username to the output + Returns all the Appenders that are configured as an Array. - the writer to write to - null, state is not set + All the Appenders - Write the current threads username to the output . + Returns all the Appenders that are configured as an Array. - + - The fully qualified type of the UserNamePatternConverter class. + The fully qualified type of the LoggerRepositorySkeleton class. Used by the internal logger to record the Type of the log message. - + - Write the UTC date time to the output + Adds an object renderer for a specific class. + The type that will be rendered by the renderer supplied. + The object renderer used to render the object. - Date pattern converter, uses a to format - the current date and time in Universal time. - - - See the for details on the date pattern syntax. + Adds an object renderer for a specific class. - - Nicko Cadell - + - Write the current date and time to the output + Notify the registered listeners that the repository is shutting down - that will receive the formatted result. - null, state is not set + Empty EventArgs - Pass the current date and time to the - for it to render it to the writer. - - - The date is in Universal time when it is rendered. + Notify any listeners that this repository is shutting down. - - + - The fully qualified type of the UtcDatePatternConverter class. + Notify the registered listeners that the repository has had its configuration reset + Empty EventArgs - Used by the internal logger to record the Type of the - log message. + + Notify any listeners that this repository's configuration has been reset. + - + - Type converter for Boolean. + Notify the registered listeners that the repository has had its configuration changed + Empty EventArgs - Supports conversion from string to bool type. + Notify any listeners that this repository's configuration has changed. - - - - Nicko Cadell - Gert Driesen - + - Can the source type be converted to the type supported by this object + Raise a configuration changed event on this repository - the type to convert - true if the conversion is possible + EventArgs.Empty - Returns true if the is - the type. + Applications that programmatically change the configuration of the repository should + raise this event notification to notify listeners. - + - Convert the source object to the type supported by this object + Flushes all configured Appenders that implement . + + The maximum time in milliseconds to wait for logging events from asycnhronous appenders to be flushed, + or to wait indefinitely. + True if all logging events were flushed successfully, else false. + + + + The log4net Thread Context. - the object to convert - the converted object - Uses the method to convert the - argument to a . + The ThreadContext provides a location for thread specific debugging + information to be stored. + The ThreadContext properties override any + properties with the same name. + + + The thread context has a properties map and a stack. + The properties and stack can + be included in the output of log messages. The + supports selecting and outputting these properties. + + + The Thread Context provides a diagnostic context for the current thread. + This is an instrument for distinguishing interleaved log + output from different sources. Log output is typically interleaved + when a server handles multiple clients near-simultaneously. + + + The Thread Context is managed on a per thread basis. - - The object cannot be converted to the - target type. To check for this condition use the - method. - + Example of using the thread context properties to store a username. + + ThreadContext.Properties["user"] = userName; + log.Info("This log message has a ThreadContext Property called 'user'"); + + + Example of how to push a message into the context stack + + using(ThreadContext.Stacks["NDC"].Push("my context message")) + { + log.Info("This log message has a ThreadContext Stack message that includes 'my context message'"); + + } // at the end of the using block the message is automatically popped + + + + Nicko Cadell - + - Exception base type for conversion errors. + Private Constructor. - This type extends . It - does not add any new functionality but does differentiate the - type of exception being thrown. + Uses a private access modifier to prevent instantiation of this class. - Nicko Cadell - Gert Driesen - + - Constructor + The thread properties map + + The thread properties map + - Initializes a new instance of the class. + The ThreadContext properties override any + properties with the same name. - + - Constructor + The thread stacks - A message to include with the exception. + + stack map + - Initializes a new instance of the class - with the specified message. + The thread local stacks. - + - Constructor + The thread context properties instance + + + + + The thread context stacks instance + + + + + A straightforward implementation of the interface. - A message to include with the exception. - A nested exception to include. - Initializes a new instance of the class - with the specified message and inner exception. + This is the default implementation of the + interface. Implementors of the interface + should aggregate an instance of this type. + Nicko Cadell + Gert Driesen - + - Serialization constructor + Constructor - The that holds the serialized object data about the exception being thrown. - The that contains contextual information about the source or destination. - Initializes a new instance of the class - with serialized data. + Initializes a new instance of the class. - + - Creates a new instance of the class. + Append on on all attached appenders. - The conversion destination type. - The value to convert. - An instance of the . + The event being logged. + The number of appenders called. - Creates a new instance of the class. + Calls the method on all + attached appenders. - + - Creates a new instance of the class. + Append on on all attached appenders. - The conversion destination type. - The value to convert. - A nested exception to include. - An instance of the . + The array of events being logged. + The number of appenders called. - Creates a new instance of the class. + Calls the method on all + attached appenders. - + - Register of type converters for specific types. + Calls the DoAppende method on the with + the objects supplied. + The appender + The events - Maintains a registry of type converters used to convert between - types. - - - Use the and - methods to register new converters. - The and methods - lookup appropriate converters to use. + If the supports the + interface then the will be passed + through using that interface. Otherwise the + objects in the array will be passed one at a time. - - - Nicko Cadell - Gert Driesen - + - Private constructor + Attaches an appender. + The appender to add. - Initializes a new instance of the class. + + If the appender is already in the list it won't be added again. + - + - Static constructor. + Gets all attached appenders. + + A collection of attached appenders, or null if there + are no attached appenders. + - This constructor defines the intrinsic type converters. + The read only collection of all currently attached appenders. - + - Adds a converter for a specific type. + Gets an attached appender with the specified name. - The type being converted to. - The type converter to use to convert to the destination type. + The name of the appender to get. + + The appender with the name specified, or null if no appender with the + specified name is found. + - Adds a converter instance for a specific type. + Lookup an attached appender by name. - + - Adds a converter for a specific type. + Removes all attached appenders. - The type being converted to. - The type of the type converter to use to convert to the destination type. - Adds a converter for a specific type. + Removes and closes all attached appenders - + - Gets the type converter to use to convert values to the destination type. + Removes the specified appender from the list of attached appenders. - The type being converted from. - The type being converted to. - - The type converter instance to use for type conversions or null - if no type converter is found. - + The appender to remove. + The appender removed from the list - Gets the type converter to use to convert values to the destination type. + The appender removed is not closed. + If you are discarding the appender you must call + on the appender removed. - + - Gets the type converter to use to convert values to the destination type. + Removes the appender with the specified name from the list of appenders. - The type being converted to. - - The type converter instance to use for type conversions or null - if no type converter is found. - + The name of the appender to remove. + The appender removed from the list - Gets the type converter to use to convert values to the destination type. + The appender removed is not closed. + If you are discarding the appender you must call + on the appender removed. - + - Lookups the type converter to use as specified by the attributes on the - destination type. + List of appenders - The type being converted to. - - The type converter instance to use for type conversions or null - if no type converter is found. - - + - Creates the instance of the type converter. + Array of appenders, used to cache the m_appenderList - The type of the type converter. - - The type converter instance to use for type conversions or null - if no type converter is found. - - - - The type specified for the type converter must implement - the or interfaces - and must have a public default (no argument) constructor. - - - + - The fully qualified type of the ConverterRegistry class. + The fully qualified type of the AppenderAttachedImpl class. Used by the internal logger to record the Type of the log message. - + - Mapping from to type converter. + This class aggregates several PropertiesDictionary collections together. + + + Provides a dictionary style lookup over an ordered list of + collections. + + + Nicko Cadell - + - Supports conversion from string to type. + Constructor - Supports conversion from string to type. + Initializes a new instance of the class. - - - - Nicko Cadell - Gert Driesen - + - Can the source type be converted to the type supported by this object + Gets the value of a property - the type to convert - true if the conversion is possible + + The value for the property with the specified key + - Returns true if the is - the type. + Looks up the value for the specified. + The collections are searched + in the order in which they were added to this collection. The value + returned is the value held by the first collection that contains + the specified key. + + + If none of the collections contain the specified key then + null is returned. - + - Overrides the ConvertFrom method of IConvertFrom. + Add a Properties Dictionary to this composite collection - the object to convert to an encoding - the encoding + the properties to add - Uses the method to - convert the argument to an . + Properties dictionaries added first take precedence over dictionaries added + later. - - The object cannot be converted to the - target type. To check for this condition use the - method. - - + - Interface supported by type converters + Flatten this composite collection into a single properties dictionary + the flattened dictionary - This interface supports conversion from a single type to arbitrary types. - See . + Reduces the collection of ordered dictionaries to a single dictionary + containing the resultant values for the keys. - Nicko Cadell - + - Returns whether this converter can convert the object to the specified type + Base class for Context Properties implementations - A Type that represents the type you want to convert to - true if the conversion is possible - Test if the type supported by this converter can be converted to the - . + This class defines a basic property get set accessor + Nicko Cadell - + - Converts the given value object to the specified type, using the arguments + Gets or sets the value of a property - the object to convert - The Type to convert the value parameter to - the converted object + + The value for the property with the specified key + - Converts the (which must be of the type supported - by this converter) to the specified.. + Gets or sets the value of a property - + - Supports conversion from string to type. + Wrapper class used to map converter names to converter types - Supports conversion from string to type. + Pattern converter info class used during configuration by custom + PatternString and PatternLayer converters. - - - Nicko Cadell - + - Can the source type be converted to the type supported by this object + default constructor + + + + + Gets or sets the name of the conversion pattern - the type to convert - true if the conversion is possible - Returns true if the is - the type. + The name of the pattern in the format string - + - Overrides the ConvertFrom method of IConvertFrom. + Gets or sets the type of the converter - the object to convert to an IPAddress - the IPAddress - Uses the method to convert the - argument to an . - If that fails then the string is resolved as a DNS hostname. + The value specified must extend the + type. - - The object cannot be converted to the - target type. To check for this condition use the - method. - - + - Valid characters in an IPv4 or IPv6 address string. (Does not support subnets) + + - + - Supports conversion from string to type. + + + + + + Subclass of that maintains a count of + the number of bytes written. - Supports conversion from string to type. - - - The string is used as the - of the . + This writer counts the number of bytes written. - - - Nicko Cadell + Gert Driesen - + - Can the source type be converted to the type supported by this object + Constructor - the type to convert - true if the conversion is possible + The to actually write to. + The to report errors to. - Returns true if the is - the type. + Creates a new instance of the class + with the specified and . - + - Overrides the ConvertFrom method of IConvertFrom. + Writes a character to the underlying writer and counts the number of bytes written. - the object to convert to a PatternLayout - the PatternLayout + the char to write - Creates and returns a new using - the as the - . + Overrides implementation of . Counts + the number of bytes written. - - The object cannot be converted to the - target type. To check for this condition use the - method. - - + - Convert between string and + Writes a buffer to the underlying writer and counts the number of bytes written. + the buffer to write + the start index to write from + the number of characters to write - Supports conversion from string to type, - and from a type to a string. - - - The string is used as the - of the . + Overrides implementation of . Counts + the number of bytes written. - - - - Nicko Cadell - + - Can the target type be converted to the type supported by this object + Writes a string to the output and counts the number of bytes written. - A that represents the type you want to convert to - true if the conversion is possible + The string data to write to the output. - Returns true if the is - assignable from a type. + Overrides implementation of . Counts + the number of bytes written. - + - Converts the given value object to the specified type, using the arguments + Gets or sets the total number of bytes written. - the object to convert - The Type to convert the value parameter to - the converted object + + The total number of bytes written. + - Uses the method to convert the - argument to a . + Gets or sets the total number of bytes written. - - The object cannot be converted to the - . To check for this condition use the - method. - - + - Can the source type be converted to the type supported by this object + Total number of bytes written. + + + + + A fixed size rolling buffer of logging events. - the type to convert - true if the conversion is possible - Returns true if the is - the type. + An array backed fixed size leaky bucket. + Nicko Cadell + Gert Driesen - + - Overrides the ConvertFrom method of IConvertFrom. + Constructor - the object to convert to a PatternString - the PatternString + The maximum number of logging events in the buffer. - Creates and returns a new using - the as the - . + Initializes a new instance of the class with + the specified maximum number of buffered logging events. - - The object cannot be converted to the - target type. To check for this condition use the - method. - + The argument is not a positive integer. - + - Supports conversion from string to type. + Appends a to the buffer. + The event to append to the buffer. + The event discarded from the buffer, if the buffer is full, otherwise null. - Supports conversion from string to type. + Append an event to the buffer. If the buffer still contains free space then + null is returned. If the buffer is full then an event will be dropped + to make space for the new event, the event dropped is returned. - - - - Nicko Cadell - + - Can the source type be converted to the type supported by this object + Get and remove the oldest event in the buffer. - the type to convert - true if the conversion is possible + The oldest logging event in the buffer - Returns true if the is - the type. + Gets the oldest (first) logging event in the buffer and removes it + from the buffer. - + - Overrides the ConvertFrom method of IConvertFrom. + Pops all the logging events from the buffer into an array. - the object to convert to a Type - the Type + An array of all the logging events in the buffer. - Uses the method to convert the - argument to a . - Additional effort is made to locate partially specified types - by searching the loaded assemblies. + Get all the events in the buffer and clear the buffer. - - The object cannot be converted to the - target type. To check for this condition use the - method. - - + - Attribute used to associate a type converter + Clear the buffer - Class and Interface level attribute that specifies a type converter - to use with the associated type. - - - To associate a type converter with a target type apply a - TypeConverterAttribute to the target type. Specify the - type of the type converter on the attribute. + Clear the buffer of all events. The events in the buffer are lost. - Nicko Cadell - Gert Driesen - - - - The string type name of the type converter - - + - Default constructor + Gets the th oldest event currently in the buffer. + The th oldest event currently in the buffer. - Default constructor + If is outside the range 0 to the number of events + currently in the buffer, then null is returned. - + - Create a new type converter attribute for the specified type name + Gets the maximum size of the buffer. - The string type name of the type converter + The maximum size of the buffer. - The type specified must implement the - or the interfaces. + Gets the maximum size of the buffer - + - Create a new type converter attribute for the specified type + Gets the number of logging events in the buffer. - The type of the type converter + The number of logging events in the buffer. - The type specified must implement the - or the interfaces. + This number is guaranteed to be in the range 0 to + (inclusive). - + - The string type name of the type converter + An always empty . - - The string type name of the type converter - - The type specified must implement the - or the interfaces. + A singleton implementation of the + interface that always represents an empty collection. + Nicko Cadell + Gert Driesen - + - A straightforward implementation of the interface. + Initializes a new instance of the class. - This is the default implementation of the - interface. Implementors of the interface - should aggregate an instance of this type. + Uses a private access modifier to enforce the singleton pattern. - Nicko Cadell - Gert Driesen - + - Constructor + Gets the singleton instance of the empty collection. + The singleton instance of the empty collection. - Initializes a new instance of the class. + Gets the singleton instance of the empty collection. - + - Append on on all attached appenders. + Copies the elements of the to an + , starting at a particular Array index. - The event being logged. - The number of appenders called. + The one-dimensional + that is the destination of the elements copied from + . The Array must have zero-based + indexing. + The zero-based index in array at which + copying begins. - Calls the method on all - attached appenders. + As the collection is empty no values are copied into the array. - + - Append on on all attached appenders. + Gets a value indicating if access to the is synchronized (thread-safe). - The array of events being logged. - The number of appenders called. + + true if access to the is synchronized (thread-safe); otherwise, false. + - Calls the method on all - attached appenders. + For the this property is always true. - + - Calls the DoAppende method on the with - the objects supplied. + Gets the number of elements contained in the . - The appender - The events + + The number of elements contained in the . + - If the supports the - interface then the will be passed - through using that interface. Otherwise the - objects in the array will be passed one at a time. + As the collection is empty the is always 0. - + - Attaches an appender. + Gets an object that can be used to synchronize access to the . - The appender to add. + + An object that can be used to synchronize access to the . + - If the appender is already in the list it won't be added again. + As the collection is empty and thread safe and synchronized this instance is also + the object. - + - Gets an attached appender with the specified name. + Returns an enumerator that can iterate through a collection. - The name of the appender to get. - The appender with the name specified, or null if no appender with the - specified name is found. + An that can be used to + iterate through the collection. - Lookup an attached appender by name. + As the collection is empty a is returned. - + - Removes all attached appenders. + The singleton instance of the empty collection. + + + + + An always empty . - Removes and closes all attached appenders + A singleton implementation of the + interface that always represents an empty collection. + Nicko Cadell + Gert Driesen - + - Removes the specified appender from the list of attached appenders. + Initializes a new instance of the class. - The appender to remove. - The appender removed from the list - The appender removed is not closed. - If you are discarding the appender you must call - on the appender removed. + Uses a private access modifier to enforce the singleton pattern. - + - Removes the appender with the specified name from the list of appenders. + Gets the singleton instance of the . - The name of the appender to remove. - The appender removed from the list + The singleton instance of the . - The appender removed is not closed. - If you are discarding the appender you must call - on the appender removed. + Gets the singleton instance of the . - + - List of appenders + Copies the elements of the to an + , starting at a particular Array index. + The one-dimensional + that is the destination of the elements copied from + . The Array must have zero-based + indexing. + The zero-based index in array at which + copying begins. + + + As the collection is empty no values are copied into the array. + + - + - Array of appenders, used to cache the m_appenderList + Gets a value indicating if access to the is synchronized (thread-safe). + + true if access to the is synchronized (thread-safe); otherwise, false. + + + + For the this property is always true. + + - + - The fully qualified type of the AppenderAttachedImpl class. + Gets the number of elements contained in the + + The number of elements contained in the . + - Used by the internal logger to record the Type of the - log message. + + As the collection is empty the is always 0. + - + - Gets all attached appenders. + Gets an object that can be used to synchronize access to the . - - A collection of attached appenders, or null if there - are no attached appenders. - + + An object that can be used to synchronize access to the . + - The read only collection of all currently attached appenders. + As the collection is empty and thread safe and synchronized this instance is also + the object. - + - This class aggregates several PropertiesDictionary collections together. + Returns an enumerator that can iterate through a collection. + + An that can be used to + iterate through the collection. + - Provides a dictionary style lookup over an ordered list of - collections. + As the collection is empty a is returned. - Nicko Cadell - + - Constructor + Adds an element with the provided key and value to the + . + The to use as the key of the element to add. + The to use as the value of the element to add. - Initializes a new instance of the class. + As the collection is empty no new values can be added. A + is thrown if this method is called. + This dictionary is always empty and cannot be modified. - + - Add a Properties Dictionary to this composite collection + Removes all elements from the . - the properties to add - Properties dictionaries added first take precedence over dictionaries added - later. + As the collection is empty no values can be removed. A + is thrown if this method is called. + This dictionary is always empty and cannot be modified. - + - Flatten this composite collection into a single properties dictionary + Determines whether the contains an element + with the specified key. - the flattened dictionary + The key to locate in the . + false - Reduces the collection of ordered dictionaries to a single dictionary - containing the resultant values for the keys. + As the collection is empty the method always returns false. - + - Gets the value of a property + Returns an enumerator that can iterate through a collection. - - The value for the property with the specified key - + + An that can be used to + iterate through the collection. + - Looks up the value for the specified. - The collections are searched - in the order in which they were added to this collection. The value - returned is the value held by the first collection that contains - the specified key. - - - If none of the collections contain the specified key then - null is returned. + As the collection is empty a is returned. - + - Base class for Context Properties implementations + Removes the element with the specified key from the . + The key of the element to remove. - This class defines a basic property get set accessor + As the collection is empty no values can be removed. A + is thrown if this method is called. - Nicko Cadell + This dictionary is always empty and cannot be modified. - + - Gets or sets the value of a property + Gets a value indicating whether the has a fixed size. - - The value for the property with the specified key - + true - Gets or sets the value of a property + As the collection is empty always returns true. - + - Wrapper class used to map converter names to converter types + Gets a value indicating whether the is read-only. + true - Pattern converter info class used during configuration by custom - PatternString and PatternLayer converters. + As the collection is empty always returns true. - - - default constructor - - - + - + Gets an containing the keys of the . - + An containing the keys of the . + + + As the collection is empty a is returned. + + - + - Gets or sets the name of the conversion pattern + Gets an containing the values of the . + An containing the values of the . - The name of the pattern in the format string + As the collection is empty a is returned. - + - Gets or sets the type of the converter + Gets or sets the element with the specified key. + The key of the element to get or set. + null - The value specified must extend the - type. + As the collection is empty no values can be looked up or stored. + If the index getter is called then null is returned. + A is thrown if the setter is called. + This dictionary is always empty and cannot be modified. - + - + The singleton instance of the empty dictionary. - + - Subclass of that maintains a count of - the number of bytes written. + Contain the information obtained when parsing formatting modifiers + in conversion modifiers. - This writer counts the number of bytes written. + Holds the formatting information extracted from the format string by + the . This is used by the + objects when rendering the output. Nicko Cadell Gert Driesen - + - that does not leak exceptions + Defaut Constructor - does not throw exceptions when things go wrong. - Instead, it delegates error handling to its . + Initializes a new instance of the class. - Nicko Cadell - Gert Driesen - + - Adapter that extends and forwards all - messages to an instance of . + Constructor - Adapter that extends and forwards all - messages to an instance of . + Initializes a new instance of the class + with the specified parameters. - Nicko Cadell - - - - The writer to forward messages to - - + - Create an instance of that forwards all - messages to a . + Gets or sets the minimum value. - The to forward to + + The minimum value. + - Create an instance of that forwards all - messages to a . + Gets or sets the minimum value. - + - Closes the writer and releases any system resources associated with the writer + Gets or sets the maximum value. + + The maximum value. + + Gets or sets the maximum value. - + - Dispose this writer + Gets or sets a flag indicating whether left align is enabled + or not. - flag indicating if we are being disposed + + A flag indicating whether left align is enabled or not. + - Dispose this writer + Gets or sets a flag indicating whether left align is enabled or not. - + - Flushes any buffered output + Implementation of Properties collection for the - Clears all buffers for the writer and causes any buffered data to be written - to the underlying device + This class implements a properties collection that is thread safe and supports both + storing properties and capturing a read only copy of the current propertied. + + + This class is optimized to the scenario where the properties are read frequently + and are modified infrequently. + Nicko Cadell - + - Writes a character to the wrapped TextWriter + The read only copy of the properties. - the value to write to the TextWriter - Writes a character to the wrapped TextWriter + This variable is declared volatile to prevent the compiler and JIT from + reordering reads and writes of this thread performed on different threads. - + - Writes a character buffer to the wrapped TextWriter + Lock object used to synchronize updates within this instance - the data buffer - the start index - the number of characters to write - - - Writes a character buffer to the wrapped TextWriter - - - + - Writes a string to the wrapped TextWriter + Constructor - the value to write to the TextWriter - Writes a string to the wrapped TextWriter + Initializes a new instance of the class. - + - Gets or sets the underlying . + Gets or sets the value of a property - The underlying . + The value for the property with the specified key - Gets or sets the underlying . + Reading the value for a key is faster than setting the value. + When the value is written a new read only copy of + the properties is created. - + - The Encoding in which the output is written + Remove a property from the global context - - The - + the key for the entry to remove - The Encoding in which the output is written + Removing an entry from the global context properties is relatively expensive compared + with reading a value. - + - Gets an object that controls formatting + Clear the global context properties - - The format provider - - - - Gets an object that controls formatting - - - + - Gets or sets the line terminator string used by the TextWriter + Get a readonly immutable copy of the properties - - The line terminator to use - + the current global context properties - Gets or sets the line terminator string used by the TextWriter + This implementation is fast because the GlobalContextProperties class + stores a readonly copy of the properties. - + - Constructor + The static class ILogExtensions contains a set of widely used + methods that ease the interaction with the ILog interface implementations. - the writer to actually write to - the error handler to report error to - Create a new QuietTextWriter using a writer and error handler + This class contains methods for logging at different levels and checks the + properties for determining if those logging levels are enabled in the current + configuration. + Simple example of logging messages + + using log4net.Util; + + ILog log = LogManager.GetLogger("application-log"); + + log.InfoExt("Application Start"); + log.DebugExt("This is a debug message"); + + - + - Writes a character to the underlying writer + The fully qualified type of the Logger class. - the char to write - - - Writes a character to the underlying writer - - - + - Writes a buffer to the underlying writer + Log a message object with the level. - the buffer to write - the start index to write from - the number of characters to write + The logger on which the message is logged. + The lambda expression that gets the object to log. - Writes a buffer to the underlying writer + This method first checks if this logger is INFO + enabled by reading the value property. + This check happens always and does not depend on the + implementation. If this logger is INFO enabled, then it converts + the message object (retrieved by invocation of the provided callback) to a + string by invoking the appropriate . + It then proceeds to call all the registered appenders in this logger + and also higher in the hierarchy depending on the value of + the additivity flag. + + WARNING Note that passing an + to this method will print the name of the + but no stack trace. To print a stack trace use the + form instead. + + - + - Writes a string to the output. + Log a message object with the level including + the stack trace of the passed + as a parameter. - The string data to write to the output. + The logger on which the message is logged. + The lambda expression that gets the object to log. + The exception to log, including its stack trace. - Writes a string to the output. + See the form for more detailed information. + + - + + Log a message object with the level. //TODO - Closes the underlying output writer. + Log a message object with the level. + The logger on which the message is logged. + The message object to log. - Closes the underlying output writer. + This method first checks if this logger is INFO + enabled by reading the value property. + This check happens always and does not depend on the + implementation. If this logger is INFO enabled, then it converts + the message object (passed as parameter) to a string by invoking the appropriate + . It then + proceeds to call all the registered appenders in this logger + and also higher in the hierarchy depending on the value of + the additivity flag. + + WARNING Note that passing an + to this method will print the name of the + but no stack trace. To print a stack trace use the + form instead. + + - - - The error handler instance to pass all errors to - - - - - Flag to indicate if this writer is closed - - - + - Gets or sets the error handler that all errors are passed to. + Log a message object with the level including + the stack trace of the passed + as a parameter. - - The error handler that all errors are passed to. - + The logger on which the message is logged. + The message object to log. + The exception to log, including its stack trace. - Gets or sets the error handler that all errors are passed to. + See the form for more detailed information. + + - + - Gets a value indicating whether this writer is closed. + Logs a formatted message string with the level. - - true if this writer is closed, otherwise false. - + The logger on which the message is logged. + A String containing zero or more format items + An Object to format - Gets a value indicating whether this writer is closed. + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + - + - Constructor + Logs a formatted message string with the level. - The to actually write to. - The to report errors to. + The logger on which the message is logged. + A String containing zero or more format items + An Object array containing zero or more objects to format - Creates a new instance of the class - with the specified and . + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + - + - Writes a character to the underlying writer and counts the number of bytes written. + Logs a formatted message string with the level. - the char to write + An that supplies culture-specific formatting information + The logger on which the message is logged. + A String containing zero or more format items + An Object array containing zero or more objects to format - Overrides implementation of . Counts - the number of bytes written. + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + - + - Writes a buffer to the underlying writer and counts the number of bytes written. + Logs a formatted message string with the level. - the buffer to write - the start index to write from - the number of characters to write + The logger on which the message is logged. + A String containing zero or more format items + An Object to format + An Object to format - Overrides implementation of . Counts - the number of bytes written. + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + - + - Writes a string to the output and counts the number of bytes written. + Logs a formatted message string with the level. - The string data to write to the output. + The logger on which the message is logged. + A String containing zero or more format items + An Object to format + An Object to format + An Object to format - Overrides implementation of . Counts - the number of bytes written. + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + - - - Total number of bytes written. - - - + - Gets or sets the total number of bytes written. + Log a message object with the level. - - The total number of bytes written. - + The logger on which the message is logged. + The lambda expression that gets the object to log. - Gets or sets the total number of bytes written. + This method first checks if this logger is INFO + enabled by reading the value property. + This check happens always and does not depend on the + implementation. If this logger is INFO enabled, then it converts + the message object (retrieved by invocation of the provided callback) to a + string by invoking the appropriate . + It then proceeds to call all the registered appenders in this logger + and also higher in the hierarchy depending on the value of + the additivity flag. + + WARNING Note that passing an + to this method will print the name of the + but no stack trace. To print a stack trace use the + form instead. + + - + - A fixed size rolling buffer of logging events. + Log a message object with the level including + the stack trace of the passed + as a parameter. + The logger on which the message is logged. + The lambda expression that gets the object to log. + The exception to log, including its stack trace. - An array backed fixed size leaky bucket. + See the form for more detailed information. - Nicko Cadell - Gert Driesen + + - + + Log a message object with the level. //TODO - Constructor + Log a message object with the level. - The maximum number of logging events in the buffer. + The logger on which the message is logged. + The message object to log. - Initializes a new instance of the class with - the specified maximum number of buffered logging events. + This method first checks if this logger is INFO + enabled by reading the value property. + This check happens always and does not depend on the + implementation. If this logger is INFO enabled, then it converts + the message object (passed as parameter) to a string by invoking the appropriate + . It then + proceeds to call all the registered appenders in this logger + and also higher in the hierarchy depending on the value of + the additivity flag. + + WARNING Note that passing an + to this method will print the name of the + but no stack trace. To print a stack trace use the + form instead. - The argument is not a positive integer. + + - + - Appends a to the buffer. + Log a message object with the level including + the stack trace of the passed + as a parameter. - The event to append to the buffer. - The event discarded from the buffer, if the buffer is full, otherwise null. + The logger on which the message is logged. + The message object to log. + The exception to log, including its stack trace. - Append an event to the buffer. If the buffer still contains free space then - null is returned. If the buffer is full then an event will be dropped - to make space for the new event, the event dropped is returned. + See the form for more detailed information. + + - + - Get and remove the oldest event in the buffer. + Logs a formatted message string with the level. - The oldest logging event in the buffer + The logger on which the message is logged. + A String containing zero or more format items + An Object to format - Gets the oldest (first) logging event in the buffer and removes it - from the buffer. + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + - + - Pops all the logging events from the buffer into an array. + Logs a formatted message string with the level. - An array of all the logging events in the buffer. + The logger on which the message is logged. + A String containing zero or more format items + An Object array containing zero or more objects to format - Get all the events in the buffer and clear the buffer. + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + - + - Clear the buffer + Logs a formatted message string with the level. + An that supplies culture-specific formatting information + The logger on which the message is logged. + A String containing zero or more format items + An Object array containing zero or more objects to format - Clear the buffer of all events. The events in the buffer are lost. + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + - + - Gets the th oldest event currently in the buffer. + Logs a formatted message string with the level. - The th oldest event currently in the buffer. + The logger on which the message is logged. + A String containing zero or more format items + An Object to format + An Object to format - If is outside the range 0 to the number of events - currently in the buffer, then null is returned. + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + - + - Gets the maximum size of the buffer. + Logs a formatted message string with the level. - The maximum size of the buffer. + The logger on which the message is logged. + A String containing zero or more format items + An Object to format + An Object to format + An Object to format - Gets the maximum size of the buffer + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + - + - Gets the number of logging events in the buffer. + Log a message object with the level. - The number of logging events in the buffer. + The logger on which the message is logged. + The lambda expression that gets the object to log. - This number is guaranteed to be in the range 0 to - (inclusive). + This method first checks if this logger is WARN + enabled by reading the value property. + This check happens always and does not depend on the + implementation. If this logger is WARN enabled, then it converts + the message object (retrieved by invocation of the provided callback) to a + string by invoking the appropriate . + It then proceeds to call all the registered appenders in this logger + and also higher in the hierarchy depending on the value of + the additivity flag. + + WARNING Note that passing an + to this method will print the name of the + but no stack trace. To print a stack trace use the + form instead. + + - + - An always empty . + Log a message object with the level including + the stack trace of the passed + as a parameter. + The logger on which the message is logged. + The lambda expression that gets the object to log. + The exception to log, including its stack trace. - A singleton implementation of the - interface that always represents an empty collection. + See the form for more detailed information. - Nicko Cadell - Gert Driesen + + - + + Log a message object with the level. //TODO - Initializes a new instance of the class. + Log a message object with the level. + The logger on which the message is logged. + The message object to log. - Uses a private access modifier to enforce the singleton pattern. + This method first checks if this logger is WARN + enabled by reading the value property. + This check happens always and does not depend on the + implementation. If this logger is WARN enabled, then it converts + the message object (passed as parameter) to a string by invoking the appropriate + . It then + proceeds to call all the registered appenders in this logger + and also higher in the hierarchy depending on the value of + the additivity flag. + + WARNING Note that passing an + to this method will print the name of the + but no stack trace. To print a stack trace use the + form instead. + + - + - Copies the elements of the to an - , starting at a particular Array index. + Log a message object with the level including + the stack trace of the passed + as a parameter. - The one-dimensional - that is the destination of the elements copied from - . The Array must have zero-based - indexing. - The zero-based index in array at which - copying begins. + The logger on which the message is logged. + The message object to log. + The exception to log, including its stack trace. - As the collection is empty no values are copied into the array. + See the form for more detailed information. + + - + - Returns an enumerator that can iterate through a collection. + Logs a formatted message string with the level. - - An that can be used to - iterate through the collection. - + The logger on which the message is logged. + A String containing zero or more format items + An Object to format - As the collection is empty a is returned. + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + - - - The singleton instance of the empty collection. - - - + - Gets the singleton instance of the empty collection. + Logs a formatted message string with the level. - The singleton instance of the empty collection. + The logger on which the message is logged. + A String containing zero or more format items + An Object array containing zero or more objects to format - Gets the singleton instance of the empty collection. + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + - + - Gets a value indicating if access to the is synchronized (thread-safe). + Logs a formatted message string with the level. - - true if access to the is synchronized (thread-safe); otherwise, false. - + An that supplies culture-specific formatting information + The logger on which the message is logged. + A String containing zero or more format items + An Object array containing zero or more objects to format - For the this property is always true. + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + - + - Gets the number of elements contained in the . + Logs a formatted message string with the level. - - The number of elements contained in the . - + The logger on which the message is logged. + A String containing zero or more format items + An Object to format + An Object to format - As the collection is empty the is always 0. + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + - + - Gets an object that can be used to synchronize access to the . + Logs a formatted message string with the level. - - An object that can be used to synchronize access to the . - + The logger on which the message is logged. + A String containing zero or more format items + An Object to format + An Object to format + An Object to format - As the collection is empty and thread safe and synchronized this instance is also - the object. + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + - + - An always empty . + Log a message object with the level. + The logger on which the message is logged. + The lambda expression that gets the object to log. - A singleton implementation of the - interface that always represents an empty collection. + This method first checks if this logger is ERROR + enabled by reading the value property. + This check happens always and does not depend on the + implementation. If this logger is ERROR enabled, then it converts + the message object (retrieved by invocation of the provided callback) to a + string by invoking the appropriate . + It then proceeds to call all the registered appenders in this logger + and also higher in the hierarchy depending on the value of + the additivity flag. + + WARNING Note that passing an + to this method will print the name of the + but no stack trace. To print a stack trace use the + form instead. - Nicko Cadell - Gert Driesen + + - + - Initializes a new instance of the class. + Log a message object with the level including + the stack trace of the passed + as a parameter. + The logger on which the message is logged. + The lambda expression that gets the object to log. + The exception to log, including its stack trace. - Uses a private access modifier to enforce the singleton pattern. + See the form for more detailed information. + + - + + Log a message object with the level. //TODO - Copies the elements of the to an - , starting at a particular Array index. + Log a message object with the level. - The one-dimensional - that is the destination of the elements copied from - . The Array must have zero-based - indexing. - The zero-based index in array at which - copying begins. + The logger on which the message is logged. + The message object to log. - As the collection is empty no values are copied into the array. + This method first checks if this logger is ERROR + enabled by reading the value property. + This check happens always and does not depend on the + implementation. If this logger is ERROR enabled, then it converts + the message object (passed as parameter) to a string by invoking the appropriate + . It then + proceeds to call all the registered appenders in this logger + and also higher in the hierarchy depending on the value of + the additivity flag. + + WARNING Note that passing an + to this method will print the name of the + but no stack trace. To print a stack trace use the + form instead. + + - + - Returns an enumerator that can iterate through a collection. + Log a message object with the level including + the stack trace of the passed + as a parameter. - - An that can be used to - iterate through the collection. - + The logger on which the message is logged. + The message object to log. + The exception to log, including its stack trace. - As the collection is empty a is returned. + See the form for more detailed information. + + - + - Adds an element with the provided key and value to the - . + Logs a formatted message string with the level. - The to use as the key of the element to add. - The to use as the value of the element to add. + The logger on which the message is logged. + A String containing zero or more format items + An Object to format - As the collection is empty no new values can be added. A - is thrown if this method is called. + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. - This dictionary is always empty and cannot be modified. + + - + - Removes all elements from the . + Logs a formatted message string with the level. + The logger on which the message is logged. + A String containing zero or more format items + An Object array containing zero or more objects to format - As the collection is empty no values can be removed. A - is thrown if this method is called. + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. - This dictionary is always empty and cannot be modified. + + - + - Determines whether the contains an element - with the specified key. + Logs a formatted message string with the level. - The key to locate in the . - false + An that supplies culture-specific formatting information + The logger on which the message is logged. + A String containing zero or more format items + An Object array containing zero or more objects to format - As the collection is empty the method always returns false. + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + - + - Returns an enumerator that can iterate through a collection. + Logs a formatted message string with the level. - - An that can be used to - iterate through the collection. - + The logger on which the message is logged. + A String containing zero or more format items + An Object to format + An Object to format - As the collection is empty a is returned. + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + - + - Removes the element with the specified key from the . + Logs a formatted message string with the level. - The key of the element to remove. + The logger on which the message is logged. + A String containing zero or more format items + An Object to format + An Object to format + An Object to format - As the collection is empty no values can be removed. A - is thrown if this method is called. + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. - This dictionary is always empty and cannot be modified. - - - - The singleton instance of the empty dictionary. - + + - + - Gets the singleton instance of the . + Log a message object with the level. - The singleton instance of the . + The logger on which the message is logged. + The lambda expression that gets the object to log. - Gets the singleton instance of the . + This method first checks if this logger is FATAL + enabled by reading the value property. + This check happens always and does not depend on the + implementation. If this logger is FATAL enabled, then it converts + the message object (retrieved by invocation of the provided callback) to a + string by invoking the appropriate . + It then proceeds to call all the registered appenders in this logger + and also higher in the hierarchy depending on the value of + the additivity flag. + + WARNING Note that passing an + to this method will print the name of the + but no stack trace. To print a stack trace use the + form instead. + + - + - Gets a value indicating if access to the is synchronized (thread-safe). + Log a message object with the level including + the stack trace of the passed + as a parameter. - - true if access to the is synchronized (thread-safe); otherwise, false. - + The logger on which the message is logged. + The lambda expression that gets the object to log. + The exception to log, including its stack trace. - For the this property is always true. + See the form for more detailed information. + + - + + Log a message object with the level. //TODO - Gets the number of elements contained in the + Log a message object with the level. - - The number of elements contained in the . - + The logger on which the message is logged. + The message object to log. - As the collection is empty the is always 0. + This method first checks if this logger is FATAL + enabled by reading the value property. + This check happens always and does not depend on the + implementation. If this logger is FATAL enabled, then it converts + the message object (passed as parameter) to a string by invoking the appropriate + . It then + proceeds to call all the registered appenders in this logger + and also higher in the hierarchy depending on the value of + the additivity flag. + + WARNING Note that passing an + to this method will print the name of the + but no stack trace. To print a stack trace use the + form instead. + + - + - Gets an object that can be used to synchronize access to the . + Log a message object with the level including + the stack trace of the passed + as a parameter. - - An object that can be used to synchronize access to the . - + The logger on which the message is logged. + The message object to log. + The exception to log, including its stack trace. - As the collection is empty and thread safe and synchronized this instance is also - the object. + See the form for more detailed information. + + - + - Gets a value indicating whether the has a fixed size. + Logs a formatted message string with the level. - true + The logger on which the message is logged. + A String containing zero or more format items + An Object to format - As the collection is empty always returns true. + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + - + - Gets a value indicating whether the is read-only. + Logs a formatted message string with the level. - true + The logger on which the message is logged. + A String containing zero or more format items + An Object array containing zero or more objects to format - As the collection is empty always returns true. + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + - + - Gets an containing the keys of the . + Logs a formatted message string with the level. - An containing the keys of the . + An that supplies culture-specific formatting information + The logger on which the message is logged. + A String containing zero or more format items + An Object array containing zero or more objects to format - As the collection is empty a is returned. + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + - + - Gets an containing the values of the . + Logs a formatted message string with the level. - An containing the values of the . + The logger on which the message is logged. + A String containing zero or more format items + An Object to format + An Object to format - As the collection is empty a is returned. + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + - + - Gets or sets the element with the specified key. + Logs a formatted message string with the level. - The key of the element to get or set. - null + The logger on which the message is logged. + A String containing zero or more format items + An Object to format + An Object to format + An Object to format - As the collection is empty no values can be looked up or stored. - If the index getter is called then null is returned. - A is thrown if the setter is called. + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. - This dictionary is always empty and cannot be modified. + + - + - Contain the information obtained when parsing formatting modifiers - in conversion modifiers. + Manages a mapping from levels to - Holds the formatting information extracted from the format string by - the . This is used by the - objects when rendering the output. + Manages an ordered mapping from instances + to subclasses. Nicko Cadell - Gert Driesen - + - Defaut Constructor + Default constructor - Initializes a new instance of the class. + Initialise a new instance of . - + - Constructor + Add a to this mapping + the entry to add - Initializes a new instance of the class - with the specified parameters. + If a has previously been added + for the same then that entry will be + overwritten. - + - Gets or sets the minimum value. + Lookup the mapping for the specified level - - The minimum value. - + the level to lookup + the for the level or null if no mapping found - Gets or sets the minimum value. + Lookup the value for the specified level. Finds the nearest + mapping value for the level that is equal to or less than the + specified. - - - - - Gets or sets the maximum value. - - - The maximum value. - - - Gets or sets the maximum value. + If no mapping could be found then null is returned. - + - Gets or sets a flag indicating whether left align is enabled - or not. + Initialize options - - A flag indicating whether left align is enabled or not. - - Gets or sets a flag indicating whether left align is enabled or not. + Caches the sorted list of in an array - + - Implementation of Properties collection for the + An entry in the - This class implements a properties collection that is thread safe and supports both - storing properties and capturing a read only copy of the current propertied. - - - This class is optimized to the scenario where the properties are read frequently - and are modified infrequently. + This is an abstract base class for types that are stored in the + object. Nicko Cadell - + - The read only copy of the properties. + Default protected constructor - This variable is declared volatile to prevent the compiler and JIT from - reordering reads and writes of this thread performed on different threads. + Default protected constructor - + - Lock object used to synchronize updates within this instance + The level that is the key for this mapping + + The that is the key for this mapping + + + + Get or set the that is the key for this + mapping subclass. + + - + - Constructor + Initialize any options defined on this entry - Initializes a new instance of the class. + Should be overridden by any classes that need to initialise based on their options - + - Remove a property from the global context + Implementation of Properties collection for the - the key for the entry to remove - Removing an entry from the global context properties is relatively expensive compared - with reading a value. + Class implements a collection of properties that is specific to each thread. + The class is not synchronized as each thread has its own . + + + This class stores its properties in a slot on the named + log4net.Util.LogicalThreadContextProperties. + + + For .NET Standard 1.3 this class uses + System.Threading.AsyncLocal rather than . + + + The requires a link time + for the + . + If the calling code does not have this permission then this context will be disabled. + It will not store any property values set on it. + Nicko Cadell - + - Clear the global context properties + Flag used to disable this context if we don't have permission to access the CallContext. - + - Get a readonly immutable copy of the properties + Constructor - the current global context properties - This implementation is fast because the GlobalContextProperties class - stores a readonly copy of the properties. + Initializes a new instance of the class. - + Gets or sets the value of a property @@ -26170,3527 +26908,3375 @@ - Reading the value for a key is faster than setting the value. - When the value is written a new read only copy of - the properties is created. + Get or set the property value for the specified. - + - The static class ILogExtensions contains a set of widely used - methods that ease the interaction with the ILog interface implementations. + Remove a property + the key for the entry to remove - This class contains methods for logging at different levels and checks the - properties for determining if those logging levels are enabled in the current - configuration. + Remove the value for the specified from the context. - Simple example of logging messages - - using log4net.Util; - - ILog log = LogManager.GetLogger("application-log"); - - log.InfoExt("Application Start"); - log.DebugExt("This is a debug message"); - - - - - - The fully qualified type of the Logger class. - - + - Log a message object with the level. + Clear all the context properties - The logger on which the message is logged. - The lambda expression that gets the object to log. - This method first checks if this logger is INFO - enabled by reading the value property. - This check happens always and does not depend on the - implementation. If this logger is INFO enabled, then it converts - the message object (retrieved by invocation of the provided callback) to a - string by invoking the appropriate . - It then proceeds to call all the registered appenders in this logger - and also higher in the hierarchy depending on the value of - the additivity flag. - - WARNING Note that passing an - to this method will print the name of the - but no stack trace. To print a stack trace use the - form instead. + Clear all the context properties - - - + - Log a message object with the level including - the stack trace of the passed - as a parameter. + Get the PropertiesDictionary stored in the LocalDataStoreSlot for this thread. - The logger on which the message is logged. - The lambda expression that gets the object to log. - The exception to log, including its stack trace. + create the dictionary if it does not exist, otherwise return null if is does not exist + the properties for this thread - See the form for more detailed information. + The collection returned is only to be used on the calling thread. If the + caller needs to share the collection between different threads then the + caller must clone the collection before doings so. - - - - Log a message object with the level. //TODO + - Log a message object with the level. + Gets the call context get data. - The logger on which the message is logged. - The message object to log. + The peroperties dictionary stored in the call context - - This method first checks if this logger is INFO - enabled by reading the value property. - This check happens always and does not depend on the - implementation. If this logger is INFO enabled, then it converts - the message object (passed as parameter) to a string by invoking the appropriate - . It then - proceeds to call all the registered appenders in this logger - and also higher in the hierarchy depending on the value of - the additivity flag. - - WARNING Note that passing an - to this method will print the name of the - but no stack trace. To print a stack trace use the - form instead. - + The method has a + security link demand, therfore we must put the method call in a seperate method + that we can wrap in an exception handler. - - - + - Log a message object with the level including - the stack trace of the passed - as a parameter. + Sets the call context data. - The logger on which the message is logged. - The message object to log. - The exception to log, including its stack trace. + The properties. - - See the form for more detailed information. - + The method has a + security link demand, therfore we must put the method call in a seperate method + that we can wrap in an exception handler. - - - + - Logs a formatted message string with the level. + The fully qualified type of the LogicalThreadContextProperties class. - The logger on which the message is logged. - A String containing zero or more format items - An Object to format - - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - + Used by the internal logger to record the Type of the + log message. - - - + - Logs a formatted message string with the level. + Delegate type used for LogicalThreadContextStack's callbacks. - The logger on which the message is logged. - A String containing zero or more format items - An Object array containing zero or more objects to format - - - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - - - + - Logs a formatted message string with the level. + Implementation of Stack for the - An that supplies culture-specific formatting information - The logger on which the message is logged. - A String containing zero or more format items - An Object array containing zero or more objects to format - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. + Implementation of Stack for the - - + Nicko Cadell - + - Logs a formatted message string with the level. + The stack store. + + + + + The name of this within the + . + + + + + The callback used to let the register a + new instance of a . - The logger on which the message is logged. - A String containing zero or more format items - An Object to format - An Object to format - - - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - - - + - Logs a formatted message string with the level. + Internal constructor - The logger on which the message is logged. - A String containing zero or more format items - An Object to format - An Object to format - An Object to format - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. + Initializes a new instance of the class. - - - + - Log a message object with the level. + The number of messages in the stack - The logger on which the message is logged. - The lambda expression that gets the object to log. + + The current number of messages in the stack + - This method first checks if this logger is INFO - enabled by reading the value property. - This check happens always and does not depend on the - implementation. If this logger is INFO enabled, then it converts - the message object (retrieved by invocation of the provided callback) to a - string by invoking the appropriate . - It then proceeds to call all the registered appenders in this logger - and also higher in the hierarchy depending on the value of - the additivity flag. - - WARNING Note that passing an - to this method will print the name of the - but no stack trace. To print a stack trace use the - form instead. + The current number of messages in the stack. That is + the number of times has been called + minus the number of times has been called. - - - + - Log a message object with the level including - the stack trace of the passed - as a parameter. + Clears all the contextual information held in this stack. - The logger on which the message is logged. - The lambda expression that gets the object to log. - The exception to log, including its stack trace. - See the form for more detailed information. + Clears all the contextual information held in this stack. + Only call this if you think that this thread is being reused after + a previous call execution which may not have completed correctly. + You do not need to use this method if you always guarantee to call + the method of the + returned from even in exceptional circumstances, + for example by using the using(log4net.LogicalThreadContext.Stacks["NDC"].Push("Stack_Message")) + syntax. - - - - Log a message object with the level. //TODO + - Log a message object with the level. + Removes the top context from this stack. - The logger on which the message is logged. - The message object to log. + The message in the context that was removed from the top of this stack. - This method first checks if this logger is INFO - enabled by reading the value property. - This check happens always and does not depend on the - implementation. If this logger is INFO enabled, then it converts - the message object (passed as parameter) to a string by invoking the appropriate - . It then - proceeds to call all the registered appenders in this logger - and also higher in the hierarchy depending on the value of - the additivity flag. - - WARNING Note that passing an - to this method will print the name of the - but no stack trace. To print a stack trace use the - form instead. + Remove the top context from this stack, and return + it to the caller. If this stack is empty then an + empty string (not ) is returned. - - - + - Log a message object with the level including - the stack trace of the passed - as a parameter. + Pushes a new context message into this stack. - The logger on which the message is logged. - The message object to log. - The exception to log, including its stack trace. + The new context message. + + An that can be used to clean up the context stack. + - See the form for more detailed information. + Pushes a new context onto this stack. An + is returned that can be used to clean up this stack. This + can be easily combined with the using keyword to scope the + context. - - + Simple example of using the Push method with the using keyword. + + using(log4net.LogicalThreadContext.Stacks["NDC"].Push("Stack_Message")) + { + log.Warn("This should have an ThreadContext Stack message"); + } + + - + - Logs a formatted message string with the level. + Returns the top context from this stack. - The logger on which the message is logged. - A String containing zero or more format items - An Object to format + The message in the context from the top of this stack. - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. + Returns the top context from this stack. If this stack is empty then an + empty string (not ) is returned. - - - + - Logs a formatted message string with the level. + Gets the current context information for this stack. - The logger on which the message is logged. - A String containing zero or more format items - An Object array containing zero or more objects to format + The current context information. + + + + Gets and sets the internal stack used by this + + The internal storage stack - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. + This property is provided only to support backward compatability + of the . Tytpically the internal stack should not + be modified. - - - + - Logs a formatted message string with the level. + Gets the current context information for this stack. - An that supplies culture-specific formatting information - The logger on which the message is logged. - A String containing zero or more format items - An Object array containing zero or more objects to format + Gets the current context information - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. + Gets the current context information for this stack. - - - + - Logs a formatted message string with the level. + Get a portable version of this object - The logger on which the message is logged. - A String containing zero or more format items - An Object to format - An Object to format + the portable instance of this object - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. + Get a cross thread portable version of this object - - - + - Logs a formatted message string with the level. + Inner class used to represent a single context frame in the stack. - The logger on which the message is logged. - A String containing zero or more format items - An Object to format - An Object to format - An Object to format - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. + Inner class used to represent a single context frame in the stack. - - - + - Log a message object with the level. + Constructor - The logger on which the message is logged. - The lambda expression that gets the object to log. + The message for this context. + The parent context in the chain. - This method first checks if this logger is WARN - enabled by reading the value property. - This check happens always and does not depend on the - implementation. If this logger is WARN enabled, then it converts - the message object (retrieved by invocation of the provided callback) to a - string by invoking the appropriate . - It then proceeds to call all the registered appenders in this logger - and also higher in the hierarchy depending on the value of - the additivity flag. - - WARNING Note that passing an - to this method will print the name of the - but no stack trace. To print a stack trace use the - form instead. + Initializes a new instance of the class + with the specified message and parent context. - - - + - Log a message object with the level including - the stack trace of the passed - as a parameter. + Get the message. - The logger on which the message is logged. - The lambda expression that gets the object to log. - The exception to log, including its stack trace. + The message. - See the form for more detailed information. + Get the message. - - - - Log a message object with the level. //TODO + - Log a message object with the level. + Gets the full text of the context down to the root level. - The logger on which the message is logged. - The message object to log. + + The full text of the context down to the root level. + - This method first checks if this logger is WARN - enabled by reading the value property. - This check happens always and does not depend on the - implementation. If this logger is WARN enabled, then it converts - the message object (passed as parameter) to a string by invoking the appropriate - . It then - proceeds to call all the registered appenders in this logger - and also higher in the hierarchy depending on the value of - the additivity flag. - - WARNING Note that passing an - to this method will print the name of the - but no stack trace. To print a stack trace use the - form instead. + Gets the full text of the context down to the root level. - - - + - Log a message object with the level including - the stack trace of the passed - as a parameter. + Struct returned from the method. - The logger on which the message is logged. - The message object to log. - The exception to log, including its stack trace. - See the form for more detailed information. + This struct implements the and is designed to be used + with the pattern to remove the stack frame at the end of the scope. - - - + - Logs a formatted message string with the level. + The depth to trim the stack to when this instance is disposed - The logger on which the message is logged. - A String containing zero or more format items - An Object to format + + + + The outer LogicalThreadContextStack. + + + + + Constructor + + The internal stack used by the ThreadContextStack. + The depth to return the stack to when this object is disposed. - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. + Initializes a new instance of the class with + the specified stack and return depth. - - - + - Logs a formatted message string with the level. + Returns the stack to the correct depth. - The logger on which the message is logged. - A String containing zero or more format items - An Object array containing zero or more objects to format - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. + Returns the stack to the correct depth. - - - + - Logs a formatted message string with the level. + Implementation of Stacks collection for the - An that supplies culture-specific formatting information - The logger on which the message is logged. - A String containing zero or more format items - An Object array containing zero or more objects to format - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. + Implementation of Stacks collection for the - - + Nicko Cadell - + - Logs a formatted message string with the level. + Internal constructor - The logger on which the message is logged. - A String containing zero or more format items - An Object to format - An Object to format - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. + Initializes a new instance of the class. + + + + + Gets the named thread context stack + + + The named stack + + - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. + Gets the named thread context stack - - - + - Logs a formatted message string with the level. + The fully qualified type of the ThreadContextStacks class. + + + Used by the internal logger to record the Type of the + log message. + + + + + + + + + + + + Outputs log statements from within the log4net assembly. - The logger on which the message is logged. - A String containing zero or more format items - An Object to format - An Object to format - An Object to format - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. + Log4net components cannot make log4net logging calls. However, it is + sometimes useful for the user to learn about what log4net is + doing. - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. + All log4net internal debug calls go to the standard output stream + whereas internal error messages are sent to the standard error output + stream. - - + Nicko Cadell + Gert Driesen - + - Log a message object with the level. + The event raised when an internal message has been received. + + + + + The Type that generated the internal message. + + + + + The DateTime stamp of when the internal message was received. + + + + + The UTC DateTime stamp of when the internal message was received. + + + + + A string indicating the severity of the internal message. - The logger on which the message is logged. - The lambda expression that gets the object to log. - - This method first checks if this logger is ERROR - enabled by reading the value property. - This check happens always and does not depend on the - implementation. If this logger is ERROR enabled, then it converts - the message object (retrieved by invocation of the provided callback) to a - string by invoking the appropriate . - It then proceeds to call all the registered appenders in this logger - and also higher in the hierarchy depending on the value of - the additivity flag. - - WARNING Note that passing an - to this method will print the name of the - but no stack trace. To print a stack trace use the - form instead. - + "log4net: ", + "log4net:ERROR ", + "log4net:WARN " - - - + + + The internal log message. + + + + + The Exception related to the message. + + + Optional. Will be null if no Exception was passed. + + + + + Formats Prefix, Source, and Message in the same format as the value + sent to Console.Out and Trace.Write. + + + + + + Initializes a new instance of the class. + + + + + + + - Log a message object with the level including - the stack trace of the passed - as a parameter. + Static constructor that initializes logging by reading + settings from the application configuration file. - The logger on which the message is logged. - The lambda expression that gets the object to log. - The exception to log, including its stack trace. - See the form for more detailed information. + The log4net.Internal.Debug application setting + controls internal debugging. This setting should be set + to true to enable debugging. + + + The log4net.Internal.Quiet application setting + suppresses all internal logging including error messages. + This setting should be set to true to enable message + suppression. - - - - Log a message object with the level. //TODO + - Log a message object with the level. + Gets or sets a value indicating whether log4net internal logging + is enabled or disabled. - The logger on which the message is logged. - The message object to log. + + true if log4net internal logging is enabled, otherwise + false. + - This method first checks if this logger is ERROR - enabled by reading the value property. - This check happens always and does not depend on the - implementation. If this logger is ERROR enabled, then it converts - the message object (passed as parameter) to a string by invoking the appropriate - . It then - proceeds to call all the registered appenders in this logger - and also higher in the hierarchy depending on the value of - the additivity flag. + When set to true, internal debug level logging will be + displayed. - WARNING Note that passing an - to this method will print the name of the - but no stack trace. To print a stack trace use the - form instead. + + This value can be set by setting the application setting + log4net.Internal.Debug in the application configuration + file. + + + The default value is false, i.e. debugging is + disabled. - - + + + The following example enables internal debugging using the + application configuration file : + + + + + + + + + - + - Log a message object with the level including - the stack trace of the passed - as a parameter. + Gets or sets a value indicating whether log4net should generate no output + from internal logging, not even for errors. - The logger on which the message is logged. - The message object to log. - The exception to log, including its stack trace. + + true if log4net should generate no output at all from internal + logging, otherwise false. + - See the form for more detailed information. + When set to true will cause internal logging at all levels to be + suppressed. This means that no warning or error reports will be logged. + This option overrides the setting and + disables all debug also. + + This value can be set by setting the application setting + log4net.Internal.Quiet in the application configuration file. + + + The default value is false, i.e. internal logging is not + disabled. - - + + The following example disables internal logging using the + application configuration file : + + + + + + + + - + - Logs a formatted message string with the level. + - The logger on which the message is logged. - A String containing zero or more format items - An Object to format + + + + Raises the LogReceived event when an internal messages is received. + + + + + + + + + Test if LogLog.Debug is enabled for output. + + + true if Debug is enabled + - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. + Test if LogLog.Debug is enabled for output. - - - + - Logs a formatted message string with the level. + Writes log4net internal debug messages to the + standard output stream. - The logger on which the message is logged. - A String containing zero or more format items - An Object array containing zero or more objects to format + + The message to log. - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. + All internal debug messages are prepended with + the string "log4net: ". - - - + - Logs a formatted message string with the level. + Writes log4net internal debug messages to the + standard output stream. - An that supplies culture-specific formatting information - The logger on which the message is logged. - A String containing zero or more format items - An Object array containing zero or more objects to format + The Type that generated this message. + The message to log. + An exception to log. - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. + All internal debug messages are prepended with + the string "log4net: ". - - - + - Logs a formatted message string with the level. + Test if LogLog.Warn is enabled for output. - The logger on which the message is logged. - A String containing zero or more format items - An Object to format - An Object to format + + true if Warn is enabled + - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. + Test if LogLog.Warn is enabled for output. - - - + - Logs a formatted message string with the level. + Writes log4net internal warning messages to the + standard error stream. - The logger on which the message is logged. - A String containing zero or more format items - An Object to format - An Object to format - An Object to format + The Type that generated this message. + The message to log. - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. + All internal warning messages are prepended with + the string "log4net:WARN ". - - - + - Log a message object with the level. + Writes log4net internal warning messages to the + standard error stream. - The logger on which the message is logged. - The lambda expression that gets the object to log. + The Type that generated this message. + The message to log. + An exception to log. - This method first checks if this logger is FATAL - enabled by reading the value property. - This check happens always and does not depend on the - implementation. If this logger is FATAL enabled, then it converts - the message object (retrieved by invocation of the provided callback) to a - string by invoking the appropriate . - It then proceeds to call all the registered appenders in this logger - and also higher in the hierarchy depending on the value of - the additivity flag. - - WARNING Note that passing an - to this method will print the name of the - but no stack trace. To print a stack trace use the - form instead. + All internal warning messages are prepended with + the string "log4net:WARN ". - - - + - Log a message object with the level including - the stack trace of the passed - as a parameter. + Test if LogLog.Error is enabled for output. - The logger on which the message is logged. - The lambda expression that gets the object to log. - The exception to log, including its stack trace. + + true if Error is enabled + - See the form for more detailed information. + Test if LogLog.Error is enabled for output. - - - - Log a message object with the level. //TODO + - Log a message object with the level. + Writes log4net internal error messages to the + standard error stream. - The logger on which the message is logged. - The message object to log. + The Type that generated this message. + The message to log. - This method first checks if this logger is FATAL - enabled by reading the value property. - This check happens always and does not depend on the - implementation. If this logger is FATAL enabled, then it converts - the message object (passed as parameter) to a string by invoking the appropriate - . It then - proceeds to call all the registered appenders in this logger - and also higher in the hierarchy depending on the value of - the additivity flag. - - WARNING Note that passing an - to this method will print the name of the - but no stack trace. To print a stack trace use the - form instead. + All internal error messages are prepended with + the string "log4net:ERROR ". - - - + - Log a message object with the level including - the stack trace of the passed - as a parameter. + Writes log4net internal error messages to the + standard error stream. - The logger on which the message is logged. - The message object to log. - The exception to log, including its stack trace. + The Type that generated this message. + The message to log. + An exception to log. - See the form for more detailed information. + All internal debug messages are prepended with + the string "log4net:ERROR ". - - - + - Logs a formatted message string with the level. + Writes output to the standard output stream. - The logger on which the message is logged. - A String containing zero or more format items - An Object to format + The message to log. - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. + Writes to both Console.Out and System.Diagnostics.Trace. + Note that the System.Diagnostics.Trace is not supported + on the Compact Framework. - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. + If the AppDomain is not configured with a config file then + the call to System.Diagnostics.Trace may fail. This is only + an issue if you are programmatically creating your own AppDomains. - - - + - Logs a formatted message string with the level. + Writes output to the standard error stream. - The logger on which the message is logged. - A String containing zero or more format items - An Object array containing zero or more objects to format + The message to log. - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. + Writes to both Console.Error and System.Diagnostics.Trace. + Note that the System.Diagnostics.Trace is not supported + on the Compact Framework. - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. + If the AppDomain is not configured with a config file then + the call to System.Diagnostics.Trace may fail. This is only + an issue if you are programmatically creating your own AppDomains. - - - + - Logs a formatted message string with the level. + Default debug level + + + + + In quietMode not even errors generate any output. + + + + + Subscribes to the LogLog.LogReceived event and stores messages + to the supplied IList instance. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Represents a native error code and message. - An that supplies culture-specific formatting information - The logger on which the message is logged. - A String containing zero or more format items - An Object array containing zero or more objects to format - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. + Represents a Win32 platform native error. - - + Nicko Cadell + Gert Driesen - + - Logs a formatted message string with the level. + Create an instance of the class with the specified + error number and message. - The logger on which the message is logged. - A String containing zero or more format items - An Object to format - An Object to format + The number of the native error. + The message of the native error. - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. + Create an instance of the class with the specified + error number and message. - - - + - Logs a formatted message string with the level. + Gets the number of the native error. - The logger on which the message is logged. - A String containing zero or more format items - An Object to format - An Object to format - An Object to format + + The number of the native error. + - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. + Gets the number of the native error. - - - + - Manages a mapping from levels to + Gets the message of the native error. + + The message of the native error. + - Manages an ordered mapping from instances - to subclasses. + Gets the message of the native error. - Nicko Cadell - + - Default constructor + Create a new instance of the class for the last Windows error. + + An instance of the class for the last windows error. + - Initialise a new instance of . + The message for the error number is lookup up using the + native Win32 FormatMessage function. - + - Add a to this mapping + Create a new instance of the class. - the entry to add + the error number for the native error + + An instance of the class for the specified + error number. + - If a has previously been added - for the same then that entry will be - overwritten. + The message for the specified error number is lookup up using the + native Win32 FormatMessage function. - + - Lookup the mapping for the specified level + Retrieves the message corresponding with a Win32 message identifier. - the level to lookup - the for the level or null if no mapping found + Message identifier for the requested message. + + The message corresponding with the specified message identifier. + - Lookup the value for the specified level. Finds the nearest - mapping value for the level that is equal to or less than the - specified. - - - If no mapping could be found then null is returned. + The message will be searched for in system message-table resource(s) + using the native FormatMessage function. - + - Initialize options + Return error information string + error information string - Caches the sorted list of in an array + Return error information string - + - Implementation of Properties collection for the + Formats a message string. + Formatting options, and how to interpret the parameter. + Location of the message definition. + Message identifier for the requested message. + Language identifier for the requested message. + If includes FORMAT_MESSAGE_ALLOCATE_BUFFER, the function allocates a buffer using the LocalAlloc function, and places the pointer to the buffer at the address specified in . + If the FORMAT_MESSAGE_ALLOCATE_BUFFER flag is not set, this parameter specifies the maximum number of TCHARs that can be stored in the output buffer. If FORMAT_MESSAGE_ALLOCATE_BUFFER is set, this parameter specifies the minimum number of TCHARs to allocate for an output buffer. + Pointer to an array of values that are used as insert values in the formatted message. - Class implements a collection of properties that is specific to each thread. - The class is not synchronized as each thread has its own . + The function requires a message definition as input. The message definition can come from a + buffer passed into the function. It can come from a message table resource in an + already-loaded module. Or the caller can ask the function to search the system's message + table resource(s) for the message definition. The function finds the message definition + in a message table resource based on a message identifier and a language identifier. + The function copies the formatted message text to an output buffer, processing any embedded + insert sequences if requested. - This class stores its properties in a slot on the named - log4net.Util.LogicalThreadContextProperties. + To prevent the usage of unsafe code, this stub does not support inserting values in the formatted message. + + - For .NET Standard 1.3 this class uses - System.Threading.AsyncLocal rather than . + If the function succeeds, the return value is the number of TCHARs stored in the output + buffer, excluding the terminating null character. - The requires a link time - for the - . - If the calling code does not have this permission then this context will be disabled. - It will not store any property values set on it. + If the function fails, the return value is zero. To get extended error information, + call . - - Nicko Cadell - - - - Flag used to disable this context if we don't have permission to access the CallContext. - + - + - Constructor + An always empty . - Initializes a new instance of the class. + A singleton implementation of the over a collection + that is empty and not modifiable. + Nicko Cadell + Gert Driesen - + - Remove a property + Initializes a new instance of the class. - the key for the entry to remove - Remove the value for the specified from the context. + Uses a private access modifier to enforce the singleton pattern. - + - Clear all the context properties + Gets the singleton instance of the . + The singleton instance of the . - Clear all the context properties + Gets the singleton instance of the . - + - Get the PropertiesDictionary stored in the LocalDataStoreSlot for this thread. + Gets the current object from the enumerator. - create the dictionary if it does not exist, otherwise return null if is does not exist - the properties for this thread + + Throws an because the + never has a current value. + - The collection returned is only to be used on the calling thread. If the - caller needs to share the collection between different threads then the - caller must clone the collection before doings so. + As the enumerator is over an empty collection its + value cannot be moved over a valid position, therefore + will throw an . + The collection is empty and + cannot be positioned over a valid location. - + - Gets the call context get data. + Test if the enumerator can advance, if so advance. - The peroperties dictionary stored in the call context + false as the cannot advance. - The method has a - security link demand, therfore we must put the method call in a seperate method - that we can wrap in an exception handler. + + As the enumerator is over an empty collection its + value cannot be moved over a valid position, therefore + will always return false. + - + - Sets the call context data. + Resets the enumerator back to the start. - The properties. - The method has a - security link demand, therfore we must put the method call in a seperate method - that we can wrap in an exception handler. + + As the enumerator is over an empty collection does nothing. + - + - The fully qualified type of the LogicalThreadContextProperties class. + Gets the current key from the enumerator. - Used by the internal logger to record the Type of the - log message. + Throws an exception because the + never has a current value. - - - - Gets or sets the value of a property - - - The value for the property with the specified key - - Get or set the property value for the specified. + As the enumerator is over an empty collection its + value cannot be moved over a valid position, therefore + will throw an . + The collection is empty and + cannot be positioned over a valid location. - - - Delegate type used for LogicalThreadContextStack's callbacks. - - - + - Implementation of Stack for the + Gets the current value from the enumerator. + The current value from the enumerator. + + Throws an because the + never has a current value. + - Implementation of Stack for the + As the enumerator is over an empty collection its + value cannot be moved over a valid position, therefore + will throw an . - Nicko Cadell - - - - The stack store. - + The collection is empty and + cannot be positioned over a valid location. - + - The name of this within the - . + Gets the current entry from the enumerator. + + Throws an because the + never has a current entry. + + + + As the enumerator is over an empty collection its + value cannot be moved over a valid position, therefore + will throw an . + + + The collection is empty and + cannot be positioned over a valid location. - + - The callback used to let the register a - new instance of a . + The singleton instance of the . - + - Internal constructor + An always empty . - Initializes a new instance of the class. + A singleton implementation of the over a collection + that is empty and not modifiable. + Nicko Cadell + Gert Driesen - + - Clears all the contextual information held in this stack. + Initializes a new instance of the class. - Clears all the contextual information held in this stack. - Only call this if you think that this thread is being reused after - a previous call execution which may not have completed correctly. - You do not need to use this method if you always guarantee to call - the method of the - returned from even in exceptional circumstances, - for example by using the using(log4net.LogicalThreadContext.Stacks["NDC"].Push("Stack_Message")) - syntax. + Uses a private access modifier to enforce the singleton pattern. - + - Removes the top context from this stack. + Get the singleton instance of the . - The message in the context that was removed from the top of this stack. + The singleton instance of the . - Remove the top context from this stack, and return - it to the caller. If this stack is empty then an - empty string (not ) is returned. + Gets the singleton instance of the . - + - Pushes a new context message into this stack. + Gets the current object from the enumerator. - The new context message. - - An that can be used to clean up the context stack. - + + Throws an because the + never has a current value. + - Pushes a new context onto this stack. An - is returned that can be used to clean up this stack. This - can be easily combined with the using keyword to scope the - context. + As the enumerator is over an empty collection its + value cannot be moved over a valid position, therefore + will throw an . - Simple example of using the Push method with the using keyword. - - using(log4net.LogicalThreadContext.Stacks["NDC"].Push("Stack_Message")) - { - log.Warn("This should have an ThreadContext Stack message"); - } - - - - - - Gets the current context information for this stack. - - The current context information. + The collection is empty and + cannot be positioned over a valid location. - + - Gets the current context information for this stack. + Test if the enumerator can advance, if so advance - Gets the current context information + false as the cannot advance. - Gets the current context information for this stack. + As the enumerator is over an empty collection its + value cannot be moved over a valid position, therefore + will always return false. - + - Get a portable version of this object + Resets the enumerator back to the start. - the portable instance of this object - Get a cross thread portable version of this object + As the enumerator is over an empty collection does nothing. - + - The number of messages in the stack + The singleton instance of the . + + + + + A SecurityContext used when a SecurityContext is not required - - The current number of messages in the stack - - The current number of messages in the stack. That is - the number of times has been called - minus the number of times has been called. + The is a no-op implementation of the + base class. It is used where a + is required but one has not been provided. + Nicko Cadell - + - Gets and sets the internal stack used by this + Singleton instance of - The internal storage stack - This property is provided only to support backward compatability - of the . Tytpically the internal stack should not - be modified. + Singleton instance of - + - Inner class used to represent a single context frame in the stack. + Private constructor - Inner class used to represent a single context frame in the stack. + Private constructor for singleton pattern. - + - Constructor + Impersonate this SecurityContext - The message for this context. - The parent context in the chain. + State supplied by the caller + null - Initializes a new instance of the class - with the specified message and parent context. + No impersonation is done and null is always returned. - + - Get the message. + Implements log4net's default error handling policy which consists + of emitting a message for the first error in an appender and + ignoring all subsequent errors. - The message. - Get the message. + The error message is processed using the LogLog sub-system by default. + + + This policy aims at protecting an otherwise working application + from being flooded with error messages when logging fails. + Nicko Cadell + Gert Driesen + Ron Grabowski - + - Gets the full text of the context down to the root level. + Default Constructor - - The full text of the context down to the root level. - - Gets the full text of the context down to the root level. + Initializes a new instance of the class. - + - Struct returned from the method. + Constructor + The prefix to use for each message. - This struct implements the and is designed to be used - with the pattern to remove the stack frame at the end of the scope. + Initializes a new instance of the class + with the specified prefix. - + - The depth to trim the stack to when this instance is disposed + Reset the error handler back to its initial disabled state. - + - The outer LogicalThreadContextStack. + Log an Error + The error message. + The exception. + The internal error code. + + + Invokes if and only if this is the first error or the first error after has been called. + + - + - Constructor + Log the very first error - The internal stack used by the ThreadContextStack. - The depth to return the stack to when this object is disposed. + The error message. + The exception. + The internal error code. - Initializes a new instance of the class with - the specified stack and return depth. + Sends the error information to 's Error method. - + - Returns the stack to the correct depth. + Log an Error + The error message. + The exception. - Returns the stack to the correct depth. + Invokes if and only if this is the first error or the first error after has been called. - + - Implementation of Stacks collection for the + Log an error + The error message. - Implementation of Stacks collection for the + Invokes if and only if this is the first error or the first error after has been called. - Nicko Cadell - + - Internal constructor + Is error logging enabled - Initializes a new instance of the class. + Is error logging enabled. Logging is only enabled for the + first error delivered to the . - + - The fully qualified type of the ThreadContextStacks class. + The date the first error that trigged this error handler occurred, or if it has not been triggered. + + + + + The UTC date the first error that trigged this error handler occured, or if it has not been triggered. + + + + + The message from the first error that trigged this error handler. + + + + + The exception from the first error that trigged this error handler. - Used by the internal logger to record the Type of the - log message. + May be . - + - Gets the named thread context stack + The error code from the first error that trigged this error handler. - - The named stack - - - Gets the named thread context stack - + Defaults to - + - + The UTC date the error was recorded. - - - + - Outputs log statements from within the log4net assembly. + Flag to indicate if it is the first error - - - Log4net components cannot make log4net logging calls. However, it is - sometimes useful for the user to learn about what log4net is - doing. - - - All log4net internal debug calls go to the standard output stream - whereas internal error messages are sent to the standard error output - stream. - - - Nicko Cadell - Gert Driesen - + - Formats Prefix, Source, and Message in the same format as the value - sent to Console.Out and Trace.Write. + The message recorded during the first error. - - + - Initializes a new instance of the class. + The exception recorded during the first error. - - - - - + - Static constructor that initializes logging by reading - settings from the application configuration file. + The error code recorded during the first error. + + + + + String to prefix each message with + + + + + The fully qualified type of the OnlyOnceErrorHandler class. - - The log4net.Internal.Debug application setting - controls internal debugging. This setting should be set - to true to enable debugging. - - - The log4net.Internal.Quiet application setting - suppresses all internal logging including error messages. - This setting should be set to true to enable message - suppression. - + Used by the internal logger to record the Type of the + log message. - + - Raises the LogReceived event when an internal messages is received. + A convenience class to convert property values to specific types. - - - - + + + Utility functions for converting types and parsing values. + + + Nicko Cadell + Gert Driesen - + - Writes log4net internal debug messages to the - standard output stream. + Initializes a new instance of the class. - - The message to log. - All internal debug messages are prepended with - the string "log4net: ". + Uses a private access modifier to prevent instantiation of this class. - + - Writes log4net internal debug messages to the - standard output stream. + Converts a string to a value. - The Type that generated this message. - The message to log. - An exception to log. + String to convert. + The default value. + The value of . - All internal debug messages are prepended with - the string "log4net: ". + If is "true", then true is returned. + If is "false", then false is returned. + Otherwise, is returned. - + - Writes log4net internal warning messages to the - standard error stream. + Parses a file size into a number. - The Type that generated this message. - The message to log. + String to parse. + The default value. + The value of . - All internal warning messages are prepended with - the string "log4net:WARN ". + Parses a file size of the form: number[KB|MB|GB] into a + long value. It is scaled with the appropriate multiplier. + + + is returned when + cannot be converted to a value. - + - Writes log4net internal warning messages to the - standard error stream. + Converts a string to an object. - The Type that generated this message. - The message to log. - An exception to log. + The target type to convert to. + The string to convert to an object. + + The object converted from a string or null when the + conversion failed. + - All internal warning messages are prepended with - the string "log4net:WARN ". + Converts a string to an object. Uses the converter registry to try + to convert the string value into the specified target type. - + - Writes log4net internal error messages to the - standard error stream. + Checks if there is an appropriate type conversion from the source type to the target type. - The Type that generated this message. - The message to log. + The type to convert from. + The type to convert to. + true if there is a conversion from the source type to the target type. + Checks if there is an appropriate type conversion from the source type to the target type. - All internal error messages are prepended with - the string "log4net:ERROR ". - + - Writes log4net internal error messages to the - standard error stream. + Converts an object to the target type. - The Type that generated this message. - The message to log. - An exception to log. + The object to convert to the target type. + The type to convert to. + The converted object. - All internal debug messages are prepended with - the string "log4net:ERROR ". + Converts an object to the target type. - + - Writes output to the standard output stream. + Instantiates an object given a class name. - The message to log. + The fully qualified class name of the object to instantiate. + The class to which the new object should belong. + The object to return in case of non-fulfillment. + + An instance of the or + if the object could not be instantiated. + - Writes to both Console.Out and System.Diagnostics.Trace. - Note that the System.Diagnostics.Trace is not supported - on the Compact Framework. - - - If the AppDomain is not configured with a config file then - the call to System.Diagnostics.Trace may fail. This is only - an issue if you are programmatically creating your own AppDomains. + Checks that the is a subclass of + . If that test fails or the object could + not be instantiated, then is returned. - + - Writes output to the standard error stream. + Performs variable substitution in string from the + values of keys found in . - The message to log. + The string on which variable substitution is performed. + The dictionary to use to lookup variables. + The result of the substitutions. - Writes to both Console.Error and System.Diagnostics.Trace. - Note that the System.Diagnostics.Trace is not supported - on the Compact Framework. + The variable substitution delimiters are ${ and }. - If the AppDomain is not configured with a config file then - the call to System.Diagnostics.Trace may fail. This is only - an issue if you are programmatically creating your own AppDomains. + For example, if props contains key=value, then the call + + + + string s = OptionConverter.SubstituteVariables("Value of key is ${key}."); + + + + will set the variable s to "Value of key is value.". + + + If no value could be found for the specified key, then substitution + defaults to an empty string. + + + For example, if system properties contains no value for the key + "nonExistentKey", then the call + + + + string s = OptionConverter.SubstituteVariables("Value of nonExistentKey is [${nonExistentKey}]"); + + + + will set s to "Value of nonExistentKey is []". + + + An Exception is thrown if contains a start + delimiter "${" which is not balanced by a stop delimiter "}". - - - Default debug level - - - - - In quietMode not even errors generate any output. - - - - - The event raised when an internal message has been received. - - - - - The Type that generated the internal message. - - - - - The DateTime stamp of when the internal message was received. - - - + - The UTC DateTime stamp of when the internal message was received. + Converts the string representation of the name or numeric value of one or + more enumerated constants to an equivalent enumerated object. + The type to convert to. + The enum string value. + If true, ignore case; otherwise, regard case. + An object of type whose value is represented by . - + - A string indicating the severity of the internal message. + The fully qualified type of the OptionConverter class. - "log4net: ", - "log4net:ERROR ", - "log4net:WARN " + Used by the internal logger to record the Type of the + log message. - + - The internal log message. + Abstract class that provides the formatting functionality that + derived classes need. + + + Conversion specifiers in a conversion patterns are parsed to + individual PatternConverters. Each of which is responsible for + converting a logging event in a converter specific manner. + + + Nicko Cadell + Gert Driesen - + - The Exception related to the message. + Protected constructor - Optional. Will be null if no Exception was passed. + + Initializes a new instance of the class. + - + - Gets or sets a value indicating whether log4net internal logging - is enabled or disabled. + Get the next pattern converter in the chain - true if log4net internal logging is enabled, otherwise - false. + the next pattern converter in the chain - When set to true, internal debug level logging will be - displayed. - - - This value can be set by setting the application setting - log4net.Internal.Debug in the application configuration - file. - - - The default value is false, i.e. debugging is - disabled. + Get the next pattern converter in the chain - - - The following example enables internal debugging using the - application configuration file : - - - - - - - - - - + - Gets or sets a value indicating whether log4net should generate no output - from internal logging, not even for errors. + Gets or sets the formatting info for this converter - true if log4net should generate no output at all from internal - logging, otherwise false. + The formatting info for this converter - When set to true will cause internal logging at all levels to be - suppressed. This means that no warning or error reports will be logged. - This option overrides the setting and - disables all debug also. - - This value can be set by setting the application setting - log4net.Internal.Quiet in the application configuration file. + Gets or sets the formatting info for this converter + + + + + Gets or sets the option value for this converter + + + The option for this converter + + - The default value is false, i.e. internal logging is not - disabled. + Gets or sets the option value for this converter - - The following example disables internal logging using the - application configuration file : - - - - - - - - - + - + Evaluate this pattern converter and write the output to a writer. + that will receive the formatted result. + The state object on which the pattern converter should be executed. + + + Derived pattern converters must override this method in order to + convert conversion specifiers in the appropriate way. + + - + - Test if LogLog.Debug is enabled for output. + Set the next pattern converter in the chains - - true if Debug is enabled - + the pattern converter that should follow this converter in the chain + the next converter - Test if LogLog.Debug is enabled for output. + The PatternConverter can merge with its neighbor during this method (or a sub class). + Therefore the return value may or may not be the value of the argument passed in. - + - Test if LogLog.Warn is enabled for output. + Write the pattern converter to the writer with appropriate formatting - - true if Warn is enabled - + that will receive the formatted result. + The state object on which the pattern converter should be executed. - Test if LogLog.Warn is enabled for output. + This method calls to allow the subclass to perform + appropriate conversion of the pattern converter. If formatting options have + been specified via the then this method will + apply those formattings before writing the output. - + - Test if LogLog.Error is enabled for output. + Fast space padding method. - - true if Error is enabled - + to which the spaces will be appended. + The number of spaces to be padded. - Test if LogLog.Error is enabled for output. + Fast space padding method. - + - Subscribes to the LogLog.LogReceived event and stores messages - to the supplied IList instance. + The option string to the converter - + - + Initial buffer size - - + - + Maximum buffer size before it is recycled - + - + Write an dictionary to a + the writer to write to + a to use for object conversion + the value to write to the writer + + + Writes the to a writer in the form: + + + {key1=value1, key2=value2, key3=value3} + + + If the specified + is not null then it is used to render the key and value to text, otherwise + the object's ToString method is called. + + - + - + Write an dictionary to a + the writer to write to + a to use for object conversion + the value to write to the writer + + + Writes the to a writer in the form: + + + {key1=value1, key2=value2, key3=value3} + + + If the specified + is not null then it is used to render the key and value to text, otherwise + the object's ToString method is called. + + - + - + Write an object to a - + the writer to write to + a to use for object conversion + the value to write to the writer + + + Writes the Object to a writer. If the specified + is not null then it is used to render the object to text, otherwise + the object's ToString method is called. + + - + - + - Represents a native error code and message. + Most of the work of the class + is delegated to the PatternParser class. - Represents a Win32 platform native error. + The PatternParser processes a pattern string and + returns a chain of objects. Nicko Cadell Gert Driesen - + - Create an instance of the class with the specified - error number and message. + Constructor - The number of the native error. - The message of the native error. + The pattern to parse. - Create an instance of the class with the specified - error number and message. + Initializes a new instance of the class + with the specified pattern string. - + - Create a new instance of the class for the last Windows error. + Parses the pattern into a chain of pattern converters. - - An instance of the class for the last windows error. - + The head of a chain of pattern converters. - The message for the error number is lookup up using the - native Win32 FormatMessage function. + Parses the pattern into a chain of pattern converters. - + - Create a new instance of the class. + Get the converter registry used by this parser - the error number for the native error - - An instance of the class for the specified - error number. - + + The converter registry used by this parser + - The message for the specified error number is lookup up using the - native Win32 FormatMessage function. + Get the converter registry used by this parser - + - Retrieves the message corresponding with a Win32 message identifier. + Build the unified cache of converters from the static and instance maps - Message identifier for the requested message. - - The message corresponding with the specified message identifier. - + the list of all the converter names - The message will be searched for in system message-table resource(s) - using the native FormatMessage function. + Build the unified cache of converters from the static and instance maps - + - Return error information string + Sort strings by length - error information string - Return error information string + that orders strings by string length. + The longest strings are placed first - + - Formats a message string. + Internal method to parse the specified pattern to find specified matches - Formatting options, and how to interpret the parameter. - Location of the message definition. - Message identifier for the requested message. - Language identifier for the requested message. - If includes FORMAT_MESSAGE_ALLOCATE_BUFFER, the function allocates a buffer using the LocalAlloc function, and places the pointer to the buffer at the address specified in . - If the FORMAT_MESSAGE_ALLOCATE_BUFFER flag is not set, this parameter specifies the maximum number of TCHARs that can be stored in the output buffer. If FORMAT_MESSAGE_ALLOCATE_BUFFER is set, this parameter specifies the minimum number of TCHARs to allocate for an output buffer. - Pointer to an array of values that are used as insert values in the formatted message. + the pattern to parse + the converter names to match in the pattern - The function requires a message definition as input. The message definition can come from a - buffer passed into the function. It can come from a message table resource in an - already-loaded module. Or the caller can ask the function to search the system's message - table resource(s) for the message definition. The function finds the message definition - in a message table resource based on a message identifier and a language identifier. - The function copies the formatted message text to an output buffer, processing any embedded - insert sequences if requested. - - - To prevent the usage of unsafe code, this stub does not support inserting values in the formatted message. + The matches param must be sorted such that longer strings come before shorter ones. - - - If the function succeeds, the return value is the number of TCHARs stored in the output - buffer, excluding the terminating null character. - - - If the function fails, the return value is zero. To get extended error information, - call . - - - + - Gets the number of the native error. + Process a parsed literal - - The number of the native error. - - - - Gets the number of the native error. - - + the literal text - + - Gets the message of the native error. + Process a parsed converter pattern - - The message of the native error. - - - - - Gets the message of the native error. - + the name of the converter + the optional option for the converter + the formatting info for the converter - + + + Resets the internal state of the parser and adds the specified pattern converter + to the chain. + + The pattern converter to add. + + + + The first pattern converter in the chain + + + + + the last pattern converter in the chain + + + + + The pattern + + + - An always empty . + Internal map of converter identifiers to converter types - A singleton implementation of the over a collection - that is empty and not modifiable. + This map overrides the static s_globalRulesRegistry map. - Nicko Cadell - Gert Driesen - + - Initializes a new instance of the class. + The fully qualified type of the PatternParser class. - - Uses a private access modifier to enforce the singleton pattern. - + Used by the internal logger to record the Type of the + log message. - + - Test if the enumerator can advance, if so advance. + This class implements a patterned string. - false as the cannot advance. - As the enumerator is over an empty collection its - value cannot be moved over a valid position, therefore - will always return false. + This string has embedded patterns that are resolved and expanded + when the string is formatted. + + + This class functions similarly to the + in that it accepts a pattern and renders it to a string. Unlike the + however the PatternString + does not render the properties of a specific but + of the process in general. + + + The recognized conversion pattern names are: + + + + Conversion Pattern Name + Effect + + + appdomain + + + Used to output the friendly name of the current AppDomain. + + + + + appsetting + + + Used to output the value of a specific appSetting key in the application + configuration file. + + + + + date + + + Used to output the current date and time in the local time zone. + To output the date in universal time use the %utcdate pattern. + The date conversion + specifier may be followed by a date format specifier enclosed + between braces. For example, %date{HH:mm:ss,fff} or + %date{dd MMM yyyy HH:mm:ss,fff}. If no date format specifier is + given then ISO8601 format is + assumed (). + + + The date format specifier admits the same syntax as the + time pattern string of the . + + + For better results it is recommended to use the log4net date + formatters. These can be specified using one of the strings + "ABSOLUTE", "DATE" and "ISO8601" for specifying + , + and respectively + . For example, + %date{ISO8601} or %date{ABSOLUTE}. + + + These dedicated date formatters perform significantly + better than . + + + + + env + + + Used to output the a specific environment variable. The key to + lookup must be specified within braces and directly following the + pattern specifier, e.g. %env{COMPUTERNAME} would include the value + of the COMPUTERNAME environment variable. + + + The env pattern is not supported on the .NET Compact Framework. + + + + + identity + + + Used to output the user name for the currently active user + (Principal.Identity.Name). + + + + + newline + + + Outputs the platform dependent line separator character or + characters. + + + This conversion pattern name offers the same performance as using + non-portable line separator strings such as "\n", or "\r\n". + Thus, it is the preferred way of specifying a line separator. + + + + + processid + + + Used to output the system process ID for the current process. + + + + + property + + + Used to output a specific context property. The key to + lookup must be specified within braces and directly following the + pattern specifier, e.g. %property{user} would include the value + from the property that is keyed by the string 'user'. Each property value + that is to be included in the log must be specified separately. + Properties are stored in logging contexts. By default + the log4net:HostName property is set to the name of machine on + which the event was originally logged. + + + If no key is specified, e.g. %property then all the keys and their + values are printed in a comma separated list. + + + The properties of an event are combined from a number of different + contexts. These are listed below in the order in which they are searched. + + + + the thread properties + + The that are set on the current + thread. These properties are shared by all events logged on this thread. + + + + the global properties + + The that are set globally. These + properties are shared by all the threads in the AppDomain. + + + + + + + random + + + Used to output a random string of characters. The string is made up of + uppercase letters and numbers. By default the string is 4 characters long. + The length of the string can be specified within braces directly following the + pattern specifier, e.g. %random{8} would output an 8 character string. + + + + + username + + + Used to output the WindowsIdentity for the currently + active user. + + + + + utcdate + + + Used to output the date of the logging event in universal time. + The date conversion + specifier may be followed by a date format specifier enclosed + between braces. For example, %utcdate{HH:mm:ss,fff} or + %utcdate{dd MMM yyyy HH:mm:ss,fff}. If no date format specifier is + given then ISO8601 format is + assumed (). + + + The date format specifier admits the same syntax as the + time pattern string of the . + + + For better results it is recommended to use the log4net date + formatters. These can be specified using one of the strings + "ABSOLUTE", "DATE" and "ISO8601" for specifying + , + and respectively + . For example, + %utcdate{ISO8601} or %utcdate{ABSOLUTE}. + + + These dedicated date formatters perform significantly + better than . + + + + + % + + + The sequence %% outputs a single percent sign. + + + + + + Additional pattern converters may be registered with a specific + instance using or + . + + + See the for details on the + format modifiers supported by the patterns. + Nicko Cadell - + - Resets the enumerator back to the start. + Internal map of converter identifiers to converter types. - - - As the enumerator is over an empty collection does nothing. - - - + - The singleton instance of the . + the pattern - + - Gets the singleton instance of the . + the head of the pattern converter chain - The singleton instance of the . - - - Gets the singleton instance of the . - - - + - Gets the current object from the enumerator. + patterns defined on this PatternString only - - Throws an because the - never has a current value. - - - - As the enumerator is over an empty collection its - value cannot be moved over a valid position, therefore - will throw an . - - - The collection is empty and - cannot be positioned over a valid location. - + - Gets the current key from the enumerator. + Initialize the global registry + + + + + Default constructor - - Throws an exception because the - never has a current value. - - As the enumerator is over an empty collection its - value cannot be moved over a valid position, therefore - will throw an . + Initialize a new instance of - The collection is empty and - cannot be positioned over a valid location. - + - Gets the current value from the enumerator. + Constructs a PatternString - The current value from the enumerator. - - Throws an because the - never has a current value. - + The pattern to use with this PatternString - As the enumerator is over an empty collection its - value cannot be moved over a valid position, therefore - will throw an . + Initialize a new instance of with the pattern specified. - The collection is empty and - cannot be positioned over a valid location. - + - Gets the current entry from the enumerator. + Gets or sets the pattern formatting string - - Throws an because the - never has a current entry. - + + The pattern formatting string + - As the enumerator is over an empty collection its - value cannot be moved over a valid position, therefore - will throw an . + The ConversionPattern option. This is the string which + controls formatting and consists of a mix of literal content and + conversion specifiers. - The collection is empty and - cannot be positioned over a valid location. - + - An always empty . + Initialize object options - A singleton implementation of the over a collection - that is empty and not modifiable. + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. - Nicko Cadell - Gert Driesen - + - Initializes a new instance of the class. + Create the used to parse the pattern + the pattern to parse + The - Uses a private access modifier to enforce the singleton pattern. + Returns PatternParser used to parse the conversion string. Subclasses + may override this to return a subclass of PatternParser which recognize + custom conversion pattern name. - + - Test if the enumerator can advance, if so advance + Produces a formatted string as specified by the conversion pattern. - false as the cannot advance. + The TextWriter to write the formatted event to - As the enumerator is over an empty collection its - value cannot be moved over a valid position, therefore - will always return false. + Format the pattern to the . - + - Resets the enumerator back to the start. + Format the pattern as a string + the pattern formatted as a string - As the enumerator is over an empty collection does nothing. + Format the pattern to a string. - - - The singleton instance of the . - - - + - Get the singleton instance of the . + Add a converter to this PatternString - The singleton instance of the . + the converter info - Gets the singleton instance of the . + This version of the method is used by the configurator. + Programmatic users should use the alternative method. - + - Gets the current object from the enumerator. + Add a converter to this PatternString - - Throws an because the - never has a current value. - + the name of the conversion pattern for this converter + the type of the converter - As the enumerator is over an empty collection its - value cannot be moved over a valid position, therefore - will throw an . + Add a converter to this PatternString - The collection is empty and - cannot be positioned over a valid location. - + - A SecurityContext used when a SecurityContext is not required + Write the name of the current AppDomain to the output - The is a no-op implementation of the - base class. It is used where a - is required but one has not been provided. + Write the name of the current AppDomain to the output writer Nicko Cadell - + - Singleton instance of + Write the name of the current AppDomain to the output + the writer to write to + null, state is not set - Singleton instance of + Writes name of the current AppDomain to the output . - + - Private constructor + AppSetting pattern converter - Private constructor for singleton pattern. + This pattern converter reads appSettings from the application configuration file. + + + If the is specified then that will be used to + lookup a single appSettings value. If no is specified + then all appSettings will be dumped as a list of key value pairs. + + + A typical use is to specify a base directory for log files, e.g. + + + + + ... + + + ]]> + - + - Impersonate this SecurityContext + Write the property value to the output - State supplied by the caller - null + that will receive the formatted result. + null, state is not set - No impersonation is done and null is always returned. + Writes out the value of a named property. The property name + should be set in the + property. + + + If the is set to null + then all the properties are written as key value pairs. - + - Implements log4net's default error handling policy which consists - of emitting a message for the first error in an appender and - ignoring all subsequent errors. + Write the current date to the output - The error message is processed using the LogLog sub-system by default. + Date pattern converter, uses a to format + the current date and time to the writer as a string. - This policy aims at protecting an otherwise working application - from being flooded with error messages when logging fails. + The value of the determines + the formatting of the date. The following values are allowed: + + + Option value + Output + + + ISO8601 + + Uses the formatter. + Formats using the "yyyy-MM-dd HH:mm:ss,fff" pattern. + + + + DATE + + Uses the formatter. + Formats using the "dd MMM yyyy HH:mm:ss,fff" for example, "06 Nov 1994 15:49:37,459". + + + + ABSOLUTE + + Uses the formatter. + Formats using the "HH:mm:ss,fff" for example, "15:49:37,459". + + + + other + + Any other pattern string uses the formatter. + This formatter passes the pattern string to the + method. + For details on valid patterns see + DateTimeFormatInfo Class. + + + + + + The date and time is in the local time zone and is rendered in that zone. + To output the time in Universal time see . Nicko Cadell - Gert Driesen - Ron Grabowski - + - Default Constructor + The used to render the date to a string - Initializes a new instance of the class. + The used to render the date to a string - + - Constructor + Initialize the converter options - The prefix to use for each message. - Initializes a new instance of the class - with the specified prefix. + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. - - - Reset the error handler back to its initial disabled state. - - - + - Log an Error + Write the current date to the output - The error message. - The exception. - The internal error code. + that will receive the formatted result. + null, state is not set - Invokes if and only if this is the first error or the first error after has been called. + Pass the current date and time to the + for it to render it to the writer. + + + The date and time passed is in the local time zone. - + - Log the very first error + The fully qualified type of the DatePatternConverter class. - The error message. - The exception. - The internal error code. - - Sends the error information to 's Error method. - + Used by the internal logger to record the Type of the + log message. - + - Log an Error + Write an folder path to the output - The error message. - The exception. - Invokes if and only if this is the first error or the first error after has been called. + Write an special path environment folder path to the output writer. + The value of the determines + the name of the variable to output. + should be a value in the enumeration. + Ron Grabowski - + - Log an error + Write an special path environment folder path to the output - The error message. + the writer to write to + null, state is not set - Invokes if and only if this is the first error or the first error after has been called. + Writes the special path environment folder path to the output . + The name of the special path environment folder path to output must be set + using the + property. - - - The UTC date the error was recorded. - - - - - Flag to indicate if it is the first error - - - - - The message recorded during the first error. - - - - - The exception recorded during the first error. - - - - - The error code recorded during the first error. - - - - - String to prefix each message with - - - + - The fully qualified type of the OnlyOnceErrorHandler class. + The fully qualified type of the EnvironmentFolderPathPatternConverter class. Used by the internal logger to record the Type of the log message. - + - Is error logging enabled + Write an environment variable to the output - Is error logging enabled. Logging is only enabled for the - first error delivered to the . + Write an environment variable to the output writer. + The value of the determines + the name of the variable to output. + Nicko Cadell - + - The date the first error that trigged this error handler occurred, or if it has not been triggered. + Write an environment variable to the output + the writer to write to + null, state is not set + + + Writes the environment variable to the output . + The name of the environment variable to output must be set + using the + property. + + - + - The UTC date the first error that trigged this error handler occured, or if it has not been triggered. + The fully qualified type of the EnvironmentPatternConverter class. + + Used by the internal logger to record the Type of the + log message. + - + - The message from the first error that trigged this error handler. + Write the current thread identity to the output + + + Write the current thread identity to the output writer + + + Nicko Cadell - + - The exception from the first error that trigged this error handler. + Write the current thread identity to the output + the writer to write to + null, state is not set - May be . + + Writes the current thread identity to the output . + - + - The error code from the first error that trigged this error handler. + The fully qualified type of the IdentityPatternConverter class. - Defaults to + Used by the internal logger to record the Type of the + log message. - + - A convenience class to convert property values to specific types. + Pattern converter for literal string instances in the pattern - Utility functions for converting types and parsing values. + Writes the literal string value specified in the + property to + the output. Nicko Cadell - Gert Driesen - + - Initializes a new instance of the class. + Set the next converter in the chain + The next pattern converter in the chain + The next pattern converter - Uses a private access modifier to prevent instantiation of this class. + Special case the building of the pattern converter chain + for instances. Two adjacent + literals in the pattern can be represented by a single combined + pattern converter. This implementation detects when a + is added to the chain + after this converter and combines its value with this converter's + literal value. - + - Converts a string to a value. + Write the literal to the output - String to convert. - The default value. - The value of . + the writer to write to + null, not set - If is "true", then true is returned. - If is "false", then false is returned. - Otherwise, is returned. + Override the formatting behavior to ignore the FormattingInfo + because we have a literal instead. + + + Writes the value of + to the output . - + - Parses a file size into a number. + Convert this pattern into the rendered message - String to parse. - The default value. - The value of . + that will receive the formatted result. + null, not set - Parses a file size of the form: number[KB|MB|GB] into a - long value. It is scaled with the appropriate multiplier. - - - is returned when - cannot be converted to a value. + This method is not used. - + - Converts a string to an object. + Writes a newline to the output - The target type to convert to. - The string to convert to an object. - - The object converted from a string or null when the - conversion failed. - - Converts a string to an object. Uses the converter registry to try - to convert the string value into the specified target type. + Writes the system dependent line terminator to the output. + This behavior can be overridden by setting the : + + + Option Value + Output + + + DOS + DOS or Windows line terminator "\r\n" + + + UNIX + UNIX line terminator "\n" + + + Nicko Cadell - + - Checks if there is an appropriate type conversion from the source type to the target type. + Initialize the converter - The type to convert from. - The type to convert to. - true if there is a conversion from the source type to the target type. - Checks if there is an appropriate type conversion from the source type to the target type. + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. - + - Converts an object to the target type. + Write the current process ID to the output - The object to convert to the target type. - The type to convert to. - The converted object. - Converts an object to the target type. + Write the current process ID to the output writer + Nicko Cadell - + - Instantiates an object given a class name. + Write the current process ID to the output - The fully qualified class name of the object to instantiate. - The class to which the new object should belong. - The object to return in case of non-fulfillment. - - An instance of the or - if the object could not be instantiated. - + the writer to write to + null, state is not set - Checks that the is a subclass of - . If that test fails or the object could - not be instantiated, then is returned. + Write the current process ID to the output . - + - Performs variable substitution in string from the - values of keys found in . + The fully qualified type of the ProcessIdPatternConverter class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Property pattern converter - The string on which variable substitution is performed. - The dictionary to use to lookup variables. - The result of the substitutions. - The variable substitution delimiters are ${ and }. + This pattern converter reads the thread and global properties. + The thread properties take priority over global properties. + See for details of the + thread properties. See for + details of the global properties. - For example, if props contains key=value, then the call + If the is specified then that will be used to + lookup a single property. If no is specified + then all properties will be dumped as a list of key value pairs. + + Nicko Cadell + + + + Write the property value to the output + + that will receive the formatted result. + null, state is not set + - - string s = OptionConverter.SubstituteVariables("Value of key is ${key}."); - + Writes out the value of a named property. The property name + should be set in the + property. - will set the variable s to "Value of key is value.". + If the is set to null + then all the properties are written as key value pairs. + + + + + A Pattern converter that generates a string of random characters + + - If no value could be found for the specified key, then substitution - defaults to an empty string. + The converter generates a string of random characters. By default + the string is length 4. This can be changed by setting the + to the string value of the length required. - For example, if system properties contains no value for the key - "nonExistentKey", then the call + The random characters in the string are limited to uppercase letters + and numbers only. - - string s = OptionConverter.SubstituteVariables("Value of nonExistentKey is [${nonExistentKey}]"); - + The random number generator used by this class is not cryptographically secure. + + Nicko Cadell + + + + Shared random number generator + + + + + Length of random string to generate. Default length 4. + + + + + Initialize the converter options + + - will set s to "Value of nonExistentKey is []". + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. - An Exception is thrown if contains a start - delimiter "${" which is not balanced by a stop delimiter "}". + If any of the configuration properties are modified then + must be called again. - + - Converts the string representation of the name or numeric value of one or - more enumerated constants to an equivalent enumerated object. + Write a randoim string to the output - The type to convert to. - The enum string value. - If true, ignore case; otherwise, regard case. - An object of type whose value is represented by . + the writer to write to + null, state is not set + + + Write a randoim string to the output . + + - + - The fully qualified type of the OptionConverter class. + The fully qualified type of the RandomStringPatternConverter class. Used by the internal logger to record the Type of the log message. - + - Most of the work of the class - is delegated to the PatternParser class. + Write the current threads username to the output - The PatternParser processes a pattern string and - returns a chain of objects. + Write the current threads username to the output writer Nicko Cadell - Gert Driesen - + - Constructor + Write the current threads username to the output - The pattern to parse. + the writer to write to + null, state is not set - Initializes a new instance of the class - with the specified pattern string. + Write the current threads username to the output . - + - Parses the pattern into a chain of pattern converters. + The fully qualified type of the UserNamePatternConverter class. - The head of a chain of pattern converters. - - Parses the pattern into a chain of pattern converters. - + Used by the internal logger to record the Type of the + log message. - + - Build the unified cache of converters from the static and instance maps + Write the UTC date time to the output - the list of all the converter names - Build the unified cache of converters from the static and instance maps + Date pattern converter, uses a to format + the current date and time in Universal time. - - - - - Internal method to parse the specified pattern to find specified matches - - the pattern to parse - the converter names to match in the pattern - - The matches param must be sorted such that longer strings come before shorter ones. + See the for details on the date pattern syntax. + + Nicko Cadell - - - Process a parsed literal - - the literal text - - - - Process a parsed converter pattern - - the name of the converter - the optional option for the converter - the formatting info for the converter - - - - Resets the internal state of the parser and adds the specified pattern converter - to the chain. - - The pattern converter to add. - - - - The first pattern converter in the chain - - - - - the last pattern converter in the chain - - - - - The pattern - - - + - Internal map of converter identifiers to converter types + Write the current date and time to the output + that will receive the formatted result. + null, state is not set - This map overrides the static s_globalRulesRegistry map. + Pass the current date and time to the + for it to render it to the writer. + + + The date is in Universal time when it is rendered. + - + - The fully qualified type of the PatternParser class. + The fully qualified type of the UtcDatePatternConverter class. Used by the internal logger to record the Type of the log message. - + - Get the converter registry used by this parser + String keyed object map. - - The converter registry used by this parser - - Get the converter registry used by this parser + While this collection is serializable only member + objects that are serializable will + be serialized along with this collection. + Nicko Cadell + Gert Driesen - + - Sort strings by length + Constructor - that orders strings by string length. - The longest strings are placed first + Initializes a new instance of the class. - + - This class implements a patterned string. + Constructor + properties to copy - This string has embedded patterns that are resolved and expanded - when the string is formatted. - - - This class functions similarly to the - in that it accepts a pattern and renders it to a string. Unlike the - however the PatternString - does not render the properties of a specific but - of the process in general. - - - The recognized conversion pattern names are: - - - - Conversion Pattern Name - Effect - - - appdomain - - - Used to output the friendly name of the current AppDomain. - - - - - appsetting - - - Used to output the value of a specific appSetting key in the application - configuration file. - - - - - date - - - Used to output the current date and time in the local time zone. - To output the date in universal time use the %utcdate pattern. - The date conversion - specifier may be followed by a date format specifier enclosed - between braces. For example, %date{HH:mm:ss,fff} or - %date{dd MMM yyyy HH:mm:ss,fff}. If no date format specifier is - given then ISO8601 format is - assumed (). - - - The date format specifier admits the same syntax as the - time pattern string of the . - - - For better results it is recommended to use the log4net date - formatters. These can be specified using one of the strings - "ABSOLUTE", "DATE" and "ISO8601" for specifying - , - and respectively - . For example, - %date{ISO8601} or %date{ABSOLUTE}. - - - These dedicated date formatters perform significantly - better than . - - - - - env - - - Used to output the a specific environment variable. The key to - lookup must be specified within braces and directly following the - pattern specifier, e.g. %env{COMPUTERNAME} would include the value - of the COMPUTERNAME environment variable. - - - The env pattern is not supported on the .NET Compact Framework. - - - - - identity - - - Used to output the user name for the currently active user - (Principal.Identity.Name). - - - - - newline - - - Outputs the platform dependent line separator character or - characters. - - - This conversion pattern name offers the same performance as using - non-portable line separator strings such as "\n", or "\r\n". - Thus, it is the preferred way of specifying a line separator. - - - - - processid - - - Used to output the system process ID for the current process. - - - - - property - - - Used to output a specific context property. The key to - lookup must be specified within braces and directly following the - pattern specifier, e.g. %property{user} would include the value - from the property that is keyed by the string 'user'. Each property value - that is to be included in the log must be specified separately. - Properties are stored in logging contexts. By default - the log4net:HostName property is set to the name of machine on - which the event was originally logged. - - - If no key is specified, e.g. %property then all the keys and their - values are printed in a comma separated list. - - - The properties of an event are combined from a number of different - contexts. These are listed below in the order in which they are searched. - - - - the thread properties - - The that are set on the current - thread. These properties are shared by all events logged on this thread. - - - - the global properties - - The that are set globally. These - properties are shared by all the threads in the AppDomain. - - - - - - - random - - - Used to output a random string of characters. The string is made up of - uppercase letters and numbers. By default the string is 4 characters long. - The length of the string can be specified within braces directly following the - pattern specifier, e.g. %random{8} would output an 8 character string. - - - - - username - - - Used to output the WindowsIdentity for the currently - active user. - - - - - utcdate - - - Used to output the date of the logging event in universal time. - The date conversion - specifier may be followed by a date format specifier enclosed - between braces. For example, %utcdate{HH:mm:ss,fff} or - %utcdate{dd MMM yyyy HH:mm:ss,fff}. If no date format specifier is - given then ISO8601 format is - assumed (). - - - The date format specifier admits the same syntax as the - time pattern string of the . - - - For better results it is recommended to use the log4net date - formatters. These can be specified using one of the strings - "ABSOLUTE", "DATE" and "ISO8601" for specifying - , - and respectively - . For example, - %utcdate{ISO8601} or %utcdate{ABSOLUTE}. - - - These dedicated date formatters perform significantly - better than . - - - - - % - - - The sequence %% outputs a single percent sign. - - - - - - Additional pattern converters may be registered with a specific - instance using or - . - - - See the for details on the - format modifiers supported by the patterns. + Initializes a new instance of the class. - Nicko Cadell - - - - Internal map of converter identifiers to converter types. - - - - - the pattern - - - - - the head of the pattern converter chain - - - - patterns defined on this PatternString only - - - - - Initialize the global registry - - - + - Default constructor + Initializes a new instance of the class + with serialized data. + The that holds the serialized object data. + The that contains contextual information about the source or destination. - Initialize a new instance of + Because this class is sealed the serialization constructor is private. - + - Constructs a PatternString + Gets or sets the value of the property with the specified key. - The pattern to use with this PatternString + + The value of the property with the specified key. + + The key of the property to get or set. - Initialize a new instance of with the pattern specified. + The property value will only be serialized if it is serializable. + If it cannot be serialized it will be silently ignored if + a serialization operation is performed. - + - Initialize object options + Remove the entry with the specified key from this dictionary + the key for the entry to remove - This is part of the delayed object - activation scheme. The method must - be called on this object after the configuration properties have - been set. Until is called this - object is in an undefined state and must not be used. - - - If any of the configuration properties are modified then - must be called again. + Remove the entry with the specified key from this dictionary - + - Create the used to parse the pattern + See - the pattern to parse - The + an enumerator - Returns PatternParser used to parse the conversion string. Subclasses - may override this to return a subclass of PatternParser which recognize - custom conversion pattern name. + Returns a over the contest of this collection. - + - Produces a formatted string as specified by the conversion pattern. + See - The TextWriter to write the formatted event to + the key to remove - Format the pattern to the . + Remove the entry with the specified key from this dictionary - + - Format the pattern as a string + See - the pattern formatted as a string + the key to lookup in the collection + true if the collection contains the specified key - Format the pattern to a string. + Test if this collection contains a specified key. - + - Add a converter to this PatternString + Remove all properties from the properties collection - the converter info - This version of the method is used by the configurator. - Programmatic users should use the alternative method. + Remove all properties from the properties collection - + - Add a converter to this PatternString + See - the name of the conversion pattern for this converter - the type of the converter + the key + the value to store for the key - Add a converter to this PatternString + Store a value for the specified . + Thrown if the is not a string - + - Gets or sets the pattern formatting string + See - The pattern formatting string + false - The ConversionPattern option. This is the string which - controls formatting and consists of a mix of literal content and - conversion specifiers. + This collection is modifiable. This property always + returns false. - + - String keyed object map. + See + + The value for the key specified. + - While this collection is serializable only member - objects that are serializable will - be serialized along with this collection. + Get or set a value for the specified . - Nicko Cadell - Gert Driesen + Thrown if the is not a string - + - String keyed object map that is read only. + See - - - This collection is readonly and cannot be modified. - - - While this collection is serializable only member - objects that are serializable will - be serialized along with this collection. - - - Nicko Cadell - Gert Driesen - + - The Hashtable used to store the properties data + See - + - Constructor + See - - - Initializes a new instance of the class. - - - + - Copy Constructor + See - properties to copy - - - Initializes a new instance of the class. - - + + - + - Deserialization constructor + See - The that holds the serialized object data. - The that contains contextual information about the source or destination. - - - Initializes a new instance of the class - with serialized data. - - - + - Gets the key names. + See + + + + + See + + + + + A class to hold the key and data for a property set in the config file - An array of all the keys. - Gets the key names. + A class to hold the key and data for a property set in the config file - + - Test if the dictionary contains a specified key + Property Key - the key to look for - true if the dictionary contains the specified key + + Property Key + - Test if the dictionary contains a specified key + Property Key. - + - Serializes this object into the provided. + Property Value - The to populate with data. - The destination for this serialization. + + Property Value + - Serializes this object into the provided. + Property Value. - + - See + Override Object.ToString to return sensible debug info + string info about this object - + - See + A that ignores the message - + + + This writer is used in special cases where it is necessary + to protect a writer from being closed by a client. + + + Nicko Cadell - + - See + Constructor - - + the writer to actually write to + + + Create a new ProtectCloseTextWriter using a writer + + - + - Remove all properties from the properties collection + Attach this instance to a different underlying + the writer to attach to + + + Attach this instance to a different underlying + + - + - See + Does not close the underlying output writer. - - + + + Does not close the underlying output writer. + This method does nothing. + + - + - See + that does not leak exceptions - - + + + does not throw exceptions when things go wrong. + Instead, it delegates error handling to its . + + + Nicko Cadell + Gert Driesen - + - See + Constructor + the writer to actually write to + the error handler to report error to + + + Create a new QuietTextWriter using a writer and error handler + + - + - Gets or sets the value of the property with the specified key. + Gets or sets the error handler that all errors are passed to. - The value of the property with the specified key. + The error handler that all errors are passed to. - The key of the property to get or set. - The property value will only be serialized if it is serializable. - If it cannot be serialized it will be silently ignored if - a serialization operation is performed. + Gets or sets the error handler that all errors are passed to. - + - The hashtable used to store the properties + Gets a value indicating whether this writer is closed. - The internal collection used to store the properties + true if this writer is closed, otherwise false. - The hashtable used to store the properties + Gets a value indicating whether this writer is closed. - - - See - - - - - See - - - + - See + Writes a character to the underlying writer + the char to write + + + Writes a character to the underlying writer + + - + - See + Writes a buffer to the underlying writer + the buffer to write + the start index to write from + the number of characters to write + + + Writes a buffer to the underlying writer + + - + - See + Writes a string to the output. + The string data to write to the output. + + + Writes a string to the output. + + - + - See + Closes the underlying output writer. + + + Closes the underlying output writer. + + - + - The number of properties in this collection + The error handler instance to pass all errors to - + - See + Flag to indicate if this writer is closed - + - Constructor + Defines a lock that supports single writers and multiple readers - Initializes a new instance of the class. + ReaderWriterLock is used to synchronize access to a resource. + At any given time, it allows either concurrent read access for + multiple threads, or write access for a single thread. In a + situation where a resource is changed infrequently, a + ReaderWriterLock provides better throughput than a simple + one-at-a-time lock, such as . + + + If a platform does not support a System.Threading.ReaderWriterLock + implementation then all readers and writers are serialized. Therefore + the caller must not rely on multiple simultaneous readers. + Nicko Cadell - + Constructor - properties to copy - Initializes a new instance of the class. + Initializes a new instance of the class. - + - Initializes a new instance of the class - with serialized data. + Acquires a reader lock - The that holds the serialized object data. - The that contains contextual information about the source or destination. - Because this class is sealed the serialization constructor is private. + blocks if a different thread has the writer + lock, or if at least one thread is waiting for the writer lock. - + - Remove the entry with the specified key from this dictionary + Decrements the lock count - the key for the entry to remove - Remove the entry with the specified key from this dictionary + decrements the lock count. When the count + reaches zero, the lock is released. - + - See + Acquires the writer lock - an enumerator - Returns a over the contest of this collection. + This method blocks if another thread has a reader lock or writer lock. - + - See + Decrements the lock count on the writer lock - the key to remove - Remove the entry with the specified key from this dictionary + ReleaseWriterLock decrements the writer lock count. + When the count reaches zero, the writer lock is released. - + - See + String keyed object map that is read only. - the key to lookup in the collection - true if the collection contains the specified key - Test if this collection contains a specified key. + This collection is readonly and cannot be modified. + + + While this collection is serializable only member + objects that are serializable will + be serialized along with this collection. + Nicko Cadell + Gert Driesen - + - Remove all properties from the properties collection + The Hashtable used to store the properties data + + + + + Constructor - Remove all properties from the properties collection + Initializes a new instance of the class. - + - See + Copy Constructor - the key - the value to store for the key + properties to copy - Store a value for the specified . + Initializes a new instance of the class. - Thrown if the is not a string - + - See + Deserialization constructor - - + The that holds the serialized object data. + The that contains contextual information about the source or destination. + + + Initializes a new instance of the class + with serialized data. + + - + - See + Gets the key names. + An array of all the keys. + + + Gets the key names. + + - + Gets or sets the value of the property with the specified key. @@ -29706,297 +30292,391 @@ - + - See + Test if the dictionary contains a specified key - - false - + the key to look for + true if the dictionary contains the specified key - This collection is modifiable. This property always - returns false. + Test if the dictionary contains a specified key - + - See + The hashtable used to store the properties - The value for the key specified. + The internal collection used to store the properties - Get or set a value for the specified . + The hashtable used to store the properties - Thrown if the is not a string - + + + Serializes this object into the provided. + + The to populate with data. + The destination for this serialization. + + + Serializes this object into the provided. + + + + + + See + + + + + See + + + + + + See + + + + + + + Remove all properties from the properties collection + + + + + See + + + + + + + See + + + + + See + + + See - + See - + See - + - See + See + + - + - See + See - + - A class to hold the key and data for a property set in the config file + The number of properties in this collection - - - A class to hold the key and data for a property set in the config file - - - + - Override Object.ToString to return sensible debug info + See - string info about this object - + - Property Key + See - - Property Key - - - - Property Key. - - - + - Property Value + A that can be and reused - - Property Value - - Property Value. + A that can be and reused. + This uses a single buffer for string operations. + Nicko Cadell - + - A that ignores the message + Create an instance of + the format provider to use - This writer is used in special cases where it is necessary - to protect a writer from being closed by a client. + Create an instance of - Nicko Cadell - + - Constructor + Override Dispose to prevent closing of writer - the writer to actually write to + flag - Create a new ProtectCloseTextWriter using a writer + Override Dispose to prevent closing of writer - + - Attach this instance to a different underlying + Reset this string writer so that it can be reused. - the writer to attach to + the maximum buffer capacity before it is trimmed + the default size to make the buffer - Attach this instance to a different underlying + Reset this string writer so that it can be reused. + The internal buffers are cleared and reset. - + - Does not close the underlying output writer. + Utility class for system specific information. - Does not close the underlying output writer. - This method does nothing. + Utility class of static methods for system specific information. + Nicko Cadell + Gert Driesen + Alexey Solofnenko - + - Defines a lock that supports single writers and multiple readers + Private constructor to prevent instances. - ReaderWriterLock is used to synchronize access to a resource. - At any given time, it allows either concurrent read access for - multiple threads, or write access for a single thread. In a - situation where a resource is changed infrequently, a - ReaderWriterLock provides better throughput than a simple - one-at-a-time lock, such as . - - - If a platform does not support a System.Threading.ReaderWriterLock - implementation then all readers and writers are serialized. Therefore - the caller must not rely on multiple simultaneous readers. + Only static methods are exposed from this type. - Nicko Cadell - + - Constructor + Initialize default values for private static fields. - Initializes a new instance of the class. + Only static methods are exposed from this type. - + - Acquires a reader lock + Gets the system dependent line terminator. + + The system dependent line terminator. + - blocks if a different thread has the writer - lock, or if at least one thread is waiting for the writer lock. + Gets the system dependent line terminator. - + - Decrements the lock count + Gets the base directory for this . + The base directory path for the current . - decrements the lock count. When the count - reaches zero, the lock is released. + Gets the base directory for this . + + + The value returned may be either a local file path or a URI. - + - Acquires the writer lock + Gets the path to the configuration file for the current . + The path to the configuration file for the current . - This method blocks if another thread has a reader lock or writer lock. + The .NET Compact Framework 1.0 does not have a concept of a configuration + file. For this runtime, we use the entry assembly location as the root for + the configuration file name. + + + The value returned may be either a local file path or a URI. - + - Decrements the lock count on the writer lock + Gets the path to the file that first executed in the current . + The path to the entry assembly. - ReleaseWriterLock decrements the writer lock count. - When the count reaches zero, the writer lock is released. + Gets the path to the file that first executed in the current . - + - A that can be and reused + Gets the ID of the current thread. + The ID of the current thread. - A that can be and reused. - This uses a single buffer for string operations. + On the .NET framework, the AppDomain.GetCurrentThreadId method + is used to obtain the thread ID for the current thread. This is the + operating system ID for the thread. + + + On the .NET Compact Framework 1.0 it is not possible to get the + operating system thread ID for the current thread. The native method + GetCurrentThreadId is implemented inline in a header file + and cannot be called. + + + On the .NET Framework 2.0 the Thread.ManagedThreadId is used as this + gives a stable id unrelated to the operating system thread ID which may + change if the runtime is using fibers. - Nicko Cadell - + - Create an instance of + Get the host name or machine name for the current machine - the format provider to use + + The hostname or machine name + - Create an instance of + Get the host name or machine name for the current machine + + + The host name () or + the machine name (Environment.MachineName) for + the current machine, or if neither of these are available + then NOT AVAILABLE is returned. - + - Override Dispose to prevent closing of writer + Get this application's friendly name - flag + + The friendly name of this application as a string + - Override Dispose to prevent closing of writer + If available the name of the application is retrieved from + the AppDomain using AppDomain.CurrentDomain.FriendlyName. + + + Otherwise the file name of the entry assembly is used. - + - Reset this string writer so that it can be reused. + Get the start time for the current process. - the maximum buffer capacity before it is trimmed - the default size to make the buffer - Reset this string writer so that it can be reused. - The internal buffers are cleared and reset. + This is the time at which the log4net library was loaded into the + AppDomain. Due to reports of a hang in the call to System.Diagnostics.Process.StartTime + this is not the start time for the current process. + + + The log4net library should be loaded by an application early during its + startup, therefore this start time should be a good approximation for + the actual start time. + + + Note that AppDomains may be loaded and unloaded within the + same process without the process terminating, however this start time + will be set per AppDomain. - + - Utility class for system specific information. + Get the UTC start time for the current process. - Utility class of static methods for system specific information. + This is the UTC time at which the log4net library was loaded into the + AppDomain. Due to reports of a hang in the call to System.Diagnostics.Process.StartTime + this is not the start time for the current process. + + + The log4net library should be loaded by an application early during its + startup, therefore this start time should be a good approximation for + the actual start time. + + + Note that AppDomains may be loaded and unloaded within the + same process without the process terminating, however this start time + will be set per AppDomain. - Nicko Cadell - Gert Driesen - Alexey Solofnenko - + - Private constructor to prevent instances. + Text to output when a null is encountered. - Only static methods are exposed from this type. + Use this value to indicate a null has been encountered while + outputting a string representation of an item. + + + The default value is (null). This value can be overridden by specifying + a value for the log4net.NullText appSetting in the application's + .config file. - + - Initialize default values for private static fields. + Text to output when an unsupported feature is requested. - Only static methods are exposed from this type. + Use this value when an unsupported feature is requested. + + + The default value is NOT AVAILABLE. This value can be overridden by specifying + a value for the log4net.NotAvailableText appSetting in the application's + .config file. @@ -30016,12 +30696,12 @@ - Gets the fully qualified name of the , including - the name of the assembly from which the was + Gets the fully qualified name of the , including + the name of the assembly from which the was loaded. - The to get the fully qualified name for. - The fully qualified name for the . + The to get the fully qualified name for. + The fully qualified name for the . This is equivalent to the Type.AssemblyQualifiedName property, @@ -30032,13 +30712,13 @@ - Gets the short name of the . + Gets the short name of the . - The to get the name for. - The short name of the . + The to get the name for. + The short name of the . - The short name of the assembly is the + The short name of the assembly is the without the version, culture, or public key. i.e. it is just the assembly's file name without the extension. @@ -30049,20 +30729,20 @@ Because of a FileIOPermission security demand we cannot do the obvious Assembly.GetName().Name. We are allowed to get - the of the assembly so we + the of the assembly so we start from there and strip out just the assembly name. - Gets the file name portion of the , including the extension. + Gets the file name portion of the , including the extension. - The to get the file name for. + The to get the file name for. The file name of the assembly. - Gets the file name portion of the , including the extension. + Gets the file name portion of the , including the extension. @@ -30095,7 +30775,7 @@ The name of the type to load. Flag set to true to throw an exception if the type cannot be loaded. true to ignore the case of the type name; otherwise, false - The type loaded or null if it could not be loaded. + The type loaded or null if it could not be loaded. If the type name is fully qualified, i.e. if contains an assembly name in @@ -30153,1187 +30833,768 @@ Create a new instance of the class - with a specified error message, the parameter name, and the value - of the argument. - - - The Compact Framework does not support the 3 parameter constructor for the - type. This method provides an - implementation that works for all platforms. - - - - - - Parse a string into an value - - the string to parse - out param where the parsed value is placed - true if the string was able to be parsed into an integer - - - Attempts to parse the string into an integer. If the string cannot - be parsed then this method returns false. The method does not throw an exception. - - - - - - Parse a string into an value - - the string to parse - out param where the parsed value is placed - true if the string was able to be parsed into an integer - - - Attempts to parse the string into an integer. If the string cannot - be parsed then this method returns false. The method does not throw an exception. - - - - - - Parse a string into an value - - the string to parse - out param where the parsed value is placed - true if the string was able to be parsed into an integer - - - Attempts to parse the string into an integer. If the string cannot - be parsed then this method returns false. The method does not throw an exception. - - - - - - Lookup an application setting - - the application settings key to lookup - the value for the key, or null - - - Configuration APIs are not supported under the Compact Framework - - - - - - Convert a path into a fully qualified local file path. - - The path to convert. - The fully qualified path. - - - Converts the path specified to a fully - qualified path. If the path is relative it is - taken as relative from the application base - directory. - - - The path specified must be a local file path, a URI is not supported. - - - - - - Creates a new case-insensitive instance of the class with the default initial capacity. - - A new case-insensitive instance of the class with the default initial capacity - - - The new Hashtable instance uses the default load factor, the CaseInsensitiveHashCodeProvider, and the CaseInsensitiveComparer. - - - - - - Tests two strings for equality, the ignoring case. - - - If the platform permits, culture information is ignored completely (ordinal comparison). - The aim of this method is to provide a fast comparison that deals with null and ignores different casing. - It is not supposed to deal with various, culture-specific habits. - Use it to compare against pure ASCII constants, like keywords etc. - - The one string. - The other string. - true if the strings are equal, false otherwise. - - - - Gets an empty array of types. - - - - The Type.EmptyTypes field is not available on - the .NET Compact Framework 1.0. - - - - - - The fully qualified type of the SystemInfo class. - - - Used by the internal logger to record the Type of the - log message. - - - - - Cache the host name for the current machine - - - - - Cache the application friendly name - - - - - Text to output when a null is encountered. - - - - - Text to output when an unsupported feature is requested. - - - - - Start time for the current process. - - - - - Gets the system dependent line terminator. - - - The system dependent line terminator. - - - - Gets the system dependent line terminator. - - - - - - Gets the base directory for this . - - The base directory path for the current . - - - Gets the base directory for this . - - - The value returned may be either a local file path or a URI. - - - - - - Gets the path to the configuration file for the current . - - The path to the configuration file for the current . - - - The .NET Compact Framework 1.0 does not have a concept of a configuration - file. For this runtime, we use the entry assembly location as the root for - the configuration file name. - - - The value returned may be either a local file path or a URI. - - - - - - Gets the path to the file that first executed in the current . - - The path to the entry assembly. - - - Gets the path to the file that first executed in the current . - - - - - - Gets the ID of the current thread. - - The ID of the current thread. - - - On the .NET framework, the AppDomain.GetCurrentThreadId method - is used to obtain the thread ID for the current thread. This is the - operating system ID for the thread. - - - On the .NET Compact Framework 1.0 it is not possible to get the - operating system thread ID for the current thread. The native method - GetCurrentThreadId is implemented inline in a header file - and cannot be called. - - - On the .NET Framework 2.0 the Thread.ManagedThreadId is used as this - gives a stable id unrelated to the operating system thread ID which may - change if the runtime is using fibers. - - - - - - Get the host name or machine name for the current machine - - - The hostname or machine name - - - - Get the host name or machine name for the current machine + with a specified error message, the parameter name, and the value + of the argument. - The host name () or - the machine name (Environment.MachineName) for - the current machine, or if neither of these are available - then NOT AVAILABLE is returned. + The Compact Framework does not support the 3 parameter constructor for the + type. This method provides an + implementation that works for all platforms. - + - Get this application's friendly name + Parse a string into an value - - The friendly name of this application as a string - + the string to parse + out param where the parsed value is placed + true if the string was able to be parsed into an integer - If available the name of the application is retrieved from - the AppDomain using AppDomain.CurrentDomain.FriendlyName. - - - Otherwise the file name of the entry assembly is used. + Attempts to parse the string into an integer. If the string cannot + be parsed then this method returns false. The method does not throw an exception. - + - Get the start time for the current process. + Parse a string into an value + the string to parse + out param where the parsed value is placed + true if the string was able to be parsed into an integer - This is the time at which the log4net library was loaded into the - AppDomain. Due to reports of a hang in the call to System.Diagnostics.Process.StartTime - this is not the start time for the current process. - - - The log4net library should be loaded by an application early during its - startup, therefore this start time should be a good approximation for - the actual start time. - - - Note that AppDomains may be loaded and unloaded within the - same process without the process terminating, however this start time - will be set per AppDomain. + Attempts to parse the string into an integer. If the string cannot + be parsed then this method returns false. The method does not throw an exception. - + - Get the UTC start time for the current process. + Parse a string into an value + the string to parse + out param where the parsed value is placed + true if the string was able to be parsed into an integer - This is the UTC time at which the log4net library was loaded into the - AppDomain. Due to reports of a hang in the call to System.Diagnostics.Process.StartTime - this is not the start time for the current process. - - - The log4net library should be loaded by an application early during its - startup, therefore this start time should be a good approximation for - the actual start time. - - - Note that AppDomains may be loaded and unloaded within the - same process without the process terminating, however this start time - will be set per AppDomain. + Attempts to parse the string into an integer. If the string cannot + be parsed then this method returns false. The method does not throw an exception. - + - Text to output when a null is encountered. + Lookup an application setting + the application settings key to lookup + the value for the key, or null - Use this value to indicate a null has been encountered while - outputting a string representation of an item. - - - The default value is (null). This value can be overridden by specifying - a value for the log4net.NullText appSetting in the application's - .config file. + Configuration APIs are not supported under the Compact Framework - + - Text to output when an unsupported feature is requested. + Convert a path into a fully qualified local file path. + The path to convert. + The fully qualified path. - Use this value when an unsupported feature is requested. + Converts the path specified to a fully + qualified path. If the path is relative it is + taken as relative from the application base + directory. - The default value is NOT AVAILABLE. This value can be overridden by specifying - a value for the log4net.NotAvailableText appSetting in the application's - .config file. + The path specified must be a local file path, a URI is not supported. - + - Utility class that represents a format string. + Creates a new case-insensitive instance of the class with the default initial capacity. + A new case-insensitive instance of the class with the default initial capacity - Utility class that represents a format string. + The new Hashtable instance uses the default load factor, the CaseInsensitiveHashCodeProvider, and the CaseInsensitiveComparer. - Nicko Cadell - - - - Initialise the - - An that supplies culture-specific formatting information. - A containing zero or more format items. - An array containing zero or more objects to format. - + - Format the string and arguments + Tests two strings for equality, the ignoring case. - the formatted string + + If the platform permits, culture information is ignored completely (ordinal comparison). + The aim of this method is to provide a fast comparison that deals with null and ignores different casing. + It is not supposed to deal with various, culture-specific habits. + Use it to compare against pure ASCII constants, like keywords etc. + + The one string. + The other string. + true if the strings are equal, false otherwise. - + - Replaces the format item in a specified with the text equivalent - of the value of a corresponding instance in a specified array. - A specified parameter supplies culture-specific formatting information. + Gets an empty array of types. - An that supplies culture-specific formatting information. - A containing zero or more format items. - An array containing zero or more objects to format. - - A copy of format in which the format items have been replaced by the - equivalent of the corresponding instances of in args. - - This method does not throw exceptions. If an exception thrown while formatting the result the - exception and arguments are returned in the result string. + The Type.EmptyTypes field is not available on + the .NET Compact Framework 1.0. - - - Process an error during StringFormat - - - + - Dump the contents of an array into a string builder + The fully qualified type of the SystemInfo class. + + Used by the internal logger to record the Type of the + log message. + - + - Dump an object to a string + Cache the host name for the current machine - + - The fully qualified type of the SystemStringFormat class. + Cache the application friendly name - - Used by the internal logger to record the Type of the - log message. - - + - Implementation of Properties collection for the + Text to output when a null is encountered. - - - Class implements a collection of properties that is specific to each thread. - The class is not synchronized as each thread has its own . - - - Nicko Cadell - + - Each thread will automatically have its instance. + Text to output when an unsupported feature is requested. - + - Internal constructor + Start time for the current process. - - - Initializes a new instance of the class. - - - + - Remove a property + Utility class that represents a format string. - the key for the entry to remove - Remove a property + Utility class that represents a format string. + Nicko Cadell - + - Get the keys stored in the properties. + Format - - Gets the keys stored in the properties. - - a set of the defined keys - + - Clear all properties + Args - - - Clear all properties - - - + - Get the PropertiesDictionary for this thread. + Initialise the - create the dictionary if it does not exist, otherwise return null if does not exist - the properties for this thread - - - The collection returned is only to be used on the calling thread. If the - caller needs to share the collection between different threads then the - caller must clone the collection before doing so. - - + An that supplies culture-specific formatting information. + A containing zero or more format items. + An array containing zero or more objects to format. - + - Gets or sets the value of a property + Format the string and arguments - - The value for the property with the specified key - - - - Gets or sets the value of a property - - + the formatted string - + - Implementation of Stack for the + Replaces the format item in a specified with the text equivalent + of the value of a corresponding instance in a specified array. + A specified parameter supplies culture-specific formatting information. + An that supplies culture-specific formatting information. + A containing zero or more format items. + An array containing zero or more objects to format. + + A copy of format in which the format items have been replaced by the + equivalent of the corresponding instances of in args. + - Implementation of Stack for the + This method does not throw exceptions. If an exception thrown while formatting the result the + exception and arguments are returned in the result string. - Nicko Cadell - + - The stack store. + Process an error during StringFormat - + - Internal constructor + Dump the contents of an array into a string builder - - - Initializes a new instance of the class. - - - + - Clears all the contextual information held in this stack. + Dump an object to a string - - - Clears all the contextual information held in this stack. - Only call this if you think that this tread is being reused after - a previous call execution which may not have completed correctly. - You do not need to use this method if you always guarantee to call - the method of the - returned from even in exceptional circumstances, - for example by using the using(log4net.ThreadContext.Stacks["NDC"].Push("Stack_Message")) - syntax. - - - + - Removes the top context from this stack. + The fully qualified type of the SystemStringFormat class. - The message in the context that was removed from the top of this stack. - - Remove the top context from this stack, and return - it to the caller. If this stack is empty then an - empty string (not ) is returned. - + Used by the internal logger to record the Type of the + log message. - + - Pushes a new context message into this stack. + Adapter that extends and forwards all + messages to an instance of . - The new context message. - - An that can be used to clean up the context stack. - - Pushes a new context onto this stack. An - is returned that can be used to clean up this stack. This - can be easily combined with the using keyword to scope the - context. + Adapter that extends and forwards all + messages to an instance of . - Simple example of using the Push method with the using keyword. - - using(log4net.ThreadContext.Stacks["NDC"].Push("Stack_Message")) - { - log.Warn("This should have an ThreadContext Stack message"); - } - - + Nicko Cadell - + - Gets the current context information for this stack. + The writer to forward messages to - The current context information. - + - Gets the current context information for this stack. + Create an instance of that forwards all + messages to a . - Gets the current context information + The to forward to - Gets the current context information for this stack. + Create an instance of that forwards all + messages to a . - + - Get a portable version of this object + Gets or sets the underlying . - the portable instance of this object + + The underlying . + - Get a cross thread portable version of this object + Gets or sets the underlying . - + - The number of messages in the stack + The Encoding in which the output is written - The current number of messages in the stack + The - The current number of messages in the stack. That is - the number of times has been called - minus the number of times has been called. + The Encoding in which the output is written - + - Gets and sets the internal stack used by this + Gets an object that controls formatting - The internal storage stack + + The format provider + - This property is provided only to support backward compatability - of the . Tytpically the internal stack should not - be modified. + Gets an object that controls formatting - + - Inner class used to represent a single context frame in the stack. + Gets or sets the line terminator string used by the TextWriter + + The line terminator to use + - Inner class used to represent a single context frame in the stack. + Gets or sets the line terminator string used by the TextWriter - + - Constructor + Closes the writer and releases any system resources associated with the writer - The message for this context. - The parent context in the chain. - Initializes a new instance of the class - with the specified message and parent context. - + - Get the message. + Dispose this writer - The message. + flag indicating if we are being disposed - Get the message. + Dispose this writer - + - Gets the full text of the context down to the root level. + Flushes any buffered output - - The full text of the context down to the root level. - - Gets the full text of the context down to the root level. + Clears all buffers for the writer and causes any buffered data to be written + to the underlying device - + - Struct returned from the method. + Writes a character to the wrapped TextWriter + the value to write to the TextWriter - This struct implements the and is designed to be used - with the pattern to remove the stack frame at the end of the scope. + Writes a character to the wrapped TextWriter - - - The ThreadContextStack internal stack - - - - - The depth to trim the stack to when this instance is disposed - - - + - Constructor + Writes a character buffer to the wrapped TextWriter - The internal stack used by the ThreadContextStack. - The depth to return the stack to when this object is disposed. + the data buffer + the start index + the number of characters to write - Initializes a new instance of the class with - the specified stack and return depth. + Writes a character buffer to the wrapped TextWriter - + - Returns the stack to the correct depth. + Writes a string to the wrapped TextWriter + the value to write to the TextWriter - Returns the stack to the correct depth. + Writes a string to the wrapped TextWriter - + - Implementation of Stacks collection for the + Implementation of Properties collection for the - Implementation of Stacks collection for the + Class implements a collection of properties that is specific to each thread. + The class is not synchronized as each thread has its own . Nicko Cadell - + - Internal constructor + Each thread will automatically have its instance. - - - Initializes a new instance of the class. - - - + - The fully qualified type of the ThreadContextStacks class. + Internal constructor - Used by the internal logger to record the Type of the - log message. + + Initializes a new instance of the class. + - + - Gets the named thread context stack + Gets or sets the value of a property - The named stack + The value for the property with the specified key - Gets the named thread context stack + Gets or sets the value of a property - + - Utility class for transforming strings. + Remove a property + the key for the entry to remove - Utility class for transforming strings. + Remove a property - Nicko Cadell - Gert Driesen - + - Initializes a new instance of the class. + Get the keys stored in the properties. - - Uses a private access modifier to prevent instantiation of this class. + Gets the keys stored in the properties. - + a set of the defined keys - + - Write a string to an + Clear all properties - the writer to write to - the string to write - The string to replace non XML compliant chars with - The test is escaped either using XML escape entities - or using CDATA sections. + Clear all properties - + - Replace invalid XML characters in text string + Get the PropertiesDictionary for this thread. - the XML text input string - the string to use in place of invalid characters - A string that does not contain invalid XML characters. + create the dictionary if it does not exist, otherwise return null if does not exist + the properties for this thread - Certain Unicode code points are not allowed in the XML InfoSet, for - details see: http://www.w3.org/TR/REC-xml/#charsets. - - - This method replaces any illegal characters in the input string - with the mask string specified. + The collection returned is only to be used on the calling thread. If the + caller needs to share the collection between different threads then the + caller must clone the collection before doing so. - + - Count the number of times that the substring occurs in the text + Implementation of Stack for the - the text to search - the substring to find - the number of times the substring occurs in the text - The substring is assumed to be non repeating within itself. + Implementation of Stack for the + Nicko Cadell - + - Characters illegal in XML 1.0 + The stack store. - + - Impersonate a Windows Account + Internal constructor - This impersonates a Windows account. - - - How the impersonation is done depends on the value of . - This allows the context to either impersonate a set of user credentials specified - using username, domain name and password or to revert to the process credentials. + Initializes a new instance of the class. - + - Default constructor + The number of messages in the stack + + The current number of messages in the stack + - Default constructor + The current number of messages in the stack. That is + the number of times has been called + minus the number of times has been called. - + - Initialize the SecurityContext based on the options set. + Clears all the contextual information held in this stack. - This is part of the delayed object - activation scheme. The method must - be called on this object after the configuration properties have - been set. Until is called this - object is in an undefined state and must not be used. - - - If any of the configuration properties are modified then - must be called again. + Clears all the contextual information held in this stack. + Only call this if you think that this tread is being reused after + a previous call execution which may not have completed correctly. + You do not need to use this method if you always guarantee to call + the method of the + returned from even in exceptional circumstances, + for example by using the using(log4net.ThreadContext.Stacks["NDC"].Push("Stack_Message")) + syntax. + + + + + Removes the top context from this stack. + + The message in the context that was removed from the top of this stack. + - The security context will try to Logon the specified user account and - capture a primary token for impersonation. + Remove the top context from this stack, and return + it to the caller. If this stack is empty then an + empty string (not ) is returned. - The required , - or properties were not specified. - + - Impersonate the Windows account specified by the and properties. + Pushes a new context message into this stack. - caller provided state + The new context message. - An instance that will revoke the impersonation of this SecurityContext + An that can be used to clean up the context stack. - Depending on the property either - impersonate a user using credentials supplied or revert - to the process credentials. + Pushes a new context onto this stack. An + is returned that can be used to clean up this stack. This + can be easily combined with the using keyword to scope the + context. + Simple example of using the Push method with the using keyword. + + using(log4net.ThreadContext.Stacks["NDC"].Push("Stack_Message")) + { + log.Warn("This should have an ThreadContext Stack message"); + } + + - + - Create a given the userName, domainName and password. + Returns the top context from this stack. - the user name - the domain name - the password - the for the account specified + The message in the context from the top of this stack. - Uses the Windows API call LogonUser to get a principal token for the account. This - token is used to initialize the WindowsIdentity. + Returns the top context from this stack. If this stack is empty then an + empty string (not ) is returned. - + - Gets or sets the impersonation mode for this security context + Gets the current context information for this stack. - - The impersonation mode for this security context - + The current context information. + + + + Gets and sets the internal stack used by this + + The internal storage stack - Impersonate either a user with user credentials or - revert this thread to the credentials of the process. - The value is one of the - enum. - - - The default value is - - - When the mode is set to - the user's credentials are established using the - , and - values. - - - When the mode is set to - no other properties need to be set. If the calling thread is - impersonating then it will be reverted back to the process credentials. + This property is provided only to support backward compatability + of the . Tytpically the internal stack should not + be modified. - + - Gets or sets the Windows username for this security context + Gets the current context information for this stack. - - The Windows username for this security context - + Gets the current context information - This property must be set if - is set to (the default setting). + Gets the current context information for this stack. - + - Gets or sets the Windows domain name for this security context + Get a portable version of this object - - The Windows domain name for this security context - + the portable instance of this object - The default value for is the local machine name - taken from the property. - - - This property must be set if - is set to (the default setting). + Get a cross thread portable version of this object - + - Sets the password for the Windows account specified by the and properties. + Inner class used to represent a single context frame in the stack. - - The password for the Windows account specified by the and properties. - - This property must be set if - is set to (the default setting). + Inner class used to represent a single context frame in the stack. - + - The impersonation modes for the + Constructor + The message for this context. + The parent context in the chain. - See the property for - details. + Initializes a new instance of the class + with the specified message and parent context. - - - Impersonate a user using the credentials supplied - - - + - Revert this the thread to the credentials of the process + Get the message. + The message. + + + Get the message. + + - + - Adds to + Gets the full text of the context down to the root level. + + The full text of the context down to the root level. + - Helper class to expose the - through the interface. + Gets the full text of the context down to the root level. - + - Constructor + Struct returned from the method. - the impersonation context being wrapped - Constructor + This struct implements the and is designed to be used + with the pattern to remove the stack frame at the end of the scope. - + - Revert the impersonation + The ThreadContextStack internal stack + + + + + The depth to trim the stack to when this instance is disposed + + + + Constructor + + The internal stack used by the ThreadContextStack. + The depth to return the stack to when this object is disposed. - Revert the impersonation + Initializes a new instance of the class with + the specified stack and return depth. - + - The log4net Global Context. + Returns the stack to the correct depth. - The GlobalContext provides a location for global debugging - information to be stored. - - - The global context has a properties map and these properties can - be included in the output of log messages. The - supports selecting and outputing these properties. - - - By default the log4net:HostName property is set to the name of - the current machine. + Returns the stack to the correct depth. - - - GlobalContext.Properties["hostname"] = Environment.MachineName; - - - - Nicko Cadell - + - Private Constructor. + Implementation of Stacks collection for the - Uses a private access modifier to prevent instantiation of this class. + + Implementation of Stacks collection for the + + Nicko Cadell - + - The global context properties instance + Internal constructor + + + Initializes a new instance of the class. + + - + - The global properties map. + Gets the named thread context stack - The global properties map. + The named stack - The global properties map. + Gets the named thread context stack - - - Provides information about the environment the assembly has - been built for. - - - - Version of the assembly - - - Version of the framework targeted - - - Type of framework targeted - - - Does it target a client profile? - - + - Identifies the version and target for this assembly. + The fully qualified type of the ThreadContextStacks class. + + Used by the internal logger to record the Type of the + log message. + - + - The log4net Logical Thread Context. + Utility class for transforming strings. - The LogicalThreadContext provides a location for specific debugging - information to be stored. - The LogicalThreadContext properties override any or - properties with the same name. - - - For .NET Standard 1.3 this class uses - System.Threading.AsyncLocal rather than . - - - The Logical Thread Context has a properties map and a stack. - The properties and stack can - be included in the output of log messages. The - supports selecting and outputting these properties. - - - The Logical Thread Context provides a diagnostic context for the current call context. - This is an instrument for distinguishing interleaved log - output from different sources. Log output is typically interleaved - when a server handles multiple clients near-simultaneously. - - - The Logical Thread Context is managed on a per basis. - - - The requires a link time - for the - . - If the calling code does not have this permission then this context will be disabled. - It will not store any property values set on it. + Utility class for transforming strings. - Example of using the thread context properties to store a username. - - LogicalThreadContext.Properties["user"] = userName; - log.Info("This log message has a LogicalThreadContext Property called 'user'"); - - - Example of how to push a message into the context stack - - using(LogicalThreadContext.Stacks["LDC"].Push("my context message")) - { - log.Info("This log message has a LogicalThreadContext Stack message that includes 'my context message'"); - - } // at the end of the using block the message is automatically popped - - - Nicko Cadell + Gert Driesen - + - Private Constructor. + Initializes a new instance of the class. @@ -31341,1122 +31602,958 @@ - - - The thread context properties instance - - - + - The thread context stacks instance + Write a string to an + the writer to write to + the string to write + The string to replace non XML compliant chars with + + + The test is escaped either using XML escape entities + or using CDATA sections. + + - + - The thread properties map + Replace invalid XML characters in text string - - The thread properties map - + the XML text input string + the string to use in place of invalid characters + A string that does not contain invalid XML characters. - The LogicalThreadContext properties override any - or properties with the same name. + Certain Unicode code points are not allowed in the XML InfoSet, for + details see: http://www.w3.org/TR/REC-xml/#charsets. + + + This method replaces any illegal characters in the input string + with the mask string specified. - + - The thread stacks + Count the number of times that the substring occurs in the text - - stack map - + the text to search + the substring to find + the number of times the substring occurs in the text - The logical thread stacks. + The substring is assumed to be non repeating within itself. - + - This class is used by client applications to request logger instances. + Characters illegal in XML 1.0 + + + + + Type converter for Boolean. - This class has static methods that are used by a client to request - a logger instance. The method is - used to retrieve a logger. - - - See the interface for more details. + Supports conversion from string to bool type. - Simple example of logging messages - - ILog log = LogManager.GetLogger("application-log"); - - log.Info("Application Start"); - log.Debug("This is a debug message"); - - if (log.IsDebugEnabled) - { - log.Debug("This is another debug message"); - } - - - - + + + Nicko Cadell Gert Driesen - + - Initializes a new instance of the class. + Can the source type be converted to the type supported by this object + the type to convert + true if the conversion is possible - Uses a private access modifier to prevent instantiation of this class. + + Returns true if the is + the type. + - - Returns the named logger if it exists. + - Returns the named logger if it exists. + Convert the source object to the type supported by this object + the object to convert + the converted object - If the named logger exists (in the default repository) then it - returns a reference to the logger, otherwise it returns null. + Uses the method to convert the + argument to a . - The fully qualified logger name to look for. - The logger found, or null if no logger could be found. + + The object cannot be converted to the + target type. To check for this condition use the + method. + - - Get the currently defined loggers. + - Returns all the currently defined loggers in the default repository. + Exception base type for conversion errors. - The root logger is not included in the returned array. + + This type extends . It + does not add any new functionality but does differentiate the + type of exception being thrown. + - All the defined loggers. + Nicko Cadell + Gert Driesen - - Get or create a logger. + - Retrieves or creates a named logger. + Constructor - Retrieves a logger named as the - parameter. If the named logger already exists, then the - existing instance will be returned. Otherwise, a new instance is - created. - - By default, loggers do not have a set level but inherit - it from the hierarchy. This is one of the central features of - log4net. + Initializes a new instance of the class. - The name of the logger to retrieve. - The logger with the name specified. - + - Returns the named logger if it exists. + Constructor + A message to include with the exception. - If the named logger exists (in the specified repository) then it - returns a reference to the logger, otherwise it returns - null. + Initializes a new instance of the class + with the specified message. - The repository to lookup in. - The fully qualified logger name to look for. - - The logger found, or null if the logger doesn't exist in the specified - repository. - - + - Returns the named logger if it exists. + Constructor + A message to include with the exception. + A nested exception to include. - If the named logger exists (in the repository for the specified assembly) then it - returns a reference to the logger, otherwise it returns - null. + Initializes a new instance of the class + with the specified message and inner exception. - The assembly to use to lookup the repository. - The fully qualified logger name to look for. - - The logger, or null if the logger doesn't exist in the specified - assembly's repository. - - + - Returns all the currently defined loggers in the specified repository. + Serialization constructor - The repository to lookup in. + The that holds the serialized object data about the exception being thrown. + The that contains contextual information about the source or destination. - The root logger is not included in the returned array. + + Initializes a new instance of the class + with serialized data. + - All the defined loggers. - + - Returns all the currently defined loggers in the specified assembly's repository. + Creates a new instance of the class. - The assembly to use to lookup the repository. + The conversion destination type. + The value to convert. + An instance of the . - The root logger is not included in the returned array. + + Creates a new instance of the class. + - All the defined loggers. - + - Retrieves or creates a named logger. + Creates a new instance of the class. + The conversion destination type. + The value to convert. + A nested exception to include. + An instance of the . - Retrieve a logger named as the - parameter. If the named logger already exists, then the - existing instance will be returned. Otherwise, a new instance is - created. - - - By default, loggers do not have a set level but inherit - it from the hierarchy. This is one of the central features of - log4net. + Creates a new instance of the class. - The repository to lookup in. - The name of the logger to retrieve. - The logger with the name specified. - + - Retrieves or creates a named logger. + Register of type converters for specific types. - Retrieve a logger named as the - parameter. If the named logger already exists, then the - existing instance will be returned. Otherwise, a new instance is - created. + Maintains a registry of type converters used to convert between + types. - By default, loggers do not have a set level but inherit - it from the hierarchy. This is one of the central features of - log4net. + Use the and + methods to register new converters. + The and methods + lookup appropriate converters to use. - The assembly to use to lookup the repository. - The name of the logger to retrieve. - The logger with the name specified. + + + Nicko Cadell + Gert Driesen - + - Shorthand for . + Private constructor - Get the logger for the fully qualified name of the type specified. + Initializes a new instance of the class. - The full name of will be used as the name of the logger to retrieve. - The logger with the name specified. - + - Shorthand for . + Static constructor. - Gets the logger for the fully qualified name of the type specified. + + This constructor defines the intrinsic type converters. + - The repository to lookup in. - The full name of will be used as the name of the logger to retrieve. - The logger with the name specified. - + - Shorthand for . + Adds a converter for a specific type. + The type being converted to. + The type converter to use to convert to the destination type. - Gets the logger for the fully qualified name of the type specified. + + Adds a converter instance for a specific type. + - The assembly to use to lookup the repository. - The full name of will be used as the name of the logger to retrieve. - The logger with the name specified. - + - Shuts down the log4net system. + Adds a converter for a specific type. + The type being converted to. + The type of the type converter to use to convert to the destination type. - Calling this method will safely close and remove all - appenders in all the loggers including root contained in all the - default repositories. - - - Some appenders need to be closed before the application exists. - Otherwise, pending logging events might be lost. - - The shutdown method is careful to close nested - appenders before closing regular appenders. This is allows - configurations where a regular appender is attached to a logger - and again to a nested appender. + Adds a converter for a specific type. - - Shutdown a logger repository. + - Shuts down the default repository. + Gets the type converter to use to convert values to the destination type. + The type being converted from. + The type being converted to. + + The type converter instance to use for type conversions or null + if no type converter is found. + - Calling this method will safely close and remove all - appenders in all the loggers including root contained in the - default repository. - - Some appenders need to be closed before the application exists. - Otherwise, pending logging events might be lost. - - The shutdown method is careful to close nested - appenders before closing regular appenders. This is allows - configurations where a regular appender is attached to a logger - and again to a nested appender. + Gets the type converter to use to convert values to the destination type. - + - Shuts down the repository for the repository specified. + Gets the type converter to use to convert values to the destination type. + The type being converted to. + + The type converter instance to use for type conversions or null + if no type converter is found. + - Calling this method will safely close and remove all - appenders in all the loggers including root contained in the - specified. - - - Some appenders need to be closed before the application exists. - Otherwise, pending logging events might be lost. - - The shutdown method is careful to close nested - appenders before closing regular appenders. This is allows - configurations where a regular appender is attached to a logger - and again to a nested appender. + Gets the type converter to use to convert values to the destination type. - The repository to shutdown. - + - Shuts down the repository specified. + Lookups the type converter to use as specified by the attributes on the + destination type. - - - Calling this method will safely close and remove all - appenders in all the loggers including root contained in the - repository. The repository is looked up using - the specified. - - - Some appenders need to be closed before the application exists. - Otherwise, pending logging events might be lost. - - - The shutdown method is careful to close nested - appenders before closing regular appenders. This is allows - configurations where a regular appender is attached to a logger - and again to a nested appender. - - - The assembly to use to lookup the repository. + The type being converted to. + + The type converter instance to use for type conversions or null + if no type converter is found. + - - Reset the configuration of a repository + - Resets all values contained in this repository instance to their defaults. + Creates the instance of the type converter. + The type of the type converter. + + The type converter instance to use for type conversions or null + if no type converter is found. + - Resets all values contained in the repository instance to their - defaults. This removes all appenders from all loggers, sets - the level of all non-root loggers to null, - sets their additivity flag to true and sets the level - of the root logger to . Moreover, - message disabling is set to its default "off" value. - + The type specified for the type converter must implement + the or interfaces + and must have a public default (no argument) constructor. + - + - Resets all values contained in this repository instance to their defaults. + The fully qualified type of the ConverterRegistry class. - - Reset all values contained in the repository instance to their - defaults. This removes all appenders from all loggers, sets - the level of all non-root loggers to null, - sets their additivity flag to true and sets the level - of the root logger to . Moreover, - message disabling is set to its default "off" value. - + Used by the internal logger to record the Type of the + log message. - The repository to reset. - + - Resets all values contained in this repository instance to their defaults. + Mapping from to type converter. - - - Reset all values contained in the repository instance to their - defaults. This removes all appenders from all loggers, sets - the level of all non-root loggers to null, - sets their additivity flag to true and sets the level - of the root logger to . Moreover, - message disabling is set to its default "off" value. - - - The assembly to use to lookup the repository to reset. - - Get the logger repository. + - Returns the default instance. + Supports conversion from string to type. - Gets the for the repository specified - by the callers assembly (). + Supports conversion from string to type. - The instance for the default repository. + + + + Nicko Cadell + Gert Driesen - + - Returns the default instance. + Can the source type be converted to the type supported by this object - The default instance. + the type to convert + true if the conversion is possible - - Gets the for the repository specified - by the argument. + + Returns true if the is + the type. - The repository to lookup in. - + - Returns the default instance. + Overrides the ConvertFrom method of IConvertFrom. - The default instance. + the object to convert to an encoding + the encoding - Gets the for the repository specified - by the argument. + Uses the method to + convert the argument to an . - The assembly to use to lookup the repository. + + The object cannot be converted to the + target type. To check for this condition use the + method. + - - Get a logger repository. + - Returns the default instance. + Interface supported by type converters - Gets the for the repository specified - by the callers assembly (). + This interface supports conversion from arbitrary types + to a single target type. See . - The instance for the default repository. + Nicko Cadell + Gert Driesen - + - Returns the default instance. + Can the source type be converted to the type supported by this object - The default instance. + the type to convert + true if the conversion is possible - Gets the for the repository specified - by the argument. + Test if the can be converted to the + type supported by this converter. - The repository to lookup in. - + - Returns the default instance. + Convert the source object to the type supported by this object - The default instance. + the object to convert + the converted object - Gets the for the repository specified - by the argument. + Converts the to the type supported + by this converter. - The assembly to use to lookup the repository. - - Create a domain + - Creates a repository with the specified repository type. + Interface supported by type converters - CreateDomain is obsolete. Use CreateRepository instead of CreateDomain. - - - The created will be associated with the repository - specified such that a call to will return - the same repository instance. + This interface supports conversion from a single type to arbitrary types. + See . - A that implements - and has a no arg constructor. An instance of this type will be created to act - as the for the repository specified. - The created for the repository. + Nicko Cadell - - Create a logger repository. + - Creates a repository with the specified repository type. + Returns whether this converter can convert the object to the specified type - A that implements - and has a no arg constructor. An instance of this type will be created to act - as the for the repository specified. - The created for the repository. + A Type that represents the type you want to convert to + true if the conversion is possible - The created will be associated with the repository - specified such that a call to will return - the same repository instance. + Test if the type supported by this converter can be converted to the + . - + - Creates a repository with the specified name. + Converts the given value object to the specified type, using the arguments + the object to convert + The Type to convert the value parameter to + the converted object - CreateDomain is obsolete. Use CreateRepository instead of CreateDomain. - - - Creates the default type of which is a - object. - - - The name must be unique. Repositories cannot be redefined. - An will be thrown if the repository already exists. + Converts the (which must be of the type supported + by this converter) to the specified.. - The name of the repository, this must be unique amongst repositories. - The created for the repository. - The specified repository already exists. - + - Creates a repository with the specified name. + Supports conversion from string to type. - Creates the default type of which is a - object. - - - The name must be unique. Repositories cannot be redefined. - An will be thrown if the repository already exists. + Supports conversion from string to type. - The name of the repository, this must be unique amongst repositories. - The created for the repository. - The specified repository already exists. + + + Nicko Cadell - + - Creates a repository with the specified name and repository type. + Can the source type be converted to the type supported by this object + the type to convert + true if the conversion is possible - CreateDomain is obsolete. Use CreateRepository instead of CreateDomain. - - - The name must be unique. Repositories cannot be redefined. - An will be thrown if the repository already exists. + Returns true if the is + the type. - The name of the repository, this must be unique to the repository. - A that implements - and has a no arg constructor. An instance of this type will be created to act - as the for the repository specified. - The created for the repository. - The specified repository already exists. - + - Creates a repository with the specified name and repository type. + Overrides the ConvertFrom method of IConvertFrom. + the object to convert to an IPAddress + the IPAddress - The name must be unique. Repositories cannot be redefined. - An will be thrown if the repository already exists. + Uses the method to convert the + argument to an . + If that fails then the string is resolved as a DNS hostname. - The name of the repository, this must be unique to the repository. - A that implements - and has a no arg constructor. An instance of this type will be created to act - as the for the repository specified. - The created for the repository. - The specified repository already exists. + + The object cannot be converted to the + target type. To check for this condition use the + method. + - + - Creates a repository for the specified assembly and repository type. + Valid characters in an IPv4 or IPv6 address string. (Does not support subnets) + + + + + Supports conversion from string to type. - CreateDomain is obsolete. Use CreateRepository instead of CreateDomain. + Supports conversion from string to type. - The created will be associated with the repository - specified such that a call to with the - same assembly specified will return the same repository instance. + The string is used as the + of the . - The assembly to use to get the name of the repository. - A that implements - and has a no arg constructor. An instance of this type will be created to act - as the for the repository specified. - The created for the repository. + + + + Nicko Cadell - + - Creates a repository for the specified assembly and repository type. + Can the source type be converted to the type supported by this object + the type to convert + true if the conversion is possible - The created will be associated with the repository - specified such that a call to with the - same assembly specified will return the same repository instance. + Returns true if the is + the type. - The assembly to use to get the name of the repository. - A that implements - and has a no arg constructor. An instance of this type will be created to act - as the for the repository specified. - The created for the repository. - + - Gets the list of currently defined repositories. + Overrides the ConvertFrom method of IConvertFrom. + the object to convert to a PatternLayout + the PatternLayout - Get an array of all the objects that have been created. + Creates and returns a new using + the as the + . - An array of all the known objects. - - - - Flushes logging events buffered in all configured appenders in the default repository. - - The maximum time in milliseconds to wait for logging events from asycnhronous appenders to be flushed. - True if all logging events were flushed successfully, else false. - - - - Looks up the wrapper object for the logger specified. - - The logger to get the wrapper for. - The wrapper for the logger specified. - - - - Looks up the wrapper objects for the loggers specified. - - The loggers to get the wrappers for. - The wrapper objects for the loggers specified. - - - - Create the objects used by - this manager. - - The logger to wrap. - The wrapper for the logger specified. - - - - The wrapper map to use to hold the objects. - + + The object cannot be converted to the + target type. To check for this condition use the + method. + - + - Implementation of Mapped Diagnostic Contexts. + Convert between string and - - - The MDC is deprecated and has been replaced by the . - The current MDC implementation forwards to the ThreadContext.Properties. - - - The MDC class is similar to the class except that it is - based on a map instead of a stack. It provides mapped - diagnostic contexts. A Mapped Diagnostic Context, or - MDC in short, is an instrument for distinguishing interleaved log - output from different sources. Log output is typically interleaved - when a server handles multiple clients near-simultaneously. + Supports conversion from string to type, + and from a type to a string. - The MDC is managed on a per thread basis. + The string is used as the + of the . - + + + Nicko Cadell - Gert Driesen - + - Initializes a new instance of the class. + Can the target type be converted to the type supported by this object + A that represents the type you want to convert to + true if the conversion is possible - Uses a private access modifier to prevent instantiation of this class. + + Returns true if the is + assignable from a type. + - + - Gets the context value identified by the parameter. + Converts the given value object to the specified type, using the arguments - The key to lookup in the MDC. - The string value held for the key, or a null reference if no corresponding value is found. + the object to convert + The Type to convert the value parameter to + the converted object - - - The MDC is deprecated and has been replaced by the . - The current MDC implementation forwards to the ThreadContext.Properties. - - - If the parameter does not look up to a - previously defined context then null will be returned. + Uses the method to convert the + argument to a . + + The object cannot be converted to the + . To check for this condition use the + method. + - + - Add an entry to the MDC + Can the source type be converted to the type supported by this object - The key to store the value under. - The value to store. + the type to convert + true if the conversion is possible - - - The MDC is deprecated and has been replaced by the . - The current MDC implementation forwards to the ThreadContext.Properties. - - - Puts a context value (the parameter) as identified - with the parameter into the current thread's - context map. - - - If a value is already defined for the - specified then the value will be replaced. If the - is specified as null then the key value mapping will be removed. + Returns true if the is + the type. - + - Removes the key value mapping for the key specified. + Overrides the ConvertFrom method of IConvertFrom. - The key to remove. + the object to convert to a PatternString + the PatternString - - - The MDC is deprecated and has been replaced by the . - The current MDC implementation forwards to the ThreadContext.Properties. - - - Remove the specified entry from this thread's MDC + Creates and returns a new using + the as the + . + + The object cannot be converted to the + target type. To check for this condition use the + method. + - + - Clear all entries in the MDC + Supports conversion from string to type. - - - The MDC is deprecated and has been replaced by the . - The current MDC implementation forwards to the ThreadContext.Properties. - - - Remove all the entries from this thread's MDC + Supports conversion from string to type. + + + + Nicko Cadell - + - Implementation of Nested Diagnostic Contexts. + Can the source type be converted to the type supported by this object + the type to convert + true if the conversion is possible - - The NDC is deprecated and has been replaced by the . - The current NDC implementation forwards to the ThreadContext.Stacks["NDC"]. + Returns true if the is + the type. - + + + + + Overrides the ConvertFrom method of IConvertFrom. + + the object to convert to a Type + the Type + - A Nested Diagnostic Context, or NDC in short, is an instrument - to distinguish interleaved log output from different sources. Log - output is typically interleaved when a server handles multiple - clients near-simultaneously. + Uses the method to convert the + argument to a . + Additional effort is made to locate partially specified types + by searching the loaded assemblies. + + + The object cannot be converted to the + target type. To check for this condition use the + method. + + + + + Attribute used to associate a type converter + + - Interleaved log output can still be meaningful if each log entry - from different contexts had a distinctive stamp. This is where NDCs - come into play. + Class and Interface level attribute that specifies a type converter + to use with the associated type. - Note that NDCs are managed on a per thread basis. The NDC class - is made up of static methods that operate on the context of the - calling thread. + To associate a type converter with a target type apply a + TypeConverterAttribute to the target type. Specify the + type of the type converter on the attribute. - How to push a message into the context - - using(NDC.Push("my context message")) - { - ... all log calls will have 'my context message' included ... - - } // at the end of the using block the message is automatically removed - - - Nicko Cadell Gert Driesen - + - Initializes a new instance of the class. + The string type name of the type converter - - Uses a private access modifier to prevent instantiation of this class. - - + - Clears all the contextual information held on the current thread. + Default constructor - - - The NDC is deprecated and has been replaced by the . - The current NDC implementation forwards to the ThreadContext.Stacks["NDC"]. - - - Clears the stack of NDC data held on the current thread. + Default constructor - + - Creates a clone of the stack of context information. + Create a new type converter attribute for the specified type name - A clone of the context info for this thread. + The string type name of the type converter - - - The NDC is deprecated and has been replaced by the . - The current NDC implementation forwards to the ThreadContext.Stacks["NDC"]. - - - The results of this method can be passed to the - method to allow child threads to inherit the context of their - parent thread. + The type specified must implement the + or the interfaces. - + - Inherits the contextual information from another thread. + Create a new type converter attribute for the specified type - The context stack to inherit. + The type of the type converter - - - The NDC is deprecated and has been replaced by the . - The current NDC implementation forwards to the ThreadContext.Stacks["NDC"]. - - - This thread will use the context information from the stack - supplied. This can be used to initialize child threads with - the same contextual information as their parent threads. These - contexts will NOT be shared. Any further contexts that - are pushed onto the stack will not be visible to the other. - Call to obtain a stack to pass to - this method. + The type specified must implement the + or the interfaces. - + - Removes the top context from the stack. + The string type name of the type converter - - The message in the context that was removed from the top - of the stack. - - - - - The NDC is deprecated and has been replaced by the . - The current NDC implementation forwards to the ThreadContext.Stacks["NDC"]. - - - - Remove the top context from the stack, and return - it to the caller. If the stack is empty then an - empty string (not null) is returned. + + The string type name of the type converter + + + + The type specified must implement the + or the interfaces. - + - Pushes a new context message. + Impersonate a Windows Account - The new context message. - - An that can be used to clean up - the context stack. - - - The NDC is deprecated and has been replaced by the . - The current NDC implementation forwards to the ThreadContext.Stacks["NDC"]. + This impersonates a Windows account. - - Pushes a new context onto the context stack. An - is returned that can be used to clean up the context stack. This - can be easily combined with the using keyword to scope the - context. + How the impersonation is done depends on the value of . + This allows the context to either impersonate a set of user credentials specified + using username, domain name and password or to revert to the process credentials. - Simple example of using the Push method with the using keyword. - - using(log4net.NDC.Push("NDC_Message")) - { - log.Warn("This should have an NDC message"); - } - - - + - Pushes a new context message. + The impersonation modes for the - The new context message string format. - Arguments to be passed into messageFormat. - - An that can be used to clean up - the context stack. - - - - The NDC is deprecated and has been replaced by the . - The current NDC implementation forwards to the ThreadContext.Stacks["NDC"]. - - - Pushes a new context onto the context stack. An - is returned that can be used to clean up the context stack. This - can be easily combined with the using keyword to scope the - context. + See the property for + details. - Simple example of using the Push method with the using keyword. - - var someValue = "ExampleContext" - using(log4net.NDC.PushFormat("NDC_Message {0}", someValue)) - { - log.Warn("This should have an NDC message"); - } - - - + - Removes the context information for this thread. It is - not required to call this method. + Impersonate a user using the credentials supplied + + + + + Revert this the thread to the credentials of the process + + + + + Default constructor - - - The NDC is deprecated and has been replaced by the . - The current NDC implementation forwards to the ThreadContext.Stacks["NDC"]. - - - This method is not implemented. + Default constructor - + - Forces the stack depth to be at most . + Gets or sets the impersonation mode for this security context - The maximum depth of the stack + + The impersonation mode for this security context + - - The NDC is deprecated and has been replaced by the . - The current NDC implementation forwards to the ThreadContext.Stacks["NDC"]. + Impersonate either a user with user credentials or + revert this thread to the credentials of the process. + The value is one of the + enum. - - Forces the stack depth to be at most . - This may truncate the head of the stack. This only affects the - stack in the current thread. Also it does not prevent it from - growing, it only sets the maximum depth at the time of the - call. This can be used to return to a known context depth. + The default value is + + + When the mode is set to + the user's credentials are established using the + , and + values. + + + When the mode is set to + no other properties need to be set. If the calling thread is + impersonating then it will be reverted back to the process credentials. - + - Gets the current context depth. + Gets or sets the Windows username for this security context - The current context depth. + + The Windows username for this security context + - - The NDC is deprecated and has been replaced by the . - The current NDC implementation forwards to the ThreadContext.Stacks["NDC"]. + This property must be set if + is set to (the default setting). - + + + + + Gets or sets the Windows domain name for this security context + + + The Windows domain name for this security context + + - The number of context values pushed onto the context stack. + The default value for is the local machine name + taken from the property. - Used to record the current depth of the context. This can then - be restored using the method. + This property must be set if + is set to (the default setting). - - + - The log4net Thread Context. + Sets the password for the Windows account specified by the and properties. + + The password for the Windows account specified by the and properties. + - The ThreadContext provides a location for thread specific debugging - information to be stored. - The ThreadContext properties override any - properties with the same name. + This property must be set if + is set to (the default setting). + + + + + Initialize the SecurityContext based on the options set. + + - The thread context has a properties map and a stack. - The properties and stack can - be included in the output of log messages. The - supports selecting and outputting these properties. + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. - The Thread Context provides a diagnostic context for the current thread. - This is an instrument for distinguishing interleaved log - output from different sources. Log output is typically interleaved - when a server handles multiple clients near-simultaneously. + If any of the configuration properties are modified then + must be called again. - The Thread Context is managed on a per thread basis. + The security context will try to Logon the specified user account and + capture a primary token for impersonation. - Example of using the thread context properties to store a username. - - ThreadContext.Properties["user"] = userName; - log.Info("This log message has a ThreadContext Property called 'user'"); - - - Example of how to push a message into the context stack - - using(ThreadContext.Stacks["NDC"].Push("my context message")) - { - log.Info("This log message has a ThreadContext Stack message that includes 'my context message'"); - - } // at the end of the using block the message is automatically popped - - - - Nicko Cadell + The required , + or properties were not specified. - + - Private Constructor. + Impersonate the Windows account specified by the and properties. + caller provided state + + An instance that will revoke the impersonation of this SecurityContext + - Uses a private access modifier to prevent instantiation of this class. + Depending on the property either + impersonate a user using credentials supplied or revert + to the process credentials. - + - The thread context properties instance + Create a given the userName, domainName and password. + the user name + the domain name + the password + the for the account specified + + + Uses the Windows API call LogonUser to get a principal token for the account. This + token is used to initialize the WindowsIdentity. + + - + - The thread context stacks instance + Adds to + + + Helper class to expose the + through the interface. + + - + - The thread properties map + Constructor - - The thread properties map - + the impersonation context being wrapped - The ThreadContext properties override any - properties with the same name. + Constructor - + - The thread stacks + Revert the impersonation - - stack map - - The thread local stacks. + Revert the impersonation