I’m trying to containerize a windows application that uses Nlog for logging. The app writes to file targets. Here is part of the nlog.config for the application. Please note the fileName parameter. That resolves to C:\Users\Public\Documents\xxxxxxxx\xxxxxxxx\Logs on the local hard drive.
What I want to know is how to specify the file path for a containerized application in my nlog.config. I have a docker compose yml file that defines volumes. I have a decent understanding of how volumes work. But, I don’t know what to put in my nlog.config for the fileName parameter. I would like to write to the app_data volume.
The mount point which is on the left side of the colon in the volume mapping definition. But I don’t think Windows containers would have /var/logs that is a Linux path and you already shared the path would be
C:\Users\Public\Documents\xxxxxxxx\xxxxxxxx\Logs
so that is what you need to configure in anything that runs in the container and that is where you need to mount the volume.
Yeah, the Postgres image is most likely based on a Linux image.
I also have a task to create a windows container but then run the Postgres windows installer within the container. That will be interesting too and probably a little bit easier for me.