Hi Dynamicweb,
After spending hours trying to figure out why NLog suddenly stops working, i realize that it is due to the fact that Dynamicweb overrides the NLog.Configuration and that some complex rules in their targets seems to cause issues with what we log.
Now as we use Glimpse.NLog and our own targets as well, we kinda dislike this type of implementation, so we suggest that you implement this using traditional nlog.config instead of hardcoding a overwrite of the file. If you really want to inject rules by code, I suggest you sees how Glimpse.NLog does it.
If other have issues with this as well I made a small notification subscriber, which will let you work with your own logging.
/// <summary> /// NORRIQ currently uses Nlog.config, however, Dynamicweb overwrites everything with their abstraction! /// Lets take the power back to the people and restore the original configuration after Dw does their trickeries! /// </summary> [Subscribe(Dynamicweb.Notifications.Standard.Application.BeforeStart), Subscribe(Dynamicweb.Notifications.Standard.Application.AfterStart)] public class ForceXmlConfigurationNlogNotificationSubscriber : NotificationSubscriber { private static LoggingConfiguration _configuration; public ForceXmlConfigurationNlogNotificationSubscriber() { _configuration = _configuration ?? NLog.LogManager.Configuration; } public override void OnNotify(string notification, NotificationArgs args) { if (string.Equals(notification, Dynamicweb.Notifications.Standard.Application.AfterStart, StringComparison.CurrentCultureIgnoreCase)) { // This line will overwrite of LogManager.Configuration based on Dynamicwebs implementation :/ var forceCurrentLogManager = Dynamicweb.Logging.LogManager.Current; // We will set it back! NLog.LogManager.Configuration = _configuration; } } }