Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Nathan Woulfe 422 posts 1580 karma points MVP 3x c-trib
    Sep 23, 2019 @ 03:52
    Nathan Woulfe
    0

    Set log destination when using ILogger

    I'm updating some old code which used Log4net's ILog as the logging interface, replacing it with Umbraco's ILogger.

    I'm registering ILogger in Autofac:

    builder.Register(c => Logger.CreateWithDefaultLog4NetConfiguration()).As<ILogger>().InstancePerRequest();
    

    Which then exposes methods like _logger.Error

    However, we have several custom log files written to by different processes, and I'd like to continue to do so.

    Is it possible to use the ILogger interface to write to a non-default log?

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies