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

Better logging #10

Closed
chrissie1 opened this issue Feb 11, 2013 · 8 comments
Closed

Better logging #10

chrissie1 opened this issue Feb 11, 2013 · 8 comments
Labels
Improvement Issues that enhances existing functionality, or adds new features
Milestone

Comments

@chrissie1
Copy link
Contributor

Kick out log4net and use this.log and nlog.

@ghost ghost assigned chrissie1 Feb 11, 2013
@cemrich
Copy link
Contributor

cemrich commented Feb 12, 2013

What's the big difference between these two?

@chrissie1
Copy link
Contributor Author

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.

@cemrich
Copy link
Contributor

cemrich commented Feb 12, 2013

Okay, that's good to know.

@gep13
Copy link
Member

gep13 commented Feb 12, 2013

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?

@chrissie1
Copy link
Contributor Author

No, this.log abstracts it away for you. No need to inject since it is an extension method.

@gep13
Copy link
Member

gep13 commented Feb 12, 2013

Cool, I really need to check out this package :-)

@chrissie1
Copy link
Contributor Author

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>

@gep13
Copy link
Member

gep13 commented Feb 13, 2013

Hold on a minute...

Where are the other 20 odd lines of XML that is normally required?!? :-P

@gep13 gep13 modified the milestones: 0.11.1, 0.11 Mar 5, 2015
@gep13 gep13 added the Improvement Issues that enhances existing functionality, or adds new features label Mar 5, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Improvement Issues that enhances existing functionality, or adds new features
Projects
None yet
Development

No branches or pull requests

3 participants