Table of Contents

Class LogEventProperty

Namespace
Serilog.Events
Assembly
Serilog.dll

A property associated with a LogEvent.

public class LogEventProperty
Inheritance
LogEventProperty
Inherited Members

Constructors

LogEventProperty(string, LogEventPropertyValue)

Construct a LogEventProperty with the specified name and value.

public LogEventProperty(string name, LogEventPropertyValue value)

Parameters

name string

The name of the property.

value LogEventPropertyValue

The value of the property.

Exceptions

ArgumentNullException

When name is

null
ArgumentException

When name is empty or only contains whitespace

ArgumentNullException

When value is

null

Properties

Name

The name of the property.

public string Name { get; }

Property Value

string

Value

The value of the property.

public LogEventPropertyValue Value { get; }

Property Value

LogEventPropertyValue

Methods

IsValidName(string?)

Test name to determine if it is a valid property name.

public static bool IsValidName(string? name)

Parameters

name string

The name to check.

Returns

bool

true if the name is valid; otherwise, false.