Use environmental values to control some aspects of Mojolicious: This way we can have different settings for different servers running Mojolicious.
Created attachment 42039 [details] [review] Bug 14746: Set up logging and configuration file reading for Mojolicious Use environmental values to control some aspects of Mojolicious: This way we can have different settings for different servers running Mojolicious. %%%% Configuration file %%%% $ENV{MOJO_CONFIG} should be set in the system service (init) starting Mojolicious, eg: export MOJO_CONFIG=/home/koha/kohaclone/api/v1/hypnotoad.conf This configuration file read by the Mojolicious::Plugin::Config http://mojolicio.us/perldoc/Mojolicious/Plugin/Config %%%%% Logging %%%%% >NOTE!! >There is a "feature" in Mojo::Server disabling STDOUT and STDERR, >because such errors are not-suited-for-prod~ >This modification in Mojo::Server disables this and preserves the STD* >handles for forked server threads >in Mojo::Server::daemonize(), comment out the following lines > ># Close filehandles ># open STDOUT, '>/dev/null'; ># open STDERR, '>&STDOUT'; Log to a filename configured in an environemnt variable $ENV{MOJO_LOGFILE} using loglevel $ENV{MOJO_LOGLEVEL}. Defaults to '/tmp/koha-api.log' and loglevel of 'error' Examples: export MOJO_LOGFILE=/home/koha/koha-dev/var/log/kohaapi.mojo.log export MOJO_LOGLEVEL=debug Logging is done by Mojo::Log http://www.mojolicio.us/perldoc/Mojo/Log
Patch complexity is 'Large' because this change has many architectural connections
Patch currently has a conflict in a file, but should not be hard to resolve. How can this be tested? Apply? [(y)es, (n)o, (i)nteractive] y Applying: Bug 14746: Set up logging and configuration file reading for Mojolicious Using index info to reconstruct a base tree... M Koha/REST/V1.pm Falling back to patching base and 3-way merge... Auto-merging Koha/REST/V1.pm CONFLICT (content): Merge conflict in Koha/REST/V1.pm error: Failed to merge in the changes. Patch failed at 0001 Bug 14746: Set up logging and configuration file reading for Mojolicious The copy of the patch that failed is found in: .git/rebase-apply/patch When you have resolved this problem run "git bz apply --continue". If you would prefer to skip this patch, instead run "git bz apply --skip". To restore the original branch and stop patching run "git bz apply --abort". Patch left in /tmp/Bug-14746-Set-up-logging-and-configuration-file-re-pH4w1p.patch
Are there plans to continue with this one?