zotonic/zotonic — pull request #568 by amiramix (2013-06-07 15:20:00+00:00)
Title: Update lager + tidy-up logging

There are lots of small changes.

- One of them is updating Lager to the latest version. This involves a change in the configuration and switching to track master.

- The other one, since the configuration changes anyway, is configuring lager to store logs in the "log" folder instead of "sasl" folder. Lager can use sasl back-end but in the current configuration it doesn't, and naming the folder sasl is at least misleading. It may be an artefact from pre-lager times so, since after this commit everyone will need to update their configuration anyway, I figured it may be a good time to fix this.

- Then some of the webmachine logging options that were stuck in the Zotonic configuration file. They might have been sensible when Zotonic was responsible for logging but with lager the configuration became a mess - some logging is set up in webmachine directly (wmtrace), some in Zotonic's default configuration (actual webmachine logging), and some in Lager's application configuration (the actual Zotonic logging). So now there is one place to set up all log folders, which is the "erlang.config.in" (separately for logging coming from webzmachine and lager application in their corresponding sections).

- Set in Zotonic default values for "webmachine_logger_module" and "error_handler" configuration options used by webzmachine but allow overridding those values in webzmachine configuration if needed (instead of allowing to override just one of them like in the old code and instead of configuring one in Zotonic and one in webmachine like in the old code).

- Fixed an issue in z_sites_dispatcher.erl - in the older code the configuration setting was being pulled from application webmachine, which obviously Zotonic doesn't use anymore (using webZmachine instead). At the same time get rid of the "case" statement since zotonic_sup will always set the default value.

A corresponding change in webzmachine will be issued shortly. I hope you like those changes but if not please let me know and I will try convince you :)