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