aspnet/Mvc — pull request #1747 by kichalla (2014-12-30 18:50:11+00:00)
Title: Prototype: Adding logging functional tests

Here I am using ElmLogger to capture log messages as it has functionality already built in to handle scopes etc. I felt that scoping related information is important to us as we might want to verify that too(TestLogger, TestScope pieces did not handle this). ElmLogger has 2 parts, the UI piece which displays the log messages in a user friendly way and the capturing part. Here I am using only the capturing part.

Also these functional tests are using in-memory way of checking the logs messages as I felt it to be easier to verify than creating DTOs, serializing and de-serialzing them. Yeah, this will not enable us to run on a real server scenario, but do we need to for logging related verification tests?

There are couple of issues with ElmLogger because of which the code here looks a bit clunky:
ElmLogger arranges the log information in two separate lists, one for tracking scopes and other for just log messages. Due to this, following are some issues that I encountered:
a. https://github.com/aspnet/Diagnostics/issues/77
b. Sorting by time does not yield correct numbers as I have noticed that the ticks between
the log entries sometimes do not change(probably because the log entries happen pretty fast)
and so the sort can give incorrect order sometimes. Ideally this is an issue with ElmLogger,
where they should maintain a single list of entries to which one can either add a regular message
node or a scope node.

@rynowak @pranavkm @Tratcher