Skip to content

Contrastive behavior of NLogIntegration against NLogs #418

@devop228

Description

@devop228

An "FileNotFound" exception was thrown when I used NLogIntegration without nlog.config:

var logFactory = new NLogFactory();
var log = logFactory.Create("castle.log.Program");
log.Info("Hello world!");

The behavior is in contrast to NLogs. The code below will not throw exception even without nlog.config:

var log = NLog.LogManager.GetCurrentClassLogger();
log.Info("Hello world!");

Even though there is a workaround by creating factory with new NLogFactory(true), but I could not found it anywhere in the documentation. This behavior also propagates to LoggingFacility in Windsor.

I suggest to change the default behavior to matching NLogs as Castle's logging is just a wrapper around NLog and should not change its default behavior, or alternatively to update the documentation highlighting the different.

The version I used:

  • netcoreapp2.1
  • Castle.Core 4.3.1
  • Castle.Core-NLog 4.3.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions