A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/nlog/nlog/wiki/Fluent-Logger-API below:

Fluent Logger API · NLog/NLog Wiki · GitHub

NLog 5.0 introduces new fluent LogEventBuilder that can be activated with one of these extensions methods for ILogger:

To complete the fluent builder then call Log() to capture available callsite information with help from Caller Member Attributes, and then writes the actual LogEvent to any configured NLog targets.

Replaces the old Fluent-namespace and also reduces memory-allocation when LogLevel not enabled.

_logger.ForInfoEvent()
       .Message("This is a fluent message {0}.", "test")
       .Property("PropertyName", "PropertyValue")
       .Log();
Writing Exception Message.
try
{
    string text = File.ReadAllText(path);
}
catch (Exception ex)
{
    _logger.ForExceptionEvent(ex)
           .Message("Error reading file '{0}'.", path)
           .Property("Test", "InfoWrite")
           .Log();
}

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4