internal static void InitCoreLoggers()
{
if (LogManager.Configuration == null) {
LogManager.Configuration = new LoggingConfiguration();
} else {
// User provided custom NLog config, but we still need to define our own logger
IsUsingCustomConfiguration = true;
if (LogManager.Configuration.AllTargets.Any(target => target is MessageBoxTarget)) {
return;
}
}
MessageBoxTarget messageBoxTarget = new MessageBoxTarget {
Name = "MessageBox",
Layout = GeneralLayout
};
LogManager.Configuration.AddTarget(messageBoxTarget);
LogManager.Configuration.LoggingRules.Add(new LoggingRule("*", LogLevel.Fatal, messageBoxTarget));
LogManager.ReconfigExistingLoggers();
}