Permalink
Browse files

Merge remote-tracking branch 'upstream/master'

  • Loading branch information...
2 parents c09d1d8 + 865e662 commit 33bc948ce268b94f7f817cc8815a44e908dbb695 @jgordor jgordor committed Oct 16, 2012
Showing with 12 additions and 7 deletions.
  1. +1 −0 doc-src/api-config.html
  2. +11 −7 src/boss/boss_web_controller.erl
View
1 doc-src/api-config.html
@@ -27,6 +27,7 @@
</ul></li>
<li><code>include_dirs</code> - List of additional directories to be searched for files specified in <code>-include</code> directives.</li>
<li><code>log_dir</code> - Directory in which to keep log files. Location is relative to the project directory. Defaults to "log".</li>
+ <li><code>log_enable</code> - Controls whether ChicagoBoss will generate log files. If this is set to <code>false</code>, log messages will still be sent to Erlang's internal <code>error_logger</code> server and may be handled from there. Defaults to <code>true</code>.</li>
<li><code>mail_driver</code> - The email delivery driver to use. Valid values are:
<ul>
<li><code>boss_mail_driver_smtp</code> - SMTP delivery. If <code>mail_relay</code> is present, it is used as a relay, otherwise direct delivery is attempted.</li>
View
18 src/boss/boss_web_controller.erl
@@ -44,13 +44,17 @@ terminate(_Reason, State) ->
misultin:stop().
init(Config) ->
- LogDir = boss_env:get_env(log_dir, "log"),
- LogFile = make_log_file_name(LogDir),
- ok = filelib:ensure_dir(LogFile),
- error_logger:logfile(close),
- ok = error_logger:logfile({open, LogFile}),
- %ok = error_logger:tty(false),
- ok = make_log_file_symlink(LogFile),
+ case boss_env:get_env(log_enable, true) of
+ false -> ok;
+ true ->
+ LogDir = boss_env:get_env(log_dir, "log"),
+ LogFile = make_log_file_name(LogDir),
+ ok = filelib:ensure_dir(LogFile),
+ error_logger:logfile(close),
+ ok = error_logger:logfile({open, LogFile}),
+ %ok = error_logger:tty(false),
+ ok = make_log_file_symlink(LogFile)
+ end,
Env = boss_env:setup_boss_env(),
error_logger:info_msg("Starting Boss in ~p mode....~n", [Env]),

0 comments on commit 33bc948

Please sign in to comment.