Only create the local log file if the local flag is set

If the local flag was not set, or set to `false`, an empty log file is created and never used.  This pull request fixes that by only creating the file if the local flag is set to `true`.  This helps prevent issues in some deployments where the `log` directory does not exist in Rails applications.