mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Set up default logging if running run.sh with --daemon
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user