The Autofac logging module is based on this one https://autofaccn.readthedocs.io/en/latest/examples/log4net.html but rather than logging based on the component type, it uses LogManager to get the log by the name provided as the attribute param. ILog exposes
The existing Umbraco Logging service doesn't expose any method for getting/setting the log file, and doesn't appear to have any internals to do so either.
On poking around a bit, if I grab the ILogger property, CanWrite is false (true on ILog property types), so I can't call SetValue on the property to set the logger. At least, that's my read on the situation...
Has anyone done similar or have an alternative solution?
Specify logging output file when injecting ILogger
Scenario is so:
Current ctor implementation looks like the below. Using ILog in place of the update to ILogger works, ILogger results in a null param value:
The Autofac logging module is based on this one https://autofaccn.readthedocs.io/en/latest/examples/log4net.html but rather than logging based on the component type, it uses LogManager to get the log by the name provided as the attribute param. ILog exposes
The existing Umbraco Logging service doesn't expose any method for getting/setting the log file, and doesn't appear to have any internals to do so either.
On poking around a bit, if I grab the ILogger property, CanWrite is false (true on ILog property types), so I can't call SetValue on the property to set the logger. At least, that's my read on the situation...
Has anyone done similar or have an alternative solution?
is working on a reply...
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.