Adobe-Consulting-Services/acs-aem-tools — pull request #80 by chetanmeh (2014-12-03 12:41:04+00:00)
Title: #79 -  Provide query logs as part of explain operation

Following changes have been done

1. `ExplainQueryServlet` now registers a Logback [`TurboFilter`][1] to collect the logs
2. `QueryLogCollector` would check for required MDC key. If found it would enable all logging for
configured set of logger names and keep them in memory
3. Explain call would then collect the logs and pass them back to the UI layer
4. Log pattern and logger name is made configurable

To see the feature in action you would currently need to run with snapshot build of Oak 1.0.9 as its not released yet. Or temporarily change the logic to not check for MDC key and just collect logs for that thread. This would probably capture some extra logs but would still work

TODO

1. How the logs are rendered needs to be fixed. Currently it just dump the logs as bulleted list.
As my UI skills are pretty bad so someone with better understanding need to look into that part
2. The config ui for servlet also exposes the servlet related properties. This is because the `@Servlet`
annottation does not mark such properties as private. A better way might be to directly use
`@Component` and mark such properties as private

[1]: http://sling.apache.org/documentation/development/logging.html#turbofilters-as-osgi-services