Set up default logging if running run.sh with --daemon

This commit is contained in:
mvdbeek
2021-04-07 14:39:06 +02:00
parent 2c7b1b4f53
commit d97c6e1e21
2 changed files with 14 additions and 2 deletions
+11 -1
View File
@@ -864,6 +864,7 @@ class GalaxyAppConfiguration(BaseAppConfiguration, CommonConfigurationMixin):
}
log_destination = kwargs.get("log_destination")
galaxy_daemon_log_destination = os.environ.get('GALAXY_DAEMON_LOG')
if log_destination == "stdout":
LOGGING_CONFIG_DEFAULT['handlers']['console'] = {
'class': 'logging.StreamHandler',
@@ -877,9 +878,18 @@ class GalaxyAppConfiguration(BaseAppConfiguration, CommonConfigurationMixin):
'class': 'logging.FileHandler',
'formatter': 'stack',
'level': 'DEBUG',
'filename': kwargs['log_destination'],
'filename': log_destination,
'filters': ['stack']
}
if galaxy_daemon_log_destination:
LOGGING_CONFIG_DEFAULT['handlers']['files'] = {
'class': 'logging.FileHandler',
'formatter': 'stack',
'level': 'DEBUG',
'filename': galaxy_daemon_log_destination,
'filters': ['stack']
}
LOGGING_CONFIG_DEFAULT['root']['handlers'].append('files')
def _configure_dataset_storage(self):
# The default for `file_path` has changed in 20.05; we may need to fall back to the old default
+3 -1
View File
@@ -41,8 +41,9 @@ parse_common_args() {
shift
;;
--daemon|start)
circusd_args="$circusd_args --daemon"
circusd_args="$circusd_args --daemon --log-output $GALAXY_LOG"
gunicorn_args="$gunicorn_args --daemon"
GALAXY_DAEMON_LOG="$GALAXY_LOG"
add_pid_arg=1
add_log_arg=1
# --daemonize2 waits until after the application has loaded
@@ -173,6 +174,7 @@ find_server() {
server_args="$circusctl_args"
else
run_server="circusd"
export GALAXY_DAEMON_LOG=$GALAXY_DAEMON_LOG
server_args="$CIRCUS_CONFIG_FILE $circusd_args"
fi
}