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