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:
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:
Thank You For Sharing Such A Nice Post.
ReplyDeleteBest Web Designing Training in Bangalore
Best Oracle Training in Bangalore
Thank You For Sharing Such A Nice Post.
ReplyDeleteBest Oracle Training in Bangalore
It's A Nice post.
ReplyDeleteDigital Marketing Training Institute With Placement Assistance
It's Really A Great Post. Looking For Some More Stuff.
ReplyDeleteshriram break free
ReplyDeleteI really enjoyed your blog Thanks for sharing such an informative post.Looking For Some More Stuff.
shuttering works
Informative post thanx for sharing such a nice content.
ReplyDelete3 BHK Flats for sale in Patancheru