log4net cf

Download Log4net CF

If you can't read please download the document

Upload: csaalsalalla

Post on 19-Jan-2016

15 views

Category:

Documents


1 download

DESCRIPTION

cf

TRANSCRIPT

log4net Appender that logs to a database. appends logging events to a table within a database. The appender can be configured to specify the connection string by setting the property. The connection type (provider) can be specified by setting the property. For more information on database connection strings for your specific database see http://www.connectionstrings.com/. Records are written into the database either using a prepared statement or a stored procedure. The property is set to (System.Data.CommandType.Text) to specify a prepared statement or to (System.Data.CommandType.StoredProcedure) to specify a stored procedure. The prepared statement text or the name of the stored procedure must be set in the property. The prepared statement or stored procedure can take a number of parameters. Parameters are added using the method. This adds a single to the ordered list of parameters. The type may be subclassed if required to provide database specific functionality. The specifies the parameter name, database type, size, and how the value should be generated using a . An example of a SQL Server table that could be logged to: CREATE TABLE [dbo].[Log] ( [ID] [int] IDENTITY (1, 1) NOT NULL , [Date] [datetime] NOT NULL , [Thread] [varchar] (255) NOT NULL , [Level] [varchar] (20) NOT NULL , [Logger] [varchar] (255) NOT NULL , [Message] [varchar] (4000) NOT NULL ) ON [PRIMARY] An example configuration to log to the above table: Julian Biddle Nicko Cadell Gert Driesen Lance Nehring 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 Abstract base class implementation of . This class provides the code for common functionality, such as support for threshold filtering and support for general filters. 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 Implement this interface for your own strategies for printing log statements. Implementors should consider extending the class which provides a default implementation of this interface. 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 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. Log the logging event in Appender specific way. The event to log This method is called to log a message into this appender. Gets or sets the name of this appender. The name of the appender. The name uniquely identifies the appender. Interface for appenders that support bulk logging. 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 Log the array of logging events in Appender specific way. The events to log This method is called to log an array of events into this appender. Interface used to delay activate a configured object. 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 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 Activate the options that were previously set with calls to properties. 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. Initial buffer size Maximum buffer size before it is recycled Default constructor Empty default constructor Finalizes this appender by calling the implementation's method. If this appender has not been closed then the Finalize method will call . Initialize the appender based on the options 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 any of the configuration properties are modified then must be called again. Closes the appender and release resources. 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. Performs threshold checks and invokes filters before delegating actual logging to the subclasses specific method. 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. 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. 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 . 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. Clears the filter list for this appender. Clears the filter list for this appender. Checks if the message level is below this appender's threshold. to test against. If there is no threshold set, then the return value is always true. 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. 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. Subclasses of should implement this method to perform actual logging. The event to append. 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. To restrict the logging of events in the appender override the method. Append a bulk array of logging events. the array of logging events This base class implementation calls the method for each element in the bulk array. A sub class that can better process a bulk array of events should override this method in addition to . Called before as a precondition. This method is called by before the call to the abstract method. This method can be overridden in a subclass to extend the checks made before the event is passed to the method. A subclass should ensure that they delegate this call to this base class if it is overridden. true if the call to should proceed. Renders the to a string. The event to render. The event rendered as a string. 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. 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. Renders the to a string. The event to render. The TextWriter to write the formatted event to 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. The layout of this appender. See for more information. The name of this appender. See for more information. The level threshold of this appender. There is no level threshold filtering by default. See for more information. It is assumed and enforced that errorHandler is never null. It is assumed and enforced that errorHandler is never null. See for more information. The first filter in the filter chain. Set to null initially. See for more information. The last filter in the filter chain. See for more information. Flag indicating if this appender is closed. See for more information. The guard prevents an appender from repeatedly calling its own DoAppend method StringWriter used to render events The fully qualified type of the AppenderSkeleton class. Used by the internal logger to record the Type of the log message. Gets or sets the threshold of this appender. The threshold of the appender. All log events with lower level than the threshold level are ignored by the appender. 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 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. Returns the head Filter. The Filters are organized in a linked list and so all Filters on this Appender are available through the result. Gets or sets the for this appender. The layout of the appender. See for more information. Gets or sets the name of this appender. The name of the appender. The name uniquely identifies the appender. Tests if this appender requires a to be set. 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. true if the appender requires a layout object, otherwise false. 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 class. Protected default constructor to allow subclassing. 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. Flush the currently buffered events 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. Flush the currently buffered events set to true to flush the buffer of lossy events 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. Initialize the appender based on the options 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 any of the configuration properties are modified then must be called again. Close this appender instance. 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. 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. Sends the contents of the buffer. The first logging event. The buffer containing the events that need to be send. The subclass must override . Sends the events. The events that need to be send. The subclass must override this method to process the buffered events. The size of the cyclic buffer used to hold the logging events. Set to by default. The cyclic buffer used to store the logging events. The triggering event evaluator that causes the buffer to be sent immediately. 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. 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. If this field is set to true then an must be set. The triggering event evaluator filters discarded events. 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. Value indicating which fields in the event should be fixed By default all fields are fixed The events delivered to the subclass must be fixed. 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. 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. 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. 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. Gets or sets the value of the to use. 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. 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 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. Initializes a new instance of the class. Public default constructor to initialize a new instance of this class. Initialize the appender based on the options 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 any of the configuration properties are modified then must be called again. Override the parent method to close the database Closes the database command and database connection. Inserts the events into the database. The events to insert into the database. Insert all the events specified in the array into the database. Adds a parameter to the command. 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. 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. 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. 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. Resolves the connection string from the ConnectionString, ConnectionStringName, or AppSettingsKey property. 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. Retrieves the class type of the ADO.NET provider. 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 Prepares the database command and initialize the parameters. Connects to the database. Cleanup the existing command. If true, a message will be written using LogLog.Warn if an exception is encountered when calling Dispose. Cleanup the existing connection. Calls the IDbConnection's method. Flag to indicate if we are using a command object Set to true when the appender is to use a prepared statement or stored procedure to insert into the database. The list of objects. The list of objects. The security context to use for privileged calls The that will be used to insert logging events into a database. The database command. 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 use transactions when writing to the database. The fully qualified type of the AdoNetAppender class. 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. 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 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. The type name of the ADO.NET provider to use. The default is to use the OLE DB provider. 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. 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. 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. Gets or sets the command type to execute. 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). Should transactions be used to insert logging events in the database. true if transactions should be used to insert logging events in the database, otherwise false. The default value is true. 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 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. 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. 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. Gets or sets the underlying . The underlying . 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. Parameter type used by the . This class provides the basic database parameter properties as defined by the interface. This type can be subclassed to provide database specific functionality. The two methods that are called externally are and . Initializes a new instance of the class. Default constructor for the AdoNetAppenderParameter class. Prepare the specified database command object. The command to prepare. Prepares the database command object by adding this parameter to its collection of parameters. Renders the logging event and set the parameter value in the command. The command containing the parameter. The event to be rendered. Renders the logging event using this parameters layout object. Sets the value of the parameter on the command object. 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. The scale for this parameter. The size for this parameter. The to use to render the logging event into an object for this parameter. Gets or sets the name of this parameter. The name of this parameter. The name of this parameter. The parameter name must match up to a named parameter to the SQL stored procedure or prepared statement. Gets or sets the database type for this parameter. 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 . This property is optional. If not specified the ADO.NET provider will attempt to infer the type from the value. Gets or sets the precision for this parameter. The precision for this parameter. The maximum number of digits used to represent the Value. This property is optional. If not specified the ADO.NET provider will attempt to infer the precision from the value. Gets or sets the scale for this parameter. The scale for this parameter. The number of decimal places to which Value is resolved. This property is optional. If not specified the ADO.NET provider will attempt to infer the scale from the value. Gets or sets the size for this parameter. The size for this parameter. The maximum size, in bytes, of the data within the column. This property is optional. If not specified the ADO.NET provider will attempt to infer the size from the value. For BLOB data types like VARCHAR(max) it may be impossible to infer the value automatically, use -1 as the size in this case. Gets or sets the to use to render the logging event into an object for this parameter. The used to render the logging event into an object for this parameter. The that renders the value for this parameter. The can be used to adapt any into a for use in the property. Appends logging events to the terminal using ANSI color escape sequences. 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. 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. 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 The to use when writing to the Console standard output stream. The to use when writing to the Console standard output stream. The to use when writing to the Console standard error output stream. The to use when writing to the Console standard error output stream. Ansi code to reset terminal Initializes a new instance of the class. The instance of the class is set up to write to the standard output stream. Add a mapping of level to color The mapping to add Add a mapping to this appender. Each mapping defines the foreground and background colours 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. 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. The enum of possible display attributes The following flags can be combined together to form the ANSI color attributes. text is bright text is dim text is underlined text is blinking Not all terminals support this attribute 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 The output can be in one for the following ANSI colors. color is black color is red color is green color is yellow color is blue color is magenta color is cyan color is white 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. An entry in the This is an abstract base class for types that are stored in the object. Nicko Cadell Default protected constructor Default protected constructor Initialize any options defined on this entry Should be overridden by any classes that need to initialise based on their options 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. Initialize the options for the object Combine the and together and append the attributes. 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 The color attributes for the specified level Required property. The color attributes for the specified level The combined , and suitable for setting the ansi terminal color. A strongly-typed collection of objects. Nicko Cadell Creates a read-only wrapper for a AppenderCollection instance. list to create a readonly wrapper arround An AppenderCollection wrapper that is read-only. An empty readonly static AppenderCollection Initializes a new instance of the AppenderCollection class that is empty and has the default initial capacity. Initializes a new instance of the AppenderCollection class that has the specified initial capacity. 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 AppenderCollection whose elements are copied to the new collection. Initializes a new instance of the AppenderCollection class that contains elements copied from the specified array. The array whose elements are copied to the new list. Initializes a new instance of the AppenderCollection class that contains elements copied from the specified collection. The collection whose elements are copied to the new list. Allow subclasses to avoid our default constructors Copies the entire AppenderCollection to a one-dimensional array. 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. The one-dimensional array to copy to. The zero-based index in at which copying begins. Adds a to the end of the AppenderCollection. The to be added to the end of the AppenderCollection. The index at which the value has been added. Removes all elements from the AppenderCollection. Creates a shallow copy of the . A new with a shallow copy of the collection data. Determines whether a given is in the AppenderCollection. The to check for. true if is found in the AppenderCollection; otherwise, false. 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. 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. 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 AppenderCollection. An for the entire AppenderCollection. Adds the elements of another AppenderCollection to the current AppenderCollection. The AppenderCollection whose elements should be added to the end of the current AppenderCollection. The new of the AppenderCollection. 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. Adds the elements of a collection to the current AppenderCollection. 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. 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). true if access to the ICollection is synchronized (thread-safe); otherwise, false. 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. 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 . Initializes a new instance of the Enumerator class. 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. 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 Initializes a new instance of the class. Default constructor. 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 (). Defaults to %logger This appender requires a to be set. true This appender requires a to be set. The category parameter sent to the Trace method. Defaults to %logger which will use the logger name of the current as the category parameter. Buffers events and then forwards them to attached appenders. 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 Interface for attaching appenders to objects. Interface for attaching, removing and retrieving appenders. Nicko Cadell Gert Driesen Attaches an appender. The appender to add. Add the specified appender. The implementation may choose to allow or deny duplicate appenders. Gets an attached appender with the specified name. 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. Removes all attached appenders. Removes and closes all attached appenders Removes the specified appender from the list of attached appenders. 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. 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. Gets all attached appenders. 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. Initializes a new instance of the class. Default constructor. 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. Send the events. The events that need to be send. Forwards the events to the attached appenders. Adds an to the list of appenders of this instance. 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. The name of the appender to lookup. The appender with the specified name, or null. Get the named appender attached to this buffering appender. Removes all previously added appenders from this appender. This is useful when re-reading configuration information. Removes the specified appender from the list of appenders. 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. 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 Gets the appenders contained in this appender as an . If no appenders can be found, then an is returned. A collection of the appenders in this appender. 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 The to use when writing to the Console standard output stream. The to use when writing to the Console standard output stream. The to use when writing to the Console standard error output stream. The to use when writing to the Console standard error output stream. Initializes a new instance of the class. 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 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 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. 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. 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 The console output stream writer to write to This writer is not thread safe. 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. The enum of possible color values for use with the color mapping method The following flags can be combined together to form the colors. 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. Defines the mapping between a level and the color it should be displayed in. Initialize the options for the object Combine the and together. 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. The combined and suitable for setting the console color. Appends logging events to the console. 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 The to use when writing to the Console standard output stream. The to use when writing to the Console standard output stream. The to use when writing to the Console standard error output stream. The to use when writing to the Console standard error output stream. Initializes a new instance of the class. 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 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 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 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". 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. Appends log events to the system. 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 Initializes a new instance of the . Default constructor. Initializes a new instance of the with a specified layout. The layout to use with this appender. Obsolete constructor. Writes the logging event to the system. The event to log. Writes the logging event to the system. If is true then the is called. Immediate flush means that the underlying writer 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 logs events are not actually written to persistent media if and when the application crashes. The default value is true. 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. 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. This appender requires a to be set. true This appender requires a to be set. Writes events to the system event log. 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: 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 Initializes a new instance of the class. Default constructor. Initializes a new instance of the class with the specified . The to use with this appender. Obsolete constructor. Add a mapping of level to - done by the config