Fluent API for NLog
Switch branches/tags
Nothing to show
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Libraries - first commit Jun 6, 2012
Source - add call info attributes Sep 28, 2012
.gitattributes - first commit Jun 6, 2012
.gitignore - first commit Jun 6, 2012
Master.proj - first commit Jun 6, 2012
NLog.Fluent.nuspec - first commit Jun 6, 2012
README.md - first commit Jun 6, 2012

README.md

NLog.Fluent

Fluent API for NLog

Examples

Writing info message via fluent API.

_logger.Info()
    .Message("This is a test fluent message '{0}'.", DateTime.Now.Ticks)
    .Property("Test", "InfoWrite")
    .Write();

Writing error message.

try
{
    string text = File.ReadAllText(path);
}
catch (Exception ex)
{
    _logger.Error()
        .Message("Error reading file '{0}'.", path)
        .Exception(ex)
        .Property("Test", "ErrorWrite")
        .Write();
}