Once you have set all required configurations of your server, there are 2 useful events to know when server has started and when has stopped.
This event is fired when server has started and can process new connections.
void OnStartup()
{
Console.WriteLine("#server started");
}
This event is fired after server has stopped and no more connections are accepted.
void OnStartup()
{
Console.OnShutdown("#server stopped");
}