共用方式為


IEnrichmentTagCollector.Add(String, Object) 方法

定義

以索引鍵/值組的形式加入標記。

public:
 void Add(System::String ^ tagName, System::Object ^ tagValue);
public void Add (string tagName, object tagValue);
abstract member Add : string * obj -> unit
Public Sub Add (tagName As String, tagValue As Object)

參數

tagName
String

擴充屬性索引鍵。

tagValue
Object

擴充屬性值。

例外狀況

tagName 為空字串。

tagNametagValuenull

備註

針對記錄擴充, tagValue 會依照下列規則串行化:

  • 數位:在迴圈中辨識和串行化。
  • IDictionary:辨識為 IDictionary<字串、物件> ,並在迴圈中串行化。
  • DateTime:轉換至 ToUniversalTime()之後已辨識並串行化。
  • 所有其他基本類型:依原樣轉換成 String 並串行化。
針對計量擴充,tagValue會使用 ToString() 方法轉換成String格式。

適用於