Sha256: 18ea6f69dd93d4667e62a314ffab2e1298e4024288b9ca624b6c7b286c0e5246

Contents?: true

Size: 619 Bytes

Versions: 3

Compression:

Stored size: 619 Bytes

Contents

using System;

using NLog;
using NLog.Targets;

class Example
{
    static void Main(string[] args)
    {
        DebugTarget target = new DebugTarget();
        target.Layout = "${message}";

        NLog.Config.SimpleConfigurator.ConfigureForTargetLogging(target, LogLevel.Debug);

        Logger logger = LogManager.GetLogger("Example");
        logger.Debug("log message");
        logger.Debug("another log message");

        Console.WriteLine("The debug target has been hit {0} times.", target.Counter);
        Console.WriteLine("The last message was '{0}'.", target.LastMessage);
    }
}

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
nlog-1.0.0.505.20100822 docs/examples/targets/Configuration API/Debug/Simple/Example.cs
nlog-1.0.0.505 docs/examples/targets/Configuration API/Debug/Simple/Example.cs
nlog-1.0.0.505-mswin32 docs/examples/targets/Configuration API/Debug/Simple/Example.cs