У меня очень простое консольное приложение. Я добавил Nlog с консольной целью, но я не могу заставить его работать при работе в моно (на окнах и ubuntu). Я пробовал файл цели, и он работает. Что мне не хватает?Целевая консоль Nlog не работает моно?
Код
class Program
{
private static Logger logger = LogManager.GetCurrentClassLogger();
static void Main(string[] args)
{
Type t = Type.GetType("Mono.Runtime");
if (t != null)
Console.WriteLine("You are running with the Mono VM");
else
Console.WriteLine("You are running something else");
Console.WriteLine("Lets go Mono");
logger.Trace("Sample trace message");
logger.Debug("Sample debug message");
logger.Info("Sample informational message");
logger.Warn("Sample warning message");
logger.Error("Sample error message");
logger.Fatal("Sample fatal error message");
}
}
Config
<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<targets async="true">
<target name="console" xsi:type="Console"/>
</targets>
<rules>
<logger name="*" minlevel="Trace" writeTo="console" />
</rules>
</nlog>
пакет Nlog
<package id="NLog" version="4.3.10" targetFramework="net452" />
Работы, как ожидается, в настоящее время. О начале моего первого монопроекта - рад получить доступ к nlog, спасибо – pogorman