Class LogAttributes
Holds attributes to be included in log events recorded by ILogger LoggerExtensions.
Namespace: Neon.Diagnostics
Assembly: Neon.Common.dll
Syntax
public class LogAttributes
Constructors
LogAttributes()
Initializes a new instance of the LogAttributes class.
Declaration
public LogAttributes()
LogAttributes(LogAttributes)
Initializes a new instance of the LogAttributes class by cloning another LogAttributes instance.
Declaration
public LogAttributes(LogAttributes attributes)
Parameters
Type | Name | Description |
---|---|---|
LogAttributes | attributes | Initial attributes to store in the collection. |
LogAttributes(IEnumerable<KeyValuePair<string, object>>)
Initializes a new instance of the LogAttributes class from a attributes enumerable.
Declaration
public LogAttributes(IEnumerable<KeyValuePair<string, object>> attributes)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<KeyValuePair<string, object>> | attributes | Initial attributes to store in the collection. |
Properties
Count
Returns the number of attributes in the collection.
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
int |
Methods
Add(string, bool)
Adds a bool
attribute.
Declaration
public void Add(string key, bool value)
Parameters
Type | Name | Description |
---|---|---|
string | key | Attribute key. |
bool | value | Attribute value. |
Add(string, double)
Adds a double
attribute.
Declaration
public void Add(string key, double value)
Parameters
Type | Name | Description |
---|---|---|
string | key | Attribute key. |
double | value | Attribute value. |
Add(string, long)
Adds a long
attribute.
Declaration
public void Add(string key, long value)
Parameters
Type | Name | Description |
---|---|---|
string | key | Attribute key. |
long | value | Attribute value. |
Add(string, object)
Adds an arbitrary object attribute.
Declaration
public void Add(string key, object value)
Parameters
Type | Name | Description |
---|---|---|
string | key | Attribute key. |
object | value | Attribute value. |
Add(string, string)
Adds a string
attribute.
Declaration
public void Add(string key, string value)
Parameters
Type | Name | Description |
---|---|---|
string | key | Attribute key. |
string | value | Attribute value. |
Clear()
Clears the attributes collection.
Declaration
public void Clear()