I had a bad experience with writing data to sub folders in the bin
folder containing all app DLLs but this was for ASP.NET MVC hosted in IIS. That kind of writing somehow triggered the reloading (or maybe recompiling) the DLLs and caused a hidden slow performance (such as when writing log data for each request). I had to spent hours configuring out the cause and worked it around by putting the logs folder one level upper (to the same level with bin
folder).
Now when working with ASP.NET Core (and especially hosted in docker container), I'm not so sure if that's still the case. Really putting all application data or log files in sub folders is very manageable and convenient for me. It's also easier to configure the paths (using relative paths), the default base path is always the one containing all app DLLs. So we can have a nice directories graph like this:
- dll file 1
- dll file 2
…
+ Logs
- log1
- log2
+ AppData
- …
Especially when hosted in Docker containers, it seems that we should not go up 1 level to save data because all files are put in a folder called app
which is already located in the root level of Linux files system. All the app's files should be put in that folder (as a conventional hint). I understand that the original issue I concern about is caused only by the IIS (no matter ASP.NET or ASP.NET Core), which means it would be fine when hosting the app in Docker containers?