for-azure icon indicating copy to clipboard operation
for-azure copied to clipboard

Logger-azure should flush its buffers after some timeout

Open sentinelt opened this issue 8 years ago • 0 comments

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

sentinelt avatar Aug 16 '17 12:08 sentinelt