diff --git a/config/galaxy.ini.sample b/config/galaxy.ini.sample index 03c6fa7daf8..3e40455ed55 100644 --- a/config/galaxy.ini.sample +++ b/config/galaxy.ini.sample @@ -656,6 +656,13 @@ nglims_config_file = tool-data/nglims.yaml # log_events and log_actions functionality will eventually be merged. #log_actions = True + +# Fluentd configuration. Various events can be logged to the fluentd instance +# configured below by enabling fluent_log. +#fluent_log = False +#fluent_host = localhost +#fluent_port = 24224 + # Sanitize all HTML tool output. By default, all tool output served as # 'text/html' will be sanitized thoroughly. This can be disabled if you have # special tools that require unaltered output. WARNING: disabling this does diff --git a/lib/galaxy/util/log/fluent_log.py b/lib/galaxy/util/log/fluent_log.py index e1e6224e74a..8e0752e9808 100644 --- a/lib/galaxy/util/log/fluent_log.py +++ b/lib/galaxy/util/log/fluent_log.py @@ -3,6 +3,7 @@ Provides a `TraceLogger` implementation that logs to a fluentd collector """ import threading +import time try: from fluent.sender import FluentSender @@ -34,11 +35,10 @@ class FluentTraceLogger( object ): del self.thread_local.context[key] self.lock.release() - def log( self, label, time=None, **kwargs ): + def log( self, label, event_time=None, **kwargs ): self.lock.acquire() if hasattr( self.thread_local, 'context' ): kwargs.update( self.thread_local.context ) self.lock.release() - if time is None: - time = int( time.time() ) - self.sender.emit_with_time( label, time, kwargs ) + event_time = event_time or time.time() + self.sender.emit_with_time( label, int(event_time), kwargs ) diff --git a/lib/galaxy/webapps/galaxy/api/metrics.py b/lib/galaxy/webapps/galaxy/api/metrics.py index cba0c244fb6..dd6e727339b 100644 --- a/lib/galaxy/webapps/galaxy/api/metrics.py +++ b/lib/galaxy/webapps/galaxy/api/metrics.py @@ -87,7 +87,7 @@ class MetricsController( BaseAPIController ): """ if trans.app.trace_logger: for label, time, kwargs in metrics: - trans.app.trace_logger.log( label, time=int( time ), **kwargs ) + trans.app.trace_logger.log( label, event_time=int( time ), **kwargs ) elif self.debugging: for label, time, kwargs in metrics: log.debug( '%s %s %s', label, time, kwargs ) diff --git a/run_reports.sh b/run_reports.sh index dc24e77f5c5..eb2de06ad97 100755 --- a/run_reports.sh +++ b/run_reports.sh @@ -13,6 +13,13 @@ cd `dirname $0` ./scripts/common_startup.sh --skip-samples +: ${GALAXY_VIRTUAL_ENV:=.venv} + +if [ -d "$GALAXY_VIRTUAL_ENV" ]; +then + . "$GALAXY_VIRTUAL_ENV/bin/activate" +fi + if [ -z "$GALAXY_REPORTS_CONFIG" ]; then if [ -f reports_wsgi.ini ]; then GALAXY_REPORTS_CONFIG=reports_wsgi.ini diff --git a/run_tool_shed.sh b/run_tool_shed.sh index 9f6a0b3eaed..e34002fcc32 100755 --- a/run_tool_shed.sh +++ b/run_tool_shed.sh @@ -4,6 +4,14 @@ cd `dirname $0` ./scripts/common_startup.sh +: ${GALAXY_VIRTUAL_ENV:=.venv} + +if [ -d "$GALAXY_VIRTUAL_ENV" ]; +then + . "$GALAXY_VIRTUAL_ENV/bin/activate" +fi + + tool_shed=`./lib/tool_shed/scripts/bootstrap_tool_shed/parse_run_sh_args.sh $@` args=$@