Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to save python logging output to a persistent file in the Docker host OS filesystem? #19

Open
timg11 opened this issue Jan 12, 2025 · 0 comments

Comments

@timg11
Copy link

timg11 commented Jan 12, 2025

I’m using Blackvue Sync with Docker Desktop under Windows.

I run a script that periodically checks to see if the BlackVue camera is reachable over Wi-Fi, and if it is, I start the docker desktop, run blackvuesync, then close down the desktop like this:

echo "Starting Docker" 
docker desktop start
sleep 15
docker-compose up -d
sleep 2500
docker desktop stop

When it runs, I can see console output from the Python program in the Docker Desktop UI. I can manually copy it to clipboard, but the blackvuesync docker run is normally unattended.
How can I direct that output into a file in the host OS? After docker desktop is closed, I don't find the python logging output in C:\Users\Tim\AppData\Local\Docker\log\host or anywhere else.

Also, how can I detect (from the host) when blackvuesync.py has completed in the container? I'm just using a fixed timer of about 15 minute and then run docker desktop stop. I'm finding that sometimes the program has not completed since the transfer is surprisingly slow (15-30 Mbps over local Wi-Fi) . Is there a Python function I could add at the end of run() that could perform docker desktop stop ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant