Sha256: 9872386513125b12150e3e76be9e4ebfbce4e6b633725961190e31c8d5812cfb

Contents?: true

Size: 541 Bytes

Versions: 3

Compression:

Stored size: 541 Bytes

Contents

using NLog;
using NLog.Targets;
using NLog.Win32.Targets;

class Example
{
    static void Main(string[] args)
    {
        EventLogTarget target = new EventLogTarget();
        target.Source = "My Source";
        target.Log = "Application";
        target.MachineName = ".";
        target.Layout = "${logger}: ${message}";

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

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

Version data entries

3 entries across 3 versions & 1 rubygems

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