Class JsonLogFormatter
- Namespace
- Microsoft.Practices.EnterpriseLibrary.Logging.Formatters
- Assembly
- Microsoft.Practices.EnterpriseLibrary.Logging.dll
Represents a log formatter that will format a LogEntry in JSON-compliant format.
public class JsonLogFormatter : LogFormatter, ILogFormatter
- Inheritance
-
JsonLogFormatter
- Implements
- Inherited Members
Constructors
JsonLogFormatter()
Initializes a new instance of the JsonLogFormatter class.
public JsonLogFormatter()
JsonLogFormatter(JsonFormatting)
Initializes a new instance of the JsonLogFormatter class with the specified formatting options.
public JsonLogFormatter(JsonFormatting formatting)
Parameters
formatting
JsonFormattingThe formatting options.
Properties
Formatting
Gets or sets the formatting of the written event.
public JsonFormatting Formatting { get; set; }
Property Value
- JsonFormatting
The JsonFormatting value.
Methods
Deserialize<T>(string)
public static T Deserialize<T>(string serializedLogEntry) where T : LogEntry
Parameters
Returns
- T
The LogEntry.
Type Parameters
T
Format(LogEntry)
Formats a log entry and returns a string to be output.
public override string Format(LogEntry log)
Parameters
log
LogEntryThe log entry to format.
Returns
- string
A string that represents the log entry.