basho/webmachine — pull request #164 by kellymclaughlin (2013-08-15 13:27:22+00:00)
Title: Rework Webmachine error logging to use the built-in log handler

Rework error logging to be more flexible. This changes the default error logging behavior from using the Erlang `error_logger` to using an event-based system that allows for more customization and flexibility for users. The default error logging handler provided (`webmachine_error_log_handler`) writes output directly to a file, but it is straightforward to use this module as a template and create a log handler to output via `error_logger` or `lager` or any other means.

These changes bring error logging in line with how access and performance logging currently work. An advantage of this approach is that it allows error logging to be dynamically added and removed from applications using webmachine. It also allows for multiple error log handlers to be used simultaneously. Finally, it provides the benefit of not explicitly tying error logging to a single mechanism that may not be the best choice for all applications using webmachine.

This PR changes the name of the access log handler module from `webmachine_log_handler` to the more descriptive `webmachine_access_log_handler`. It also updates the demo application to use the new event-based logging in its initialization.