Thanks very much for the very useful log forwarding feature.

The queue worker and scheduler ship only their console output: a "running" and "done" line per job. They don't ship the log lines the jobs themselves write.

It would be great if the job logs were forwarded too.

Perhaps this applies to other services as well, eg redis.

Zander van der Meer
Zander van der Meer · · Edited

Logs are now included!

Steve Parks
Steve Parks Item author ·

Thanks for the very speedy addition!

Steve Parks
Steve Parks Item author ·

Following up on this, it seems /etc/entrypoint.d/98-tail-logs.sh starts each tail with stdbuf -o0 tail -F "$1". With no -n, tail begins at the last 10 lines of the file. Files created after boot are only noticed by the 30-second rescan. So whatever a file receives before it's noticed, apart from its last 10 lines, never reaches the log forwarder.

This affects any .log file that first appears while the container is running:

  • laravel.log the first time a container logs;
  • daily-rotated files such as sync-YYYY-MM-DD.log, at midnight;
  • the scheduler's schedule-

These first lines are usually the ones that matter most, because they include the error message.

Would there be any downside to starting the tail at the beginning of the file:

stdbuf -o0 tail -n +1 -F "$1" 2>&1 &

?

I think this is safe for files present at boot too: storage/logs is fresh in a new container, so there's nothing old to replay.

But maybe I'm missing an issue with it?

Expand log forwarding to include services

1 total vote
Quick Actions
Activity
View recent activity and updates
Use arrow keys to navigate