#!/bin/bash

# Copyright 2018 Google Cloud Platform Proxy Authors

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

set -o errexit
set -o nounset

echo "Starting Proxy......"
CONFIGMANAGER=${CONFIGMANAGER:-apiproxy/configmanager}
ENVOY=${ENVOY:-apiproxy/envoy}

# Optional args for Envoy. Example, to set the logging level:
# docker run -e 'ENVOY_ARGS="-l debug"' ...
ENVOY_ARGS=${ENVOY_ARGS:-""}

${CONFIGMANAGER} $@ &
${ENVOY} -c ${BOOTSTRAP_FILE} --disable-hot-restart ${ENVOY_ARGS}

#!/bin/bash

# Copyright 2018 Google Cloud Platform Proxy Authors

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

set -o errexit
set -o nounset

echo "Starting Proxy......"
CONFIGMANAGER=${CONFIGMANAGER:-apiproxy/configmanager}
ENVOY=${ENVOY:-apiproxy/envoy}

# Optional args for Envoy. Example, to set the logging level:
# docker run -e 'ENVOY_ARGS="-l debug"' ...
ENVOY_ARGS=${ENVOY_ARGS:-""}

${CONFIGMANAGER} $@ &
${ENVOY} -c ${BOOTSTRAP_FILE} --disable-hot-restart --log-format '%L%m%d %T.%e %t envoy] [%t][%n]%v' ${ENVOY_ARGS}

Format logs to integrate with Stackdriver Logging
b/138815331: Format logs to integrate with Stackdriver Logging

Output logs in glog format. This allows users to filter by timestamp and severity, and makes logs a lot nicer to read.

https://screenshot.googleplex.com/EuQK6OMYSsN

This change will fix 90% of the formatting issues with logs. I still need to make a change to upstream envoy to address the formatting issues with the other 10% of log lines.

Ref: https://github.com/envoyproxy/envoy/issues/8637

Change-Id: Ic50c4ea3a0a7b289318b4785c93d2fab6c258ffe
