Managed Syslog Server Class Library Reference

SimpleDbWriter Class

Syslog Relay Controller から受け取った SyslogInfo をデータベースに保存します。

For a list of all members of this type, see SimpleDbWriter Members.

System.Object
   SimpleDbWriter

[Visual Basic]
Public Class SimpleDbWriter
Implements ISyslogWriter, IDisposable
[C#]
public class SimpleDbWriter : ISyslogWriter, IDisposable

Remarks

下記のようなスキーマを持つデータベース テーブルに Syslog メッセージを保存します。

列名説明
RecievedTimedatetime 型。
CollectorIdnvarchar 型。 列のサイズは 256 バイト。
LocalInterfaceAddressnvarchar 型。 列のサイズは 40 バイト。
LocalInterfacePortint 型。
RemoteHostnamenvarchar 型。 列のサイズは 256 バイト。
RemoteAddressnvarchar 型。 列のサイズは 40 バイト。
RemotePortint 型。
Facilityint 型。
Severityint 型。
ReceivedTimestampdatetime 型。
Hostnamenvarchar 型。 列のサイズは 64 バイト。
Tagnvarchar 型。 列のサイズは 32 バイト。
Contentnvarchar 型。 列のサイズは 1024 バイト。
Syslog メッセージ保存用データベース テーブル作成SQLステートメント。(SQL Server向け)
CREATE TABLE [SyslogDetails]
            (
              SyslogID              int             IDENTITY(1, 1),
              ReceivedTime          datetime        NOT NULL,
              CollectorId           nvarchar(256)   NOT NULL,
              LocalInterfaceAddress nvarchar(40)    NOT NULL,
              LocalInterfacePort    int             NOT NULL,
              RemoteHostname        nvarchar(256)   NOT NULL,
              RemoteAddress         nvarchar(40)    NOT NULL,
              RemotePort            int             NOT NULL,
              Facility              int             NOT NULL,
              Severity              int             NOT NULL,
              ReceivedTimestamp     datetime        NOT NULL,
              Hostname              nvarchar(64)    NOT NULL,
              Tag                   nvarchar(32)    NULL,
              Content               nvarchar(1024)  NULL,
              
              CONSTRAINT pk_syslogid PRIMARY KEY NONCLUSTERED (SyslogID)
            )

Example

App.config 設定例。

            <db
             connectionString="
                    Provider=SQLOLEDB;
                    Data Source=.;
                    Initial Catalog=tempdb;
                    Integrated Security=SSPI"
             table="##SyslogDetails"
             collectorId="Central Collector"
            />

Requirements

Namespace: Syslog.Collector.Writer

Assembly: mlog_coll (in mlog_coll.dll)

See Also

SimpleDbWriter Members | Syslog.Collector.Writer Namespace