LDD-1
+ SDD-2
+ SDF-1
+ 1
+ 2
+
+ int (*xCreate)(sqlite3 *db, void *pAux,
+ int argc, char *const*argv,
+ sqlite3_vtab **ppVTab,
+ char **pzErr);
+
+ int sqlite3_declare_vtab(sqlite3 *db, const char *zCreateTable)
+
+ CREATE TABLE x(a HIDDEN VARCHAR(12), b INTEGER, c INTEGER Hidden);
+
+ CREATE TABLE generate_series(
+ value,
+ start HIDDEN,
+ stop HIDDEN,
+ step HIDDEN
+ );
+
+ SELECT value FROM generate_series(5,50);
+
+ SELECT value FROM generate_series WHERE start=5 AND stop=50;
+
+ int (*xConnect)(sqlite3*, void *pAux,
+ int argc, char *const*argv,
+ sqlite3_vtab **ppVTab,
+ char **pzErr);
+
+ int (*xBestIndex)(sqlite3_vtab *pVTab, sqlite3_index_info*);
+
+ struct sqlite3_index_info {
+ /* Inputs */
+ const int nConstraint; /* Number of entries in aConstraint */
+ const struct sqlite3_index_constraint {
+ int iColumn; /* Column constrained. -1 for ROWID */
+ unsigned char op; /* Constraint operator */
+ unsigned char usable; /* True if this constraint is usable */
+ int iTermOffset; /* Used internally - xBestIndex should ignore */
+ } *const aConstraint; /* Table of WHERE clause constraints */
+ const int nOrderBy; /* Number of terms in the ORDER BY clause */
+ const struct sqlite3_index_orderby {
+ int iColumn; /* Column number */
+ unsigned char desc; /* True for DESC. False for ASC. */
+ } *const aOrderBy; /* The ORDER BY clause */
+ /* Outputs */
+ struct sqlite3_index_constraint_usage {
+ int argvIndex; /* if >0, constraint is part of argv to xFilter */
+ unsigned char omit; /* Do not code a test for this constraint */
+ } *const aConstraintUsage;
+ int idxNum; /* Number used to identify the index */
+ char *idxStr; /* String, possibly obtained from sqlite3_malloc */
+ int needToFreeIdxStr; /* Free idxStr using sqlite3_free() if true */
+ int orderByConsumed; /* True if output is already ordered */
+ double estimatedCost; /* Estimated cost of using this index */
+ ]]>/* Fields below are only available in SQLite 3.8.2 and later */]]>
+ sqlite3_int64 estimatedRows; /* Estimated number of rows returned */
+ ]]>/* Fields below are only available in SQLite 3.9.0 and later */]]>
+ int idxFlags; /* Mask of SQLITE_INDEX_SCAN_* flags */
+ ]]>/* Fields below are only available in SQLite 3.10.0 and later */]]>
+ sqlite3_uint64 colUsed; /* Input: Mask of columns used by statement */
+ };
+
+ #define SQLITE_INDEX_CONSTRAINT_EQ 2
+ #define SQLITE_INDEX_CONSTRAINT_GT 4
+ #define SQLITE_INDEX_CONSTRAINT_LE 8
+ #define SQLITE_INDEX_CONSTRAINT_LT 16
+ #define SQLITE_INDEX_CONSTRAINT_GE 32
+ #define SQLITE_INDEX_CONSTRAINT_MATCH 64
+ #define SQLITE_INDEX_CONSTRAINT_LIKE 65 /* 3.10.0 and later */
+ #define SQLITE_INDEX_CONSTRAINT_GLOB 66 /* 3.10.0 and later */
+ #define SQLITE_INDEX_CONSTRAINT_REGEXP 67 /* 3.10.0 and later */
+ #define SQLITE_INDEX_CONSTRAINT_NE 68 /* 3.21.0 and later */
+ #define SQLITE_INDEX_CONSTRAINT_ISNOT 69 /* 3.21.0 and later */
+ #define SQLITE_INDEX_CONSTRAINT_ISNOTNULL 70 /* 3.21.0 and later */
+ #define SQLITE_INDEX_CONSTRAINT_ISNULL 71 /* 3.21.0 and later */
+ #define SQLITE_INDEX_CONSTRAINT_IS 72 /* 3.21.0 and later */
+ #define SQLITE_INDEX_CONSTRAINT_FUNCTION 150 /* 3.25.0 and later */
+ #define SQLITE_INDEX_SCAN_UNIQUE 1 /* Scan visits at most 1 row */
+
+ column OP EXPR
+
+ a = 5
+
+ x BETWEEN 10 AND 100 AND 999>y
+
+ x >= 10
+ x <= 100
+ y < 999
+
+ FUNCTION( column, EXPR)
+
+ SELECT * FROM realtab, tablevaluedfunc(realtab.x);
+
+ SELECT * FROM realtab, tablevaluedfunc
+ WHERE tablevaluedfunc.param1 = realtab.x;
+
+ int (*xDisconnect)(sqlite3_vtab *pVTab);
+
+ int (*xDestroy)(sqlite3_vtab *pVTab);
+
+ int (*xOpen)(sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCursor);
+
+ int (*xClose)(sqlite3_vtab_cursor*);
+
+ int (*xFilter)(sqlite3_vtab_cursor*, int idxNum, const char *idxStr,
+ int argc, sqlite3_value **argv);
+
+ int (*xNext)(sqlite3_vtab_cursor*);
+
+ int (*xEof)(sqlite3_vtab_cursor*);
+
+ int (*xColumn)(sqlite3_vtab_cursor*, sqlite3_context*, int N);
+
+ int (*xRowid)(sqlite3_vtab_cursor *pCur, sqlite_int64 *pRowid);
+
+ int (*xUpdate)(
+ sqlite3_vtab *pVTab,
+ int argc,
+ sqlite3_value **argv,
+ sqlite_int64 *pRowid
+ );
+
+ ]]>
+ ]]>]]>argc = 1 ]]> argv[0] ≠ NULL]]>
+ ]]>]]>
+ DELETE: The single row with rowid or PRIMARY KEY equal to argv[0] is deleted.
+ No insert occurs.
+ ]]>]]>]]>argc > 1 ]]> argv[0] = NULL]]>
+ ]]>]]>
+ INSERT: A new row is inserted with column values taken from
+ argv[2] and following. In a rowid virtual table, if argv[1] is an SQL NULL,
+ then a new unique rowid is generated automatically. The argv[1] will be NULL
+ for a WITHOUT ROWID virtual table, in which case the implementation should
+ take the PRIMARY KEY value from the appropriate column in argv[2] and following.
+ ]]>]]>]]>argc > 1 ]]> argv[0] ≠ NULL ]]> argv[0] = argv[1]]]>
+ ]]>]]>
+ UPDATE:
+ The row with rowid or PRIMARY KEY argv[0] is updated with new values
+ in argv[2] and following parameters.
+ ]]>]]>]]>argc > 1 ]]> argv[0] ≠ NULL ]]> argv[0] ≠ argv[1]]]>
+ ]]>]]>
+ UPDATE with rowid or PRIMARY KEY change:
+ The row with rowid or PRIMARY KEY argv[0] is updated with
+ the rowid or PRIMARY KEY in argv[1]
+ and new values in argv[2] and following parameters. This will occur
+ when an SQL statement updates a rowid, as in the statement:
+
+ UPDATE table SET rowid=rowid+1 WHERE ...;
+
+ ]]>]]>
+
+ int (*xBegin)(sqlite3_vtab *pVTab);
+
+ int (*xSync)(sqlite3_vtab *pVTab);
+
+ int (*xCommit)(sqlite3_vtab *pVTab);
+
+ int (*xRollback)(sqlite3_vtab *pVTab);
+
+ int (*xFindFunction)(
+ sqlite3_vtab *pVtab,
+ int nArg,
+ const char *zName,
+ void (**pxFunc)(sqlite3_context*,int,sqlite3_value**),
+ void **ppArg
+ );
+
+ SELECT * FROM geopolytab WHERE geopoly_overlap(_shape, $query_polygon);
+
+ int (*xRename)(sqlite3_vtab *pVtab, const char *zNew);
+
+ int (*xSavepoint)(sqlite3_vtab *pVtab, int);
+ int (*xRelease)(sqlite3_vtab *pVtab, int);
+ int (*xRollbackTo)(sqlite3_vtab *pVtab, int);
+
+ int (*xSavepoint)(sqlite3_vtab *pVtab, int);
+ int (*xRelease)(sqlite3_vtab *pVtab, int);
+ int (*xRollbackTo)(sqlite3_vtab *pVtab, int);
+
+ int (*xSavepoint)(sqlite3_vtab *pVtab, int);
+ int (*xRelease)(sqlite3_vtab *pVtab, int);
+ int (*xRollbackTo)(sqlite3_vtab *pVtab, int);
+
+ (colUsed & ((sqlite3_uint64)1 << (iCol>=63 ? 63 : iCol)))
+
+ public static class Sample
+ {
+ public static void Main()
+ {
+ using (SQLiteConnection connection = new SQLiteConnection(
+ "Data Source=:memory:;"))
+ {
+ connection.Open();
+
+ connection.CreateModule(new SQLiteModuleEnumerable(
+ "sampleModule", new string[] { "one", "two", "three" }));
+
+ using (SQLiteCommand command = connection.CreateCommand())
+ {
+ command.CommandText =
+ "CREATE VIRTUAL TABLE t1 USING sampleModule;";
+
+ command.ExecuteNonQuery();
+ }
+
+ using (SQLiteCommand command = connection.CreateCommand())
+ {
+ command.CommandText = "SELECT * FROM t1;";
+
+ using (SQLiteDataReader dataReader = command.ExecuteReader())
+ {
+ while (dataReader.Read())
+ Console.WriteLine(dataReader[0].ToString());
+ }
+ }
+
+ connection.Close();
+ }
+ }
+ }
+
+
+ CREATE TABLE [dbo].[Log] (
+ [ID] [int] IDENTITY (1, 1) NOT NULL ,
+ [Date] [datetime] NOT NULL ,
+ [Thread] [varchar] (255) NOT NULL ,
+ [Level] [varchar] (20) NOT NULL ,
+ [Logger] [varchar] (255) NOT NULL ,
+ [Message] [varchar] (4000) NOT NULL
+ ) ON [PRIMARY]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ "DSN=MS Access Database;UID=admin;PWD=;SystemDB=C:\data\System.mdw;SafeTransactions = 0;FIL=MS Access;DriverID = 25;DBQ=C:\data\train33.mdb"
+ "Driver={Microsoft Access Driver (*.mdb)};DBQ=C:\Work\cvs_root\log4net-1.2\access.mdb;UID=;PWD=;"
+ "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Work\cvs_root\log4net-1.2\access.mdb;User Id=;Password=;"
+ System.Data.OleDb.OleDbConnection, System.Data, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+ System.Data.SqlClient.SqlConnection, System.Data, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+ 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.
+ 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.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <mapping>
+ <level value="ERROR" />
+ <eventLogEntryType value="Error" />
+ </mapping>
+ <mapping>
+ <level value="DEBUG" />
+ <eventLogEntryType value="Information" />
+ </mapping>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ IPEndPoint remoteEndPoint = new IPEndPoint(IPAddress.Any, 0);
+ UdpClient udpClient;
+ byte[] buffer;
+ string loggingEvent;
+
+ try
+ {
+ udpClient = new UdpClient(8080);
+
+ while(true)
+ {
+ buffer = udpClient.Receive(ref remoteEndPoint);
+ loggingEvent = System.Text.Encoding.Unicode.GetString(buffer);
+ Console.WriteLine(loggingEvent);
+ }
+ }
+ catch(Exception e)
+ {
+ Console.WriteLine(e.ToString());
+ }
+
+
+ Dim remoteEndPoint as IPEndPoint
+ Dim udpClient as UdpClient
+ Dim buffer as Byte()
+ Dim loggingEvent as String
+
+ Try
+ remoteEndPoint = new IPEndPoint(IPAddress.Any, 0)
+ udpClient = new UdpClient(8080)
+
+ While True
+ buffer = udpClient.Receive(ByRef remoteEndPoint)
+ loggingEvent = System.Text.Encoding.Unicode.GetString(buffer)
+ Console.WriteLine(loggingEvent)
+ Wend
+ Catch e As Exception
+ Console.WriteLine(e.ToString())
+ End Try
+
+
+
+
+
+
+
+
+
+ using log4net.Config;
+ using System.IO;
+ using System.Configuration;
+
+ ...
+
+ DOMConfigurator.Configure(new FileInfo(ConfigurationSettings.AppSettings["log4net-config-file"]));
+
+
+
+
+
+
+
+
+
+ using log4net.Config;
+ using System.IO;
+ using System.Configuration;
+
+ ...
+
+ DOMConfigurator.Configure(new FileInfo(ConfigurationSettings.AppSettings["log4net-config-file"]));
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ log4net configuration XML goes here
+
+
+
+
+
+
+
+
+
+ using log4net.Config;
+ using System.IO;
+ using System.Configuration;
+
+ ...
+
+ XmlConfigurator.Configure(new FileInfo(ConfigurationSettings.AppSettings["log4net-config-file"]));
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ using log4net.Config;
+ using System.IO;
+ using System.Configuration;
+
+ ...
+
+ XmlConfigurator.Configure(new FileInfo(ConfigurationSettings.AppSettings["log4net-config-file"]));
+
+
+
+
+
+
+
+
+
+ ILog log = LogManager.GetLogger("application-log");
+
+ log.Info("Application Start");
+ log.Debug("This is a debug message");
+
+ if (log.IsDebugEnabled)
+ {
+ log.Debug("This is another debug message");
+ }
+
+
+ log.Debug("This is entry number: " + i );
+
+
+ if (log.IsDebugEnabled)
+ {
+ log.Debug("This is entry number: " + i );
+ }
+
+
+ private static readonly bool isDebugEnabled = log.IsDebugEnabled;
+
+
+ if (isDebugEnabled)
+ {
+ log.Debug("This is entry number: " + i );
+ }
+
+
+ log.Debug("This is entry number: " + i );
+
+
+ if (log.IsDebugEnabled())
+ {
+ log.Debug("This is entry number: " + i );
+ }
+
+
+ {key1=value1, key2=value2, key3=value3}
+
+
+ {key1=value1, key2=value2, key3=value3}
+
+
+ ILog log = LogManager.GetLogger(typeof(TestApp));
+ log.Debug("Message 1");
+ log.Warn("Message 2");
+
+
+ DEBUG [main]: Message 1
+ WARN [main]: Message 2
+
+ Format modifier | +left justify | +minimum width | +maximum width | +comment | +
---|---|---|---|---|
%20logger | +false | +20 | +none | +
+ |
+
%-20logger | +true | +20 | +none | +
+ |
+
%.30logger | +NA | +none | +30 | +
+ |
+
false | +20 | +30 | +
+ |
+ |
%-20.30logger | +true | +20 | +30 | +
+ |
+
%timestamp [%thread] %level %logger %ndc - %message%newline
+ %-6timestamp [%15.15thread] %-5level %30.30logger %ndc - %message%newline
+
+ StringWriter writer = new StringWriter();
+ Layout.Format(writer, loggingEvent);
+ string formattedEvent = writer.ToString();
+
+
+ DEBUG - Hello world
+
+
+ <?xml version="1.0" ?>
+
+ <!DOCTYPE log4net:events SYSTEM "log4net-events.dtd" [<!ENTITY data SYSTEM "abc">]>
+
+ <log4net:events version="1.2" xmlns:log4net="http://logging.apache.org/log4net/schemas/log4net-events-1.2>
+ &data;
+ </log4net:events>
+
+
+ using log4net.Util;
+
+ ILog log = LogManager.GetLogger("application-log");
+
+ log.InfoExt("Application Start");
+ log.DebugExt("This is a debug message");
+
+
+ using(log4net.LogicalThreadContext.Stacks["NDC"].Push("Stack_Message"))
+ {
+ log.Warn("This should have an ThreadContext Stack message");
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ string s = OptionConverter.SubstituteVariables("Value of key is ${key}.");
+
+
+ string s = OptionConverter.SubstituteVariables("Value of nonExistentKey is [${nonExistentKey}]");
+
+
+ using(log4net.ThreadContext.Stacks["NDC"].Push("Stack_Message"))
+ {
+ log.Warn("This should have an ThreadContext Stack message");
+ }
+
+
+ GlobalContext.Properties["hostname"] = Environment.MachineName;
+
+
+ LogicalThreadContext.Properties["user"] = userName;
+ log.Info("This log message has a LogicalThreadContext Property called 'user'");
+
+
+ using(LogicalThreadContext.Stacks["LDC"].Push("my context message"))
+ {
+ log.Info("This log message has a LogicalThreadContext Stack message that includes 'my context message'");
+
+ } // at the end of the using block the message is automatically popped
+
+
+ ILog log = LogManager.GetLogger("application-log");
+
+ log.Info("Application Start");
+ log.Debug("This is a debug message");
+
+ if (log.IsDebugEnabled)
+ {
+ log.Debug("This is another debug message");
+ }
+
+
+ using(NDC.Push("my context message"))
+ {
+ ... all log calls will have 'my context message' included ...
+
+ } // at the end of the using block the message is automatically removed
+
+
+ using(log4net.NDC.Push("NDC_Message"))
+ {
+ log.Warn("This should have an NDC message");
+ }
+
+
+ var someValue = "ExampleContext"
+ using(log4net.NDC.PushFormat("NDC_Message {0}", someValue))
+ {
+ log.Warn("This should have an NDC message");
+ }
+
+
+ ThreadContext.Properties["user"] = userName;
+ log.Info("This log message has a ThreadContext Property called 'user'");
+
+
+ using(ThreadContext.Stacks["NDC"].Push("my context message"))
+ {
+ log.Info("This log message has a ThreadContext Stack message that includes 'my context message'");
+
+ } // at the end of the using block the message is automatically popped
+
+
+ int (*xCreate)(sqlite3 *db, void *pAux,
+ int argc, char *const*argv,
+ sqlite3_vtab **ppVTab,
+ char **pzErr);
+
+ int sqlite3_declare_vtab(sqlite3 *db, const char *zCreateTable)
+
+ CREATE TABLE x(a HIDDEN VARCHAR(12), b INTEGER, c INTEGER Hidden);
+
+ CREATE TABLE generate_series(
+ value,
+ start HIDDEN,
+ stop HIDDEN,
+ step HIDDEN
+ );
+
+ SELECT value FROM generate_series(5,50);
+
+ SELECT value FROM generate_series WHERE start=5 AND stop=50;
+
+ int (*xConnect)(sqlite3*, void *pAux,
+ int argc, char *const*argv,
+ sqlite3_vtab **ppVTab,
+ char **pzErr);
+
+ int (*xBestIndex)(sqlite3_vtab *pVTab, sqlite3_index_info*);
+
+ struct sqlite3_index_info {
+ /* Inputs */
+ const int nConstraint; /* Number of entries in aConstraint */
+ const struct sqlite3_index_constraint {
+ int iColumn; /* Column constrained. -1 for ROWID */
+ unsigned char op; /* Constraint operator */
+ unsigned char usable; /* True if this constraint is usable */
+ int iTermOffset; /* Used internally - xBestIndex should ignore */
+ } *const aConstraint; /* Table of WHERE clause constraints */
+ const int nOrderBy; /* Number of terms in the ORDER BY clause */
+ const struct sqlite3_index_orderby {
+ int iColumn; /* Column number */
+ unsigned char desc; /* True for DESC. False for ASC. */
+ } *const aOrderBy; /* The ORDER BY clause */
+ /* Outputs */
+ struct sqlite3_index_constraint_usage {
+ int argvIndex; /* if >0, constraint is part of argv to xFilter */
+ unsigned char omit; /* Do not code a test for this constraint */
+ } *const aConstraintUsage;
+ int idxNum; /* Number used to identify the index */
+ char *idxStr; /* String, possibly obtained from sqlite3_malloc */
+ int needToFreeIdxStr; /* Free idxStr using sqlite3_free() if true */
+ int orderByConsumed; /* True if output is already ordered */
+ double estimatedCost; /* Estimated cost of using this index */
+ ]]>/* Fields below are only available in SQLite 3.8.2 and later */]]>
+ sqlite3_int64 estimatedRows; /* Estimated number of rows returned */
+ ]]>/* Fields below are only available in SQLite 3.9.0 and later */]]>
+ int idxFlags; /* Mask of SQLITE_INDEX_SCAN_* flags */
+ ]]>/* Fields below are only available in SQLite 3.10.0 and later */]]>
+ sqlite3_uint64 colUsed; /* Input: Mask of columns used by statement */
+ };
+
+ #define SQLITE_INDEX_CONSTRAINT_EQ 2
+ #define SQLITE_INDEX_CONSTRAINT_GT 4
+ #define SQLITE_INDEX_CONSTRAINT_LE 8
+ #define SQLITE_INDEX_CONSTRAINT_LT 16
+ #define SQLITE_INDEX_CONSTRAINT_GE 32
+ #define SQLITE_INDEX_CONSTRAINT_MATCH 64
+ #define SQLITE_INDEX_CONSTRAINT_LIKE 65 /* 3.10.0 and later */
+ #define SQLITE_INDEX_CONSTRAINT_GLOB 66 /* 3.10.0 and later */
+ #define SQLITE_INDEX_CONSTRAINT_REGEXP 67 /* 3.10.0 and later */
+ #define SQLITE_INDEX_CONSTRAINT_NE 68 /* 3.21.0 and later */
+ #define SQLITE_INDEX_CONSTRAINT_ISNOT 69 /* 3.21.0 and later */
+ #define SQLITE_INDEX_CONSTRAINT_ISNOTNULL 70 /* 3.21.0 and later */
+ #define SQLITE_INDEX_CONSTRAINT_ISNULL 71 /* 3.21.0 and later */
+ #define SQLITE_INDEX_CONSTRAINT_IS 72 /* 3.21.0 and later */
+ #define SQLITE_INDEX_CONSTRAINT_FUNCTION 150 /* 3.25.0 and later */
+ #define SQLITE_INDEX_SCAN_UNIQUE 1 /* Scan visits at most 1 row */
+
+ column OP EXPR
+
+ a = 5
+
+ x BETWEEN 10 AND 100 AND 999>y
+
+ x >= 10
+ x <= 100
+ y < 999
+
+ FUNCTION( column, EXPR)
+
+ SELECT * FROM realtab, tablevaluedfunc(realtab.x);
+
+ SELECT * FROM realtab, tablevaluedfunc
+ WHERE tablevaluedfunc.param1 = realtab.x;
+
+ int (*xDisconnect)(sqlite3_vtab *pVTab);
+
+ int (*xDestroy)(sqlite3_vtab *pVTab);
+
+ int (*xOpen)(sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCursor);
+
+ int (*xClose)(sqlite3_vtab_cursor*);
+
+ int (*xFilter)(sqlite3_vtab_cursor*, int idxNum, const char *idxStr,
+ int argc, sqlite3_value **argv);
+
+ int (*xNext)(sqlite3_vtab_cursor*);
+
+ int (*xEof)(sqlite3_vtab_cursor*);
+
+ int (*xColumn)(sqlite3_vtab_cursor*, sqlite3_context*, int N);
+
+ int (*xRowid)(sqlite3_vtab_cursor *pCur, sqlite_int64 *pRowid);
+
+ int (*xUpdate)(
+ sqlite3_vtab *pVTab,
+ int argc,
+ sqlite3_value **argv,
+ sqlite_int64 *pRowid
+ );
+
+ ]]>
+ ]]>]]>argc = 1 ]]> argv[0] ≠ NULL]]>
+ ]]>]]>
+ DELETE: The single row with rowid or PRIMARY KEY equal to argv[0] is deleted.
+ No insert occurs.
+ ]]>]]>]]>argc > 1 ]]> argv[0] = NULL]]>
+ ]]>]]>
+ INSERT: A new row is inserted with column values taken from
+ argv[2] and following. In a rowid virtual table, if argv[1] is an SQL NULL,
+ then a new unique rowid is generated automatically. The argv[1] will be NULL
+ for a WITHOUT ROWID virtual table, in which case the implementation should
+ take the PRIMARY KEY value from the appropriate column in argv[2] and following.
+ ]]>]]>]]>argc > 1 ]]> argv[0] ≠ NULL ]]> argv[0] = argv[1]]]>
+ ]]>]]>
+ UPDATE:
+ The row with rowid or PRIMARY KEY argv[0] is updated with new values
+ in argv[2] and following parameters.
+ ]]>]]>]]>argc > 1 ]]> argv[0] ≠ NULL ]]> argv[0] ≠ argv[1]]]>
+ ]]>]]>
+ UPDATE with rowid or PRIMARY KEY change:
+ The row with rowid or PRIMARY KEY argv[0] is updated with
+ the rowid or PRIMARY KEY in argv[1]
+ and new values in argv[2] and following parameters. This will occur
+ when an SQL statement updates a rowid, as in the statement:
+
+ UPDATE table SET rowid=rowid+1 WHERE ...;
+
+ ]]>]]>
+
+ int (*xBegin)(sqlite3_vtab *pVTab);
+
+ int (*xSync)(sqlite3_vtab *pVTab);
+
+ int (*xCommit)(sqlite3_vtab *pVTab);
+
+ int (*xRollback)(sqlite3_vtab *pVTab);
+
+ int (*xFindFunction)(
+ sqlite3_vtab *pVtab,
+ int nArg,
+ const char *zName,
+ void (**pxFunc)(sqlite3_context*,int,sqlite3_value**),
+ void **ppArg
+ );
+
+ SELECT * FROM geopolytab WHERE geopoly_overlap(_shape, $query_polygon);
+
+ int (*xRename)(sqlite3_vtab *pVtab, const char *zNew);
+
+ int (*xSavepoint)(sqlite3_vtab *pVtab, int);
+ int (*xRelease)(sqlite3_vtab *pVtab, int);
+ int (*xRollbackTo)(sqlite3_vtab *pVtab, int);
+
+ int (*xSavepoint)(sqlite3_vtab *pVtab, int);
+ int (*xRelease)(sqlite3_vtab *pVtab, int);
+ int (*xRollbackTo)(sqlite3_vtab *pVtab, int);
+
+ int (*xSavepoint)(sqlite3_vtab *pVtab, int);
+ int (*xRelease)(sqlite3_vtab *pVtab, int);
+ int (*xRollbackTo)(sqlite3_vtab *pVtab, int);
+
+ (colUsed & ((sqlite3_uint64)1 << (iCol>=63 ? 63 : iCol)))
+
+ public static class Sample
+ {
+ public static void Main()
+ {
+ using (SQLiteConnection connection = new SQLiteConnection(
+ "Data Source=:memory:;"))
+ {
+ connection.Open();
+
+ connection.CreateModule(new SQLiteModuleEnumerable(
+ "sampleModule", new string[] { "one", "two", "three" }));
+
+ using (SQLiteCommand command = connection.CreateCommand())
+ {
+ command.CommandText =
+ "CREATE VIRTUAL TABLE t1 USING sampleModule;";
+
+ command.ExecuteNonQuery();
+ }
+
+ using (SQLiteCommand command = connection.CreateCommand())
+ {
+ command.CommandText = "SELECT * FROM t1;";
+
+ using (SQLiteDataReader dataReader = command.ExecuteReader())
+ {
+ while (dataReader.Read())
+ Console.WriteLine(dataReader[0].ToString());
+ }
+ }
+
+ connection.Close();
+ }
+ }
+ }
+
+
+ CREATE TABLE [dbo].[Log] (
+ [ID] [int] IDENTITY (1, 1) NOT NULL ,
+ [Date] [datetime] NOT NULL ,
+ [Thread] [varchar] (255) NOT NULL ,
+ [Level] [varchar] (20) NOT NULL ,
+ [Logger] [varchar] (255) NOT NULL ,
+ [Message] [varchar] (4000) NOT NULL
+ ) ON [PRIMARY]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ "DSN=MS Access Database;UID=admin;PWD=;SystemDB=C:\data\System.mdw;SafeTransactions = 0;FIL=MS Access;DriverID = 25;DBQ=C:\data\train33.mdb"
+ "Driver={Microsoft Access Driver (*.mdb)};DBQ=C:\Work\cvs_root\log4net-1.2\access.mdb;UID=;PWD=;"
+ "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Work\cvs_root\log4net-1.2\access.mdb;User Id=;Password=;"
+ System.Data.OleDb.OleDbConnection, System.Data, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+ System.Data.SqlClient.SqlConnection, System.Data, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+ 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.
+ 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.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <mapping>
+ <level value="ERROR" />
+ <eventLogEntryType value="Error" />
+ </mapping>
+ <mapping>
+ <level value="DEBUG" />
+ <eventLogEntryType value="Information" />
+ </mapping>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ IPEndPoint remoteEndPoint = new IPEndPoint(IPAddress.Any, 0);
+ UdpClient udpClient;
+ byte[] buffer;
+ string loggingEvent;
+
+ try
+ {
+ udpClient = new UdpClient(8080);
+
+ while(true)
+ {
+ buffer = udpClient.Receive(ref remoteEndPoint);
+ loggingEvent = System.Text.Encoding.Unicode.GetString(buffer);
+ Console.WriteLine(loggingEvent);
+ }
+ }
+ catch(Exception e)
+ {
+ Console.WriteLine(e.ToString());
+ }
+
+
+ Dim remoteEndPoint as IPEndPoint
+ Dim udpClient as UdpClient
+ Dim buffer as Byte()
+ Dim loggingEvent as String
+
+ Try
+ remoteEndPoint = new IPEndPoint(IPAddress.Any, 0)
+ udpClient = new UdpClient(8080)
+
+ While True
+ buffer = udpClient.Receive(ByRef remoteEndPoint)
+ loggingEvent = System.Text.Encoding.Unicode.GetString(buffer)
+ Console.WriteLine(loggingEvent)
+ Wend
+ Catch e As Exception
+ Console.WriteLine(e.ToString())
+ End Try
+
+
+
+
+
+
+
+
+
+ using log4net.Config;
+ using System.IO;
+ using System.Configuration;
+
+ ...
+
+ DOMConfigurator.Configure(new FileInfo(ConfigurationSettings.AppSettings["log4net-config-file"]));
+
+
+
+
+
+
+
+
+
+ using log4net.Config;
+ using System.IO;
+ using System.Configuration;
+
+ ...
+
+ DOMConfigurator.Configure(new FileInfo(ConfigurationSettings.AppSettings["log4net-config-file"]));
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ log4net configuration XML goes here
+
+
+
+
+
+
+
+
+
+ using log4net.Config;
+ using System.IO;
+ using System.Configuration;
+
+ ...
+
+ XmlConfigurator.Configure(new FileInfo(ConfigurationSettings.AppSettings["log4net-config-file"]));
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ using log4net.Config;
+ using System.IO;
+ using System.Configuration;
+
+ ...
+
+ XmlConfigurator.Configure(new FileInfo(ConfigurationSettings.AppSettings["log4net-config-file"]));
+
+
+
+
+
+
+
+
+
+ ILog log = LogManager.GetLogger("application-log");
+
+ log.Info("Application Start");
+ log.Debug("This is a debug message");
+
+ if (log.IsDebugEnabled)
+ {
+ log.Debug("This is another debug message");
+ }
+
+
+ log.Debug("This is entry number: " + i );
+
+
+ if (log.IsDebugEnabled)
+ {
+ log.Debug("This is entry number: " + i );
+ }
+
+
+ private static readonly bool isDebugEnabled = log.IsDebugEnabled;
+
+
+ if (isDebugEnabled)
+ {
+ log.Debug("This is entry number: " + i );
+ }
+
+
+ log.Debug("This is entry number: " + i );
+
+
+ if (log.IsDebugEnabled())
+ {
+ log.Debug("This is entry number: " + i );
+ }
+
+
+ {key1=value1, key2=value2, key3=value3}
+
+
+ {key1=value1, key2=value2, key3=value3}
+
+
+ ILog log = LogManager.GetLogger(typeof(TestApp));
+ log.Debug("Message 1");
+ log.Warn("Message 2");
+
+
+ DEBUG [main]: Message 1
+ WARN [main]: Message 2
+
+ Format modifier | +left justify | +minimum width | +maximum width | +comment | +
---|---|---|---|---|
%20logger | +false | +20 | +none | +
+ |
+
%-20logger | +true | +20 | +none | +
+ |
+
%.30logger | +NA | +none | +30 | +
+ |
+
false | +20 | +30 | +
+ |
+ |
%-20.30logger | +true | +20 | +30 | +
+ |
+
%timestamp [%thread] %level %logger %ndc - %message%newline
+ %-6timestamp [%15.15thread] %-5level %30.30logger %ndc - %message%newline
+
+ StringWriter writer = new StringWriter();
+ Layout.Format(writer, loggingEvent);
+ string formattedEvent = writer.ToString();
+
+
+ DEBUG - Hello world
+
+
+ <?xml version="1.0" ?>
+
+ <!DOCTYPE log4net:events SYSTEM "log4net-events.dtd" [<!ENTITY data SYSTEM "abc">]>
+
+ <log4net:events version="1.2" xmlns:log4net="http://logging.apache.org/log4net/schemas/log4net-events-1.2>
+ &data;
+ </log4net:events>
+
+
+ using log4net.Util;
+
+ ILog log = LogManager.GetLogger("application-log");
+
+ log.InfoExt("Application Start");
+ log.DebugExt("This is a debug message");
+
+
+ using(log4net.LogicalThreadContext.Stacks["NDC"].Push("Stack_Message"))
+ {
+ log.Warn("This should have an ThreadContext Stack message");
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ string s = OptionConverter.SubstituteVariables("Value of key is ${key}.");
+
+
+ string s = OptionConverter.SubstituteVariables("Value of nonExistentKey is [${nonExistentKey}]");
+
+
+ using(log4net.ThreadContext.Stacks["NDC"].Push("Stack_Message"))
+ {
+ log.Warn("This should have an ThreadContext Stack message");
+ }
+
+
+ GlobalContext.Properties["hostname"] = Environment.MachineName;
+
+
+ LogicalThreadContext.Properties["user"] = userName;
+ log.Info("This log message has a LogicalThreadContext Property called 'user'");
+
+
+ using(LogicalThreadContext.Stacks["LDC"].Push("my context message"))
+ {
+ log.Info("This log message has a LogicalThreadContext Stack message that includes 'my context message'");
+
+ } // at the end of the using block the message is automatically popped
+
+
+ ILog log = LogManager.GetLogger("application-log");
+
+ log.Info("Application Start");
+ log.Debug("This is a debug message");
+
+ if (log.IsDebugEnabled)
+ {
+ log.Debug("This is another debug message");
+ }
+
+
+ using(NDC.Push("my context message"))
+ {
+ ... all log calls will have 'my context message' included ...
+
+ } // at the end of the using block the message is automatically removed
+
+
+ using(log4net.NDC.Push("NDC_Message"))
+ {
+ log.Warn("This should have an NDC message");
+ }
+
+
+ var someValue = "ExampleContext"
+ using(log4net.NDC.PushFormat("NDC_Message {0}", someValue))
+ {
+ log.Warn("This should have an NDC message");
+ }
+
+
+ ThreadContext.Properties["user"] = userName;
+ log.Info("This log message has a ThreadContext Property called 'user'");
+
+
+ using(ThreadContext.Stacks["NDC"].Push("my context message"))
+ {
+ log.Info("This log message has a ThreadContext Stack message that includes 'my context message'");
+
+ } // at the end of the using block the message is automatically popped
+
+ LDD-1(Excel)
+ SAA-2(Access)
+ SAA-3(SQLite)
+
+ int (*xCreate)(sqlite3 *db, void *pAux,
+ int argc, char *const*argv,
+ sqlite3_vtab **ppVTab,
+ char **pzErr);
+
+ int sqlite3_declare_vtab(sqlite3 *db, const char *zCreateTable)
+
+ CREATE TABLE x(a HIDDEN VARCHAR(12), b INTEGER, c INTEGER Hidden);
+
+ CREATE TABLE generate_series(
+ value,
+ start HIDDEN,
+ stop HIDDEN,
+ step HIDDEN
+ );
+
+ SELECT value FROM generate_series(5,50);
+
+ SELECT value FROM generate_series WHERE start=5 AND stop=50;
+
+ int (*xConnect)(sqlite3*, void *pAux,
+ int argc, char *const*argv,
+ sqlite3_vtab **ppVTab,
+ char **pzErr);
+
+ int (*xBestIndex)(sqlite3_vtab *pVTab, sqlite3_index_info*);
+
+ struct sqlite3_index_info {
+ /* Inputs */
+ const int nConstraint; /* Number of entries in aConstraint */
+ const struct sqlite3_index_constraint {
+ int iColumn; /* Column constrained. -1 for ROWID */
+ unsigned char op; /* Constraint operator */
+ unsigned char usable; /* True if this constraint is usable */
+ int iTermOffset; /* Used internally - xBestIndex should ignore */
+ } *const aConstraint; /* Table of WHERE clause constraints */
+ const int nOrderBy; /* Number of terms in the ORDER BY clause */
+ const struct sqlite3_index_orderby {
+ int iColumn; /* Column number */
+ unsigned char desc; /* True for DESC. False for ASC. */
+ } *const aOrderBy; /* The ORDER BY clause */
+ /* Outputs */
+ struct sqlite3_index_constraint_usage {
+ int argvIndex; /* if >0, constraint is part of argv to xFilter */
+ unsigned char omit; /* Do not code a test for this constraint */
+ } *const aConstraintUsage;
+ int idxNum; /* Number used to identify the index */
+ char *idxStr; /* String, possibly obtained from sqlite3_malloc */
+ int needToFreeIdxStr; /* Free idxStr using sqlite3_free() if true */
+ int orderByConsumed; /* True if output is already ordered */
+ double estimatedCost; /* Estimated cost of using this index */
+ ]]>/* Fields below are only available in SQLite 3.8.2 and later */]]>
+ sqlite3_int64 estimatedRows; /* Estimated number of rows returned */
+ ]]>/* Fields below are only available in SQLite 3.9.0 and later */]]>
+ int idxFlags; /* Mask of SQLITE_INDEX_SCAN_* flags */
+ ]]>/* Fields below are only available in SQLite 3.10.0 and later */]]>
+ sqlite3_uint64 colUsed; /* Input: Mask of columns used by statement */
+ };
+
+ #define SQLITE_INDEX_CONSTRAINT_EQ 2
+ #define SQLITE_INDEX_CONSTRAINT_GT 4
+ #define SQLITE_INDEX_CONSTRAINT_LE 8
+ #define SQLITE_INDEX_CONSTRAINT_LT 16
+ #define SQLITE_INDEX_CONSTRAINT_GE 32
+ #define SQLITE_INDEX_CONSTRAINT_MATCH 64
+ #define SQLITE_INDEX_CONSTRAINT_LIKE 65 /* 3.10.0 and later */
+ #define SQLITE_INDEX_CONSTRAINT_GLOB 66 /* 3.10.0 and later */
+ #define SQLITE_INDEX_CONSTRAINT_REGEXP 67 /* 3.10.0 and later */
+ #define SQLITE_INDEX_CONSTRAINT_NE 68 /* 3.21.0 and later */
+ #define SQLITE_INDEX_CONSTRAINT_ISNOT 69 /* 3.21.0 and later */
+ #define SQLITE_INDEX_CONSTRAINT_ISNOTNULL 70 /* 3.21.0 and later */
+ #define SQLITE_INDEX_CONSTRAINT_ISNULL 71 /* 3.21.0 and later */
+ #define SQLITE_INDEX_CONSTRAINT_IS 72 /* 3.21.0 and later */
+ #define SQLITE_INDEX_CONSTRAINT_FUNCTION 150 /* 3.25.0 and later */
+ #define SQLITE_INDEX_SCAN_UNIQUE 1 /* Scan visits at most 1 row */
+
+ column OP EXPR
+
+ a = 5
+
+ x BETWEEN 10 AND 100 AND 999>y
+
+ x >= 10
+ x <= 100
+ y < 999
+
+ FUNCTION( column, EXPR)
+
+ SELECT * FROM realtab, tablevaluedfunc(realtab.x);
+
+ SELECT * FROM realtab, tablevaluedfunc
+ WHERE tablevaluedfunc.param1 = realtab.x;
+
+ int (*xDisconnect)(sqlite3_vtab *pVTab);
+
+ int (*xDestroy)(sqlite3_vtab *pVTab);
+
+ int (*xOpen)(sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCursor);
+
+ int (*xClose)(sqlite3_vtab_cursor*);
+
+ int (*xFilter)(sqlite3_vtab_cursor*, int idxNum, const char *idxStr,
+ int argc, sqlite3_value **argv);
+
+ int (*xNext)(sqlite3_vtab_cursor*);
+
+ int (*xEof)(sqlite3_vtab_cursor*);
+
+ int (*xColumn)(sqlite3_vtab_cursor*, sqlite3_context*, int N);
+
+ int (*xRowid)(sqlite3_vtab_cursor *pCur, sqlite_int64 *pRowid);
+
+ int (*xUpdate)(
+ sqlite3_vtab *pVTab,
+ int argc,
+ sqlite3_value **argv,
+ sqlite_int64 *pRowid
+ );
+
+ ]]>
+ ]]>]]>argc = 1 ]]> argv[0] ≠ NULL]]>
+ ]]>]]>
+ DELETE: The single row with rowid or PRIMARY KEY equal to argv[0] is deleted.
+ No insert occurs.
+ ]]>]]>]]>argc > 1 ]]> argv[0] = NULL]]>
+ ]]>]]>
+ INSERT: A new row is inserted with column values taken from
+ argv[2] and following. In a rowid virtual table, if argv[1] is an SQL NULL,
+ then a new unique rowid is generated automatically. The argv[1] will be NULL
+ for a WITHOUT ROWID virtual table, in which case the implementation should
+ take the PRIMARY KEY value from the appropriate column in argv[2] and following.
+ ]]>]]>]]>argc > 1 ]]> argv[0] ≠ NULL ]]> argv[0] = argv[1]]]>
+ ]]>]]>
+ UPDATE:
+ The row with rowid or PRIMARY KEY argv[0] is updated with new values
+ in argv[2] and following parameters.
+ ]]>]]>]]>argc > 1 ]]> argv[0] ≠ NULL ]]> argv[0] ≠ argv[1]]]>
+ ]]>]]>
+ UPDATE with rowid or PRIMARY KEY change:
+ The row with rowid or PRIMARY KEY argv[0] is updated with
+ the rowid or PRIMARY KEY in argv[1]
+ and new values in argv[2] and following parameters. This will occur
+ when an SQL statement updates a rowid, as in the statement:
+
+ UPDATE table SET rowid=rowid+1 WHERE ...;
+
+ ]]>]]>
+
+ int (*xBegin)(sqlite3_vtab *pVTab);
+
+ int (*xSync)(sqlite3_vtab *pVTab);
+
+ int (*xCommit)(sqlite3_vtab *pVTab);
+
+ int (*xRollback)(sqlite3_vtab *pVTab);
+
+ int (*xFindFunction)(
+ sqlite3_vtab *pVtab,
+ int nArg,
+ const char *zName,
+ void (**pxFunc)(sqlite3_context*,int,sqlite3_value**),
+ void **ppArg
+ );
+
+ SELECT * FROM geopolytab WHERE geopoly_overlap(_shape, $query_polygon);
+
+ int (*xRename)(sqlite3_vtab *pVtab, const char *zNew);
+
+ int (*xSavepoint)(sqlite3_vtab *pVtab, int);
+ int (*xRelease)(sqlite3_vtab *pVtab, int);
+ int (*xRollbackTo)(sqlite3_vtab *pVtab, int);
+
+ int (*xSavepoint)(sqlite3_vtab *pVtab, int);
+ int (*xRelease)(sqlite3_vtab *pVtab, int);
+ int (*xRollbackTo)(sqlite3_vtab *pVtab, int);
+
+ int (*xSavepoint)(sqlite3_vtab *pVtab, int);
+ int (*xRelease)(sqlite3_vtab *pVtab, int);
+ int (*xRollbackTo)(sqlite3_vtab *pVtab, int);
+
+ (colUsed & ((sqlite3_uint64)1 << (iCol>=63 ? 63 : iCol)))
+
+ public static class Sample
+ {
+ public static void Main()
+ {
+ using (SQLiteConnection connection = new SQLiteConnection(
+ "Data Source=:memory:;"))
+ {
+ connection.Open();
+
+ connection.CreateModule(new SQLiteModuleEnumerable(
+ "sampleModule", new string[] { "one", "two", "three" }));
+
+ using (SQLiteCommand command = connection.CreateCommand())
+ {
+ command.CommandText =
+ "CREATE VIRTUAL TABLE t1 USING sampleModule;";
+
+ command.ExecuteNonQuery();
+ }
+
+ using (SQLiteCommand command = connection.CreateCommand())
+ {
+ command.CommandText = "SELECT * FROM t1;";
+
+ using (SQLiteDataReader dataReader = command.ExecuteReader())
+ {
+ while (dataReader.Read())
+ Console.WriteLine(dataReader[0].ToString());
+ }
+ }
+
+ connection.Close();
+ }
+ }
+ }
+
+
+ CREATE TABLE [dbo].[Log] (
+ [ID] [int] IDENTITY (1, 1) NOT NULL ,
+ [Date] [datetime] NOT NULL ,
+ [Thread] [varchar] (255) NOT NULL ,
+ [Level] [varchar] (20) NOT NULL ,
+ [Logger] [varchar] (255) NOT NULL ,
+ [Message] [varchar] (4000) NOT NULL
+ ) ON [PRIMARY]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ "DSN=MS Access Database;UID=admin;PWD=;SystemDB=C:\data\System.mdw;SafeTransactions = 0;FIL=MS Access;DriverID = 25;DBQ=C:\data\train33.mdb"
+ "Driver={Microsoft Access Driver (*.mdb)};DBQ=C:\Work\cvs_root\log4net-1.2\access.mdb;UID=;PWD=;"
+ "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Work\cvs_root\log4net-1.2\access.mdb;User Id=;Password=;"
+ System.Data.OleDb.OleDbConnection, System.Data, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+ System.Data.SqlClient.SqlConnection, System.Data, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+ 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.
+ 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.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <mapping>
+ <level value="ERROR" />
+ <eventLogEntryType value="Error" />
+ </mapping>
+ <mapping>
+ <level value="DEBUG" />
+ <eventLogEntryType value="Information" />
+ </mapping>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ IPEndPoint remoteEndPoint = new IPEndPoint(IPAddress.Any, 0);
+ UdpClient udpClient;
+ byte[] buffer;
+ string loggingEvent;
+
+ try
+ {
+ udpClient = new UdpClient(8080);
+
+ while(true)
+ {
+ buffer = udpClient.Receive(ref remoteEndPoint);
+ loggingEvent = System.Text.Encoding.Unicode.GetString(buffer);
+ Console.WriteLine(loggingEvent);
+ }
+ }
+ catch(Exception e)
+ {
+ Console.WriteLine(e.ToString());
+ }
+
+
+ Dim remoteEndPoint as IPEndPoint
+ Dim udpClient as UdpClient
+ Dim buffer as Byte()
+ Dim loggingEvent as String
+
+ Try
+ remoteEndPoint = new IPEndPoint(IPAddress.Any, 0)
+ udpClient = new UdpClient(8080)
+
+ While True
+ buffer = udpClient.Receive(ByRef remoteEndPoint)
+ loggingEvent = System.Text.Encoding.Unicode.GetString(buffer)
+ Console.WriteLine(loggingEvent)
+ Wend
+ Catch e As Exception
+ Console.WriteLine(e.ToString())
+ End Try
+
+
+
+
+
+
+
+
+
+ using log4net.Config;
+ using System.IO;
+ using System.Configuration;
+
+ ...
+
+ DOMConfigurator.Configure(new FileInfo(ConfigurationSettings.AppSettings["log4net-config-file"]));
+
+
+
+
+
+
+
+
+
+ using log4net.Config;
+ using System.IO;
+ using System.Configuration;
+
+ ...
+
+ DOMConfigurator.Configure(new FileInfo(ConfigurationSettings.AppSettings["log4net-config-file"]));
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ log4net configuration XML goes here
+
+
+
+
+
+
+
+
+
+ using log4net.Config;
+ using System.IO;
+ using System.Configuration;
+
+ ...
+
+ XmlConfigurator.Configure(new FileInfo(ConfigurationSettings.AppSettings["log4net-config-file"]));
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ using log4net.Config;
+ using System.IO;
+ using System.Configuration;
+
+ ...
+
+ XmlConfigurator.Configure(new FileInfo(ConfigurationSettings.AppSettings["log4net-config-file"]));
+
+
+
+
+
+
+
+
+
+ ILog log = LogManager.GetLogger("application-log");
+
+ log.Info("Application Start");
+ log.Debug("This is a debug message");
+
+ if (log.IsDebugEnabled)
+ {
+ log.Debug("This is another debug message");
+ }
+
+
+ log.Debug("This is entry number: " + i );
+
+
+ if (log.IsDebugEnabled)
+ {
+ log.Debug("This is entry number: " + i );
+ }
+
+
+ private static readonly bool isDebugEnabled = log.IsDebugEnabled;
+
+
+ if (isDebugEnabled)
+ {
+ log.Debug("This is entry number: " + i );
+ }
+
+
+ log.Debug("This is entry number: " + i );
+
+
+ if (log.IsDebugEnabled())
+ {
+ log.Debug("This is entry number: " + i );
+ }
+
+
+ {key1=value1, key2=value2, key3=value3}
+
+
+ {key1=value1, key2=value2, key3=value3}
+
+
+ ILog log = LogManager.GetLogger(typeof(TestApp));
+ log.Debug("Message 1");
+ log.Warn("Message 2");
+
+
+ DEBUG [main]: Message 1
+ WARN [main]: Message 2
+
+ Format modifier | +left justify | +minimum width | +maximum width | +comment | +
---|---|---|---|---|
%20logger | +false | +20 | +none | +
+ |
+
%-20logger | +true | +20 | +none | +
+ |
+
%.30logger | +NA | +none | +30 | +
+ |
+
false | +20 | +30 | +
+ |
+ |
%-20.30logger | +true | +20 | +30 | +
+ |
+
%timestamp [%thread] %level %logger %ndc - %message%newline
+ %-6timestamp [%15.15thread] %-5level %30.30logger %ndc - %message%newline
+
+ StringWriter writer = new StringWriter();
+ Layout.Format(writer, loggingEvent);
+ string formattedEvent = writer.ToString();
+
+
+ DEBUG - Hello world
+
+
+ <?xml version="1.0" ?>
+
+ <!DOCTYPE log4net:events SYSTEM "log4net-events.dtd" [<!ENTITY data SYSTEM "abc">]>
+
+ <log4net:events version="1.2" xmlns:log4net="http://logging.apache.org/log4net/schemas/log4net-events-1.2>
+ &data;
+ </log4net:events>
+
+
+ using log4net.Util;
+
+ ILog log = LogManager.GetLogger("application-log");
+
+ log.InfoExt("Application Start");
+ log.DebugExt("This is a debug message");
+
+
+ using(log4net.LogicalThreadContext.Stacks["NDC"].Push("Stack_Message"))
+ {
+ log.Warn("This should have an ThreadContext Stack message");
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ string s = OptionConverter.SubstituteVariables("Value of key is ${key}.");
+
+
+ string s = OptionConverter.SubstituteVariables("Value of nonExistentKey is [${nonExistentKey}]");
+
+
+ using(log4net.ThreadContext.Stacks["NDC"].Push("Stack_Message"))
+ {
+ log.Warn("This should have an ThreadContext Stack message");
+ }
+
+
+ GlobalContext.Properties["hostname"] = Environment.MachineName;
+
+
+ LogicalThreadContext.Properties["user"] = userName;
+ log.Info("This log message has a LogicalThreadContext Property called 'user'");
+
+
+ using(LogicalThreadContext.Stacks["LDC"].Push("my context message"))
+ {
+ log.Info("This log message has a LogicalThreadContext Stack message that includes 'my context message'");
+
+ } // at the end of the using block the message is automatically popped
+
+
+ ILog log = LogManager.GetLogger("application-log");
+
+ log.Info("Application Start");
+ log.Debug("This is a debug message");
+
+ if (log.IsDebugEnabled)
+ {
+ log.Debug("This is another debug message");
+ }
+
+
+ using(NDC.Push("my context message"))
+ {
+ ... all log calls will have 'my context message' included ...
+
+ } // at the end of the using block the message is automatically removed
+
+
+ using(log4net.NDC.Push("NDC_Message"))
+ {
+ log.Warn("This should have an NDC message");
+ }
+
+
+ var someValue = "ExampleContext"
+ using(log4net.NDC.PushFormat("NDC_Message {0}", someValue))
+ {
+ log.Warn("This should have an NDC message");
+ }
+
+
+ ThreadContext.Properties["user"] = userName;
+ log.Info("This log message has a ThreadContext Property called 'user'");
+
+
+ using(ThreadContext.Stacks["NDC"].Push("my context message"))
+ {
+ log.Info("This log message has a ThreadContext Stack message that includes 'my context message'");
+
+ } // at the end of the using block the message is automatically popped
+
+