The following makes sense: and application that launches an standalone web server alongside to a browser pointing to it. Then the application can hide, perhaps placing an icon in notification area to allow to stop the server. The application may also monitor the server for crashes, backing up logs and restarting the server if needed.
And yes, that same thing will work if you want to access the server from another machine. However, I will throw to you some extra requirements:
- Have it start with the machine. You probably can do it by a script on start or registry configuration.
- Ease deploying new versions. I suggest blue-green deployment (look it up).
- Monitor the activity of the server
Ah activity... you know what? if the server deal with concurrent requests from different clients on different threads, it does not make sense to put all logs in a single file. If you do, you would be introducing synchronization among the threads to access the file, and that will slow it down. So, have a log per thread... which also brings me to: pool your threads. Futhermore, capture exceptions at request level. A broken request should not bring down the server.
Now, your server could open logs files sharing the right to read them, and then to monitor the activity you can open them for read and take statistics of reported exceptions and requests served.
Finally, I would vow for developing a service. I am assuming we are talking of Windows. Instead of doing all that work in the application that monitors the server, have a service monitor the server, then the application just issues commands to the service. You can use an EvenLog
to send the monitor data.
Now, a crash in the application is no problem. There is tie between monitoring the server and any UI. In fact, you can have simple command line application to issue commands to the service, which are useful if you want to write scripts to automate tasks (for example to run from scheduled tasks). If you think that is not useful, ask an IT Admin near you.
Oh, one more thing. Your server can be the service. It can register itself as service, then start itself, and on entry it can check if it is running as service or not. However, that could make blue-green deployment harder, so plan it ahead.