mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Merge pull request #1828 from dannon/cherrypick_logging
[16.01] Fix startup logging
This commit is contained in:
+6
-1
@@ -31,6 +31,11 @@ app = None
|
||||
class UniverseApplication( object, config.ConfiguresGalaxyMixin ):
|
||||
"""Encapsulates the state of a Universe application"""
|
||||
def __init__( self, **kwargs ):
|
||||
if not log.handlers:
|
||||
# Paste didn't handle it, so we need a temporary basic log
|
||||
# configured. The handler added here gets dumped and replaced with
|
||||
# an appropriately configured logger in configure_logging below.
|
||||
logging.basicConfig(level=logging.DEBUG)
|
||||
log.debug( "python path is: %s", ", ".join( sys.path ) )
|
||||
self.name = 'galaxy'
|
||||
self.new_installation = False
|
||||
@@ -39,7 +44,7 @@ class UniverseApplication( object, config.ConfiguresGalaxyMixin ):
|
||||
self.config.check()
|
||||
config.configure_logging( self.config )
|
||||
self.configure_fluent_log()
|
||||
|
||||
self.config.reload_sanitize_whitelist(explicit='sanitize_whitelist_file' in kwargs)
|
||||
self.amqp_internal_connection_obj = galaxy.queues.connection_from_config(self.config)
|
||||
# control_worker *can* be initialized with a queue, but here we don't
|
||||
# want to and we'll allow postfork to bind and start it.
|
||||
|
||||
@@ -259,7 +259,6 @@ class Configuration( object ):
|
||||
self.log_events = string_as_bool( kwargs.get( 'log_events', 'False' ) )
|
||||
self.sanitize_all_html = string_as_bool( kwargs.get( 'sanitize_all_html', True ) )
|
||||
self.sanitize_whitelist_file = resolve_path( kwargs.get( 'sanitize_whitelist_file', "config/sanitize_whitelist.txt" ), self.root )
|
||||
self.reload_sanitize_whitelist()
|
||||
self.serve_xss_vulnerable_mimetypes = string_as_bool( kwargs.get( 'serve_xss_vulnerable_mimetypes', False ) )
|
||||
self.trust_ipython_notebook_conversion = string_as_bool( kwargs.get( 'trust_ipython_notebook_conversion', False ) )
|
||||
self.enable_old_display_applications = string_as_bool( kwargs.get( "enable_old_display_applications", "True" ) )
|
||||
@@ -473,7 +472,7 @@ class Configuration( object ):
|
||||
else:
|
||||
return None
|
||||
|
||||
def reload_sanitize_whitelist( self ):
|
||||
def reload_sanitize_whitelist( self, explicit=True ):
|
||||
self.sanitize_whitelist = []
|
||||
try:
|
||||
with open(self.sanitize_whitelist_file, 'rt') as f:
|
||||
@@ -481,7 +480,8 @@ class Configuration( object ):
|
||||
if not line.startswith("#"):
|
||||
self.sanitize_whitelist.append(line.strip())
|
||||
except IOError:
|
||||
log.warning("Sanitize log file %s does not exist, continuing with no tools whitelisted.", self.sanitize_whitelist_file)
|
||||
if explicit:
|
||||
log.warning("Sanitize log file explicitly specified as '%s' but does not exist, continuing with no tools whitelisted.", self.sanitize_whitelist_file)
|
||||
|
||||
def __parse_config_file_options( self, kwargs ):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user