Menu

#6 Use a proper logging framework

0.0.6
InProgress
None
4
Ulf Lorenz
Refactoring
2018-01-23
2016-07-09
Ulf Lorenz
No

14th Jan, 2017 -- Iteration 1

  1. Add the log4j 2.x libraries
  2. Add a configuration file for the setup (to be specified next). It will essentially direct log output to some directory in the deployment folder (bad and will be removed, but reduces setup for the very first iteration).
  3. Use log4j in some class. Preferably with the slf4j interface
  4. If you feel underemployed, add and use a configuration for the tests that suppresses the log output by default.
  5. If there is still time left: Add some skeleton to test logging output in the tests. (For now, I would say, regexp comparison would be enough)
  6. Configuration - 1 console appender to capture error/warn and 3 file appenders to log error/info/debug in 3 separate files with appropriate roll over numbers.

  1. Introduce a better logging framework
    • consider which logging framework to use: slf4j as frontend, but the backend could be log4j, logback, ...
    • include appropriate libraries
    • create configuration file (for appenders to console and rollover file)
    • Server and Client logs should go to the respective output directories in the user home (see ticket [#62]). Implement the functionality speced in ticket [#62].
    • there should be a policy about how/when/how long to retain log files, which is enforced by the code
    • consider having access to the logged output for testing purposes
  2. Refactor all existing logging code
    • replace all system.out.print-outs with slf4j logger calls
    • remove obsolete Log class (and refactor to use slf4j)
    • Most relevant for now is the server side
  3. Create documentation for proper logger usage
    • how to initialize (private member vs static usage)
    • when to throw a log (avoid log duplication)
    • what to include in the log output (for easier bug analysis and reproduction)
  4. add logging to relevant classes for debugging (optional)

Related

Tickets: #62

Discussion

  • Ulf Lorenz

    Ulf Lorenz - 2016-11-27
    • Milestone: Backlog --> 0.1.1
     
  • Ulf Lorenz

    Ulf Lorenz - 2016-11-30
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -13,3 +13,4 @@
    
         - how to initialize (private member vs static usage)
         - when to throw a log (avoid log duplication)
         - what to include in the log output (for easier bug analysis and reproduction)
    +* add logging to relevant classes for debugging (optional)
    
     
  • Ulf Lorenz

    Ulf Lorenz - 2017-01-14
    • Size [chats]: --> 4
     
  • Ulf Lorenz

    Ulf Lorenz - 2017-05-11
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -9,6 +9,7 @@
    
     * Refactor all existing logging code
         - replace all system.out.print-outs with slf4j logger calls
         - remove obsolete Log class (and refactor to use slf4j)
    +    - Most relevant for now is the server side
     * Create documentation for proper logger usage
         - how to initialize (private member vs static usage)
         - when to throw a log (avoid log duplication)
    
     
  • Ulf Lorenz

    Ulf Lorenz - 2017-09-11
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -5,7 +5,7 @@
    
         - include appropriate libraries
         - create logback configuration file (for appenders - console and rollover file)
         - test for logback compliance
    -    - if server and client are used in same working folder they need to be distinguished in the log file  
    +    - Server and Client logs should go to the respective output directories in the user home (see ticket [#62]
     * Refactor all existing logging code
         - replace all system.out.print-outs with slf4j logger calls
         - remove obsolete Log class (and refactor to use slf4j)
    
     

    Related

    Tickets: #62

  • Ulf Lorenz

    Ulf Lorenz - 2017-09-11
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -5,7 +5,7 @@
    
         - include appropriate libraries
         - create logback configuration file (for appenders - console and rollover file)
         - test for logback compliance
    -    - Server and Client logs should go to the respective output directories in the user home (see ticket [#62]
    +    - Server and Client logs should go to the respective output directories in the user home (see ticket [#62])
     * Refactor all existing logging code
         - replace all system.out.print-outs with slf4j logger calls
         - remove obsolete Log class (and refactor to use slf4j)
    
     

    Related

    Tickets: #62

  • Ulf Lorenz

    Ulf Lorenz - 2017-09-15
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -6,6 +6,7 @@
    
         - create logback configuration file (for appenders - console and rollover file)
         - test for logback compliance
         - Server and Client logs should go to the respective output directories in the user home (see ticket [#62])
    +    - there should be a policy about how/when/how long to retain log files, which is enforced by the code
     * Refactor all existing logging code
         - replace all system.out.print-outs with slf4j logger calls
         - remove obsolete Log class (and refactor to use slf4j)
    
     

    Related

    Tickets: #62

  • Ulf Lorenz

    Ulf Lorenz - 2017-10-29
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -5,7 +5,7 @@
    
         - include appropriate libraries
         - create logback configuration file (for appenders - console and rollover file)
         - test for logback compliance
    -    - Server and Client logs should go to the respective output directories in the user home (see ticket [#62])
    +    - Server and Client logs should go to the respective output directories in the user home (see ticket [#62]). Implement the functionality  speced in ticket [#62].
         - there should be a policy about how/when/how long to retain log files, which is enforced by the code
     * Refactor all existing logging code
         - replace all system.out.print-outs with slf4j logger calls
    
     

    Related

    Tickets: #62

  • Ulf Lorenz

    Ulf Lorenz - 2018-01-14
    • summary: Use logback for logging --> Use a proper logging framework
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,18 +1,16 @@
    -The logback library should replace native java logger. (logback took over where log4j stopped, thats why I have chosen it over log4j).
    -Three subtasks are required:
    -
    -1. Introduce logback. 
    +1. Introduce a better logging framework
    
    +    - consider which logging framework to use: slf4j as frontend, but the backend could be log4j, logback, ...
         - include appropriate libraries
    -    - create logback configuration file (for appenders - console and rollover file)
    -    - test for logback compliance
    +    - create configuration file (for appenders to console and rollover file)
         - Server and Client logs should go to the respective output directories in the user home (see ticket [#62]). Implement the functionality  speced in ticket [#62].
         - there should be a policy about how/when/how long to retain log files, which is enforced by the code
    -* Refactor all existing logging code
    +    - consider having access to the logged output for testing purposes
    +2. Refactor all existing logging code
         - replace all system.out.print-outs with slf4j logger calls
         - remove obsolete Log class (and refactor to use slf4j)
         - Most relevant for now is the server side
    -* Create documentation for proper logger usage
    +3. Create documentation for proper logger usage
         - how to initialize (private member vs static usage)
         - when to throw a log (avoid log duplication)
         - what to include in the log output (for easier bug analysis and reproduction)
    -* add logging to relevant classes for debugging (optional)
    +4. add logging to relevant classes for debugging (optional)
    
    • status: ReadyForDev --> InProgress
    • assigned_to: premkumar bhaskal
    • Owner2: Ulf Lorenz
     

    Related

    Tickets: #62

  • premkumar bhaskal

    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,3 +1,12 @@
    +Iteration 1
    +1. Add the log4j 2.x libraries
    +2. Add a configuration file for the setup (to be specified next). It will essentially direct log output to some directory in the deployment folder (bad and will be removed, but reduces setup for the very first iteration).
    +3. Use log4j in some class. Preferably with the slf4j interface
    +4. If you feel underemployed, add and use a configuration for the tests that suppresses the log output by default.
    +5. If there is still time left: Add some skeleton to test logging output in the tests. (For now, I would say, regexp comparison would be enough)
    +6. Configuration - 1 console appender to capture error/warn and 3 file appenders to log error/info/debug in 3 separate files with appropriate roll over numbers.
    +
    +
    
     1. Introduce a better logging framework
         - consider which logging framework to use: slf4j as frontend, but the backend could be log4j, logback, ...
         - include appropriate libraries
    
     
  • premkumar bhaskal

    Add description for the iteration 1 of the task

     
  • premkumar bhaskal

    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -5,6 +5,11 @@
    
     4. If you feel underemployed, add and use a configuration for the tests that suppresses the log output by default.
     5. If there is still time left: Add some skeleton to test logging output in the tests. (For now, I would say, regexp comparison would be enough)
     6. Configuration - 1 console appender to capture error/warn and 3 file appenders to log error/info/debug in 3 separate files with appropriate roll over numbers.
    +
    +
    +
    +-----
    +
    
    
    
     1. Introduce a better logging framework
    
     
  • premkumar bhaskal

    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,4 +1,4 @@
    -Iteration 1
    +14th Jan, 2017 -- Iteration 1
    
     1. Add the log4j 2.x libraries
     2. Add a configuration file for the setup (to be specified next). It will essentially direct log output to some directory in the deployment folder (bad and will be removed, but reduces setup for the very first iteration).
     3. Use log4j in some class. Preferably with the slf4j interface
    
     

Log in to post a comment.

MongoDB Logo MongoDB