具有自定义运行时的AppEngine Flexible-记录挑战

问题描述 投票:1回答:0

假设我的自定义运行时使用的容器中包含bash进程。

#snippet
ADD crontab /etc/cron.d/zip-splitter
RUN crontab /etc/cron.d/zip-splitter
RUN chmod 0644 /etc/cron.d/zip-splitter

CMD ["/var/local/zip-splitter/entry.sh"]

在entry.sh中,我有:

#!/bin/bash
#
echo "Starting cron in the background"
cron -f -L 0  &

#
# Respond to liveness & readiness checks from AppEngine
#
echo "Starting gunicorn"
cd /var/local/zip-splitter && gunicorn -b :8080 main:app

现在,我的麻烦在于cron安排的工作。 如何从上述作业中获取stdout / stderr以访问我的GCP控制台日志?

我努力了:

  1. 通过管道stdout和stderr使用Linux“ logger”命令
  2. 将stdout和stderr定向到/ var / log中的容器中的“本地文件”
  3. 使用“ gcloud日志”(无法获得良好的日志行)

提前致谢。

google-app-engine app-engine-flexible gae-module
© www.soinside.com 2019 - 2024. All rights reserved.