logback for logging

Issue #169 resolved
Benjamin Cordes created an issue

logback offers a lot of advanced logging utility over java.util.log, and better performance.

http://logback.qos.ch

Comments (9)

  1. Benjamin Cordes reporter

    Logging with Logback is implemented in feature/169_gradle_log

    I've added an example under Test.

    If we have this setup up we can move the codebase to Logback. It allows of finer control, concatenation of loggers etc. I will port the codebase when you're ready.

  2. Desrever Nu

    Well done.

    Can you bring to my attention some practical use of this vs. what we are doing now?

    The tests you wrote looks very much like the logs we are using now.

    LOG.info("testing logger. should appear on console and in the defined log file");
    

    Currently we can control each different level of logging separately (FINE, INFO, WARNING,SEVERE) and we have a csv and HTML output which has been fine tuned to the bot needs. example : http://i.imgur.com/hkd1VCU.png

    These logs files are used as input by other tools and I am very keen in changing it now breaking the "contract".

    Will logback still be able to produce the very same output its producing now?

  3. Benjamin Cordes reporter

    Re: breaking. Yes - I will have to do some extensive testing to assure that. But shouldn't be difficult. Just need to get more familiar with the complete software, which hopefully should be the case at the end of the week.

    I'd say each logger in the code stays the same (Log.info), so indeed the code does not change. What we can introduce are filters and layouts - logback offers more, but I think those are the basic logging functions we can use it for. So the logback.xml defines console output and fileoutput. The output details from which class the log came from. I'm already using this with my streaming feature. So I wanted to know from which line of code the output came from, and that can be done very simply with changing the xml (one example of many).

    These are the two sections of the manual, explaining these features. Perhaps logrotation is another feature. Because every big java project uses this, over plain util, I don't think there is much that can go wrong with the approach. It's widely documented etc.

  4. Log in to comment