[hg] galaxy 1606: Make logging events a config setting.
details: http://www.bx.psu.edu/hg/galaxy/rev/72252f33edd1 changeset: 1606:72252f33edd1 user: Greg Von Kuster <greg@bx.psu.edu> date: Wed Nov 05 09:28:48 2008 -0500 description: Make logging events a config setting. 3 file(s) affected in this change: lib/galaxy/config.py lib/galaxy/web/framework/__init__.py universe_wsgi.ini.sample diffs (68 lines): diff -r f2e583f7cab9 -r 72252f33edd1 lib/galaxy/config.py --- a/lib/galaxy/config.py Tue Nov 04 16:04:49 2008 -0500 +++ b/lib/galaxy/config.py Wed Nov 05 09:28:48 2008 -0500 @@ -58,6 +58,7 @@ self.use_heartbeat = string_as_bool( kwargs.get( 'use_heartbeat', False ) ) self.use_memdump = string_as_bool( kwargs.get( 'use_memdump', False ) ) self.log_memory_usage = string_as_bool( kwargs.get( 'log_memory_usage', False ) ) + self.log_events = string_as_bool( kwargs.get( 'log_events', False ) ) self.ucsc_display_sites = kwargs.get( 'ucsc_display_sites', "main,test,archaea" ).lower().split(",") self.gbrowse_display_sites = kwargs.get( 'gbrowse_display_sites', "wormbase,flybase,elegans" ).lower().split(",") self.brand = kwargs.get( 'brand', None ) diff -r f2e583f7cab9 -r 72252f33edd1 lib/galaxy/web/framework/__init__.py --- a/lib/galaxy/web/framework/__init__.py Tue Nov 04 16:04:49 2008 -0500 +++ b/lib/galaxy/web/framework/__init__.py Wed Nov 05 09:28:48 2008 -0500 @@ -127,23 +127,24 @@ return self.app.model.context.current def log_event( self, message, tool_id=None, **kwargs ): """ - Application level logging. Still needs fleshing out (log levels and - such) + Application level logging. Still needs fleshing out (log levels and such) + Logging events is a config setting - if False, do not log. """ - event = self.app.model.Event() - event.tool_id = tool_id - try: - event.message = message % kwargs - except: - event.message = message - event.history = self.history - try: - event.history_id = self.history.id - except: - event.history_id = None - event.user = self.user - event.session_id = self.galaxy_session.id - event.flush() + if self.app.config.log_events: + event = self.app.model.Event() + event.tool_id = tool_id + try: + event.message = message % kwargs + except: + event.message = message + event.history = self.history + try: + event.history_id = self.history.id + except: + event.history_id = None + event.user = self.user + event.session_id = self.galaxy_session.id + event.flush() def get_cookie( self, name='galaxysession' ): """Convienience method for getting the galaxysession cookie""" try: diff -r f2e583f7cab9 -r 72252f33edd1 universe_wsgi.ini.sample --- a/universe_wsgi.ini.sample Tue Nov 04 16:04:49 2008 -0500 +++ b/universe_wsgi.ini.sample Wed Nov 05 09:28:48 2008 -0500 @@ -18,6 +18,9 @@ # Log memory usage log_memory_usage = False + +# Log events +log_events = True # Should jobs be tracked through the database, rather than in memory ## track_jobs_in_database = true
participants (1)
-
Greg Von Kuster