Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The DXA logging implementation does not log the class name of the original caller #41

Open
jhorsman opened this issue Feb 2, 2017 · 1 comment

Comments

@jhorsman
Copy link
Contributor

jhorsman commented Feb 2, 2017

When configuring the Log4Net logging to log the type ("Used to output the fully qualified type name of the caller issuing the logging request."), DXA logs all log lines like if they are logged by Sdl.Web.Common.Logging.Log4NetLogger.

For example:
Log4Net config: <conversionPattern value="%date [%thread] %-5level %type - %message%newline" />

Output: 2017-02-02 10:13:59,214 [9] DEBUG Sdl.Web.Common.Logging.Log4NetLogger - Binary with URL '/version.json' is still up to date, no action required

I guess this is caused by the DXA logging implementation not forwarding the the class name of the original caller.

@ngibbonssdl
Copy link

If you're using Unity 5.11.* you can use https://github.com/unitycontainer/log4net.
I had some success with this on a recent project for this exact reason and with this extension I was able to isolate separate log files based on namespace hierarchy as you would expect to in log4net.

Just make sure you're not resolving ILog anywhere as this was an initial issue for me.

If I get a chance I'll try and add it and create a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants