Monday, 12 December 2016

Test log lines

Some times the only thing we are interested in testing is weather a log line correctly gets logged. This is not the most optimal test but sometimes its required... in cases where log lines are getting monitored by a monitoring agent and we want to make sure correct format gets logged etc.

The trick is to mock the Log Appender and then capture the logs on that appender in a safe way. Once these log lines are captured you can verify them to your hearts content....

A fully working example of this is given at: https://github.com/njaiswal/logLineTester

Following snippet shows how to achieve this:

9 comments:

  1. Truly a very good article on how to handle the future technology. After reading your post,thanks for taking the time to discuss this, I feel happy about and I love learning more about this topic
    Isoft Innovations Facebook
    Isoft Innovation Chennai

    ReplyDelete
  2. It's Really A Great Post. Looking For Some More Stuff.



    shriram break free

    ReplyDelete
  3. The post was really very good.Thanks for sharing
    prestige elysian

    ReplyDelete
  4. Information provided by you is very helpful and informative. Keep On updating such information.

    prestige elysian


    ReplyDelete

  5. I really enjoyed your blog Thanks for sharing such an informative post.Looking For Some More Stuff.

    shuttering works

    ReplyDelete
  6. I really enjoyed your blog Thanks for sharing such an informative post.Looking For Some More Stuff.

    best seo company in bangalore SSS digital Marketing

    ReplyDelete