-
Notifications
You must be signed in to change notification settings - Fork 252
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
Better logging #10
Comments
What's the big difference between these two? |
Log4net had been dead for a few years, while nlog is being actively developed. Lately log4net has come back alive but the signed their assemblies and made a mess of the versioning. This.log is an easy way to include logging in your code since it no longer needs you to add private ILog log = ... to every class. You can just do this.Log.Debug("...") and it will pick the classname from that. |
Okay, that's good to know. |
Thinking about this, and having not looked too closely at the code yet, do we need to abstract this into an interface, and then use the IoC Container to provide a specific instance on the interface, rather than taking a direct dependency on a specific logging framework? |
No, this.log abstracts it away for you. No need to inject since it is an extension method. |
Cool, I really need to check out this package :-) |
This is my current nlog config for rollingfileappender. <nlog>
<targets>
<target name="file" type="File" fileName="${basedir}/logs/chocolateygui_${level}.log" layout="${longdate} ${threadid} [${level:uppercase=true}] ${logger} ${message}" archiveFileName="${basedir}/logs/chocolateygui_${level}.{#}.log" archiveAboveSize="1048576" archiveNumbering="Sequence" maxArchiveFiles="10" concurrentWrites="true" keepFileOpen="false" encoding="iso-8859-2" />
</targets>
<rules>
<logger name="*" minlevel="Debug" writeTo="file" />
</rules>
</nlog> |
Hold on a minute... Where are the other 20 odd lines of XML that is normally required?!? :-P |
Kick out log4net and use this.log and nlog.
The text was updated successfully, but these errors were encountered: