Replies: 1 comment
-
There is no way to tell the wrapper to create a folder before a process runs, nor is there an explicit way to restrict where logs go (i.e. EventViewer only). Is there anything stopping you from creating the directory if it doesn't exist whenever the app starts? The app should still be able to start even if there is no folder, unless the app is trying to log a message at that time (like a "starting up..." message). |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
We are using logpath param in the service settings to specify log folder outside of the default daemon/ folder. We're doing it for two reasons:
It seems that the folder specified in the logpath must exist in the system, as winsw will not check/create it if it's not there, so we create it by running the script during initial installation of our app.
Now we are running into the issue where when the service is stopped and the logs folder is manually removed by the user (quite an edge case, but still it can happen), the service fails to start because log folder at the specified path doesn't exist anymore.
Question: is there a way to tell wrapper service to check/create log folder before starting?
The exact error we're getting from the wrapper is: Service cannot be started. System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\ProgramData\my-test-app\logs\mytestapp.wrapper.log'.
Alternatively, is there a way to make wrapper log ONLY to the EventViewer?
Beta Was this translation helpful? Give feedback.
All reactions