diff --git a/charts/deckhand/values.yaml b/charts/deckhand/values.yaml index d4a8e44c..48319e3e 100644 --- a/charts/deckhand/values.yaml +++ b/charts/deckhand/values.yaml @@ -216,7 +216,6 @@ conf: deckhand: DEFAULT: debug: true - log_file: deckhand.log use_stderr: true use_syslog: true database: @@ -232,27 +231,34 @@ conf: policy_dirs: policy.d logging: loggers: - keys: 'root, deckhand' + keys: 'root, deckhand, error' handlers: - keys: 'file, null, syslog' + keys: 'null, stderr, stdout, syslog' formatters: keys: 'simple, context' logger_deckhand: level: DEBUG - handlers: file + handlers: stdout + qualname: deckhand + logger_error: + level: ERROR + handlers: stderr qualname: deckhand logger_root: level: WARNING handlers: null - handler_file: - class: FileHandler - level: DEBUG - args: "('deckhand.log', 'w+')" - formatter: context handler_null: class: 'logging.NullHandler' formatter: context args: '()' + handler_stderr: + class: StreamHandler + args: '(sys.stderr,)' + formatter: context + handler_stdout: + class: StreamHandler + args: '(sys.stdout,)' + formatter: context handler_syslog: class: 'handlers.SysLogHandler' level: ERROR diff --git a/tools/functional-tests.sh b/tools/functional-tests.sh index 5833b7e5..d63e392e 100755 --- a/tools/functional-tests.sh +++ b/tools/functional-tests.sh @@ -75,7 +75,7 @@ function gen_config { # Create a logging config file to dump everything to stdout/stderr. cat < $CONF_DIR/logging.conf [loggers] -keys = root, deckhand +keys = root, deckhand, error [handlers] keys = null, stderr, stdout @@ -88,6 +88,10 @@ level = DEBUG handlers = stdout qualname = deckhand +[logger_error] +level = ERROR +handlers = stderr + [logger_root] level = WARNING handlers = null @@ -118,9 +122,6 @@ EOCONF cat < $CONF_DIR/deckhand.conf [DEFAULT] debug = true -# NOTE: Use the location of this file inside the mounted volume in the -# container. -log_config_append = /etc/deckhand/logging.conf publish_errors = true use_stderr = true # NOTE: allow_anonymous_access allows these functional tests to get around @@ -148,6 +149,12 @@ connection = $DATABASE_URL # auth_type = password EOCONF +# Only set up logging if running Deckhand via uwsgi. The container already has +# values for logging. +if [ -z "$DECKHAND_IMAGE" ]; then + sed '1 a log_config_append = '"$CONF_DIR"'/logging.conf' $CONF_DIR/deckhand.conf +fi + echo $CONF_DIR/deckhand.conf 1>&2 cat $CONF_DIR/deckhand.conf 1>&2 @@ -185,10 +192,8 @@ gen_config gen_paste gen_policy -log_section Starting Deckhand image - if [ -z "$DECKHAND_IMAGE" ]; then - echo "Running Deckhand via uwsgi" + log_section "Running Deckhand via uwsgi" # Set --workers 2, so that concurrency is always tested. uwsgi \ @@ -201,7 +206,7 @@ if [ -z "$DECKHAND_IMAGE" ]; then -L \ --pyargv "--config-file $CONF_DIR/deckhand.conf" &> $STDOUT & else - echo "Running Deckhand via Docker" + log_section "Running Deckhand via Docker" sudo docker run \ --rm \ --net=host \