jldupont
jldupont

Reputation: 96836

AppEngine Flexible with custom runtime - logging challenge

Let's say my custom runtime uses a container with a bash process in it.

#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"]

In entry.sh I have:

#!/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

Now the trouble I am having lies with the jobs scheduled by cron. How do I get stdout/stderr from said jobs to reach my GCP console logs ?

I have tried:

  1. using the Linux "logger" command by piping stdout & stderr
  2. directing stdout & stderr to "local files" in the container in /var/log
  3. using "gcloud logs" (couldn't get nice log lines)

Thanks in advance.

Upvotes: 1

Views: 134

Answers (0)

Related Questions