NLog.Mongo icon indicating copy to clipboard operation
NLog.Mongo copied to clipboard

“field - Specifies a root level document field.” "${var}" In mongodb, not a root field, but a property of a field。

Open supernebula opened this issue 6 years ago • 1 comments

“field - Specifies a root level document field. There can be multiple fields specified.” "${var}" In mongodb, not a root field, but a property of a field。

nlog.config Example: <target name="mongoOperate" xsi:type="Mongo" includeDefaults="false" connectionString="mongodb://127.0.0.1" collectionName="operatelog" databaseName="logging" cappedCollectionSize="26214400"> <field name="Ip" layout="${var:ip}" bsonType="string" /> <field name="Content" layout="${var:original}" bsonType="string" /> <field name="OperatorId" layout="${var:operatorId}" bsonType="string" /> <field name="Operator" layout=" ${var:operator}" bsonType="string" />

supernebula avatar Jun 22 '18 06:06 supernebula

<target name="mongoOperate" xsi:type="Mongo" includeDefaults="false" connectionString="mongodb://127.0.0.1" collectionName="operatelog" databaseName="logging" cappedCollectionSize="26214400"> <field name="OperateType" layout="${var:operateType}" bsonType="int" /> <field name="Ip" layout="${var:ip}" bsonType="string" /> <field name="Content" layout="${var:current}" bsonType="string" /> <field name="OperatorId" layout="${var:operatorId}" bsonType="string" /> <field name="Operator" layout=" ${var:operator}" bsonType="string" /> </target>

supernebula avatar Jun 22 '18 06:06 supernebula