for-azure
for-azure copied to clipboard
Logger-azure should flush its buffers after some timeout
Logs are sometimes buffered for some time before ending up in the Azure storage account. I did some tests and it looks like docker4x/logger-azure flushes the log buffer only when buffer is full or when some content is buffered for more than 30 seconds but this check is done only when some new logs are coming in. It might then happen that some content in buffer is older than 30 seconds, but because there are no new logs coming in, the check is never performed and so the logs stay in buffer.
I tested this by deploying the following test container and looking when the logs arrive in the storage account. The observed lag was between 5-8 minutes.
FROM bash:4.4.12
COPY start.sh /
CMD ["/start.sh"]
#!/usr/local/bin/bash
count=0
while :; do
echo -n "$((count++)): "
date
sleep 1
if (( count > 20 )); then
sleep 3600
fi
done