basho/webmachine — pull request #108 by kellymclaughlin (2013-01-04 00:46:44+00:00)
Title: Use an event handler to dispatch log events

Use an event handler to receive and dispatch log events to any handler that are registered. This allows for more multiple handlers to be used simultaneously and allows them to be dynamically added and removed from the application.

The available logging functionality is not affected by this change. *i.e.* There are still the built in modules for access and performance logging. The change is that they are now event handlers instead of server modules.

I have also created a branch of the repo wiki, `klm-dispatch-logging`, that has a new page with details about logging setup and the available logging modules.

For a quick setup to test both the built-in log handlers, add the following to the *app.config* file of an application using Webmachine:

```
{webmachine, [
{log_handlers, [{webmachine_log_handler, ["log"]},
{webmachine_perf_log_handler, ["log"]}]}
]},
```

`"log"` may be replaced with either a relative or absolute path depending on the desired location of the log files.