using System;
using NLog;
class Program
{
static void Main(string[] args)
{
// create a configuration instance
var config = new NLog.Config.LoggingConfiguration();
// create a console logging target
var logConsole = new NLog.Targets.ConsoleTarget();
// create a debug output logging target
var logDebug = new NLog.Targets.OutputDebugStringTarget();
// send logs with levels from Info to Fatal to the console
config.AddRule(NLog.LogLevel.Info, NLog.LogLevel.Fatal, logConsole);
// send logs with levels from Debug to Fatal to the console
config.AddRule(NLog.LogLevel.Debug, NLog.LogLevel.Fatal, logDebug);
// apply the configuration
NLog.LogManager.Configuration = config;
// create a logger
var logger = LogManager.GetCurrentClassLogger();
// logging
logger.Trace("Trace message");
logger.Debug("Debug message");
logger.Info("Info message");
logger.Warn("Warning message");
logger.Error("Error message");
logger.Fatal("Fatal message");
}
}