3 months ago
I have a deployed Node.js application which writes logs into .txt file located in app's directory. Is it possible to read or even write to this file while deploy runtime?
7 Replies
3 months ago
If you wish to read it, I would suggest either creating a method in your application that allows you to read it directly. Alternatively, you can SSH into the container and cat the file.
3 months ago
Note that having a txt file directly in the container will not persist through redeployments.
To fix this, mount a volume to your service.
Yeah that's exact problem I had (it doesn't persist). So I need to read it now without redeploy because there is already some data.
3 months ago
Yes.
3 months ago
As mentioned above, I would suggest mounting a volume to your service so the logs will persist.