Example #1
0
        public static void Main(string[] args)
        {
            LoggingExtensions.SetServiceName("PrintApi");
            Logger logger = LogManager.GetCurrentClassLogger();

            try
            {
                IHost host = Program.CreateHostBuilder(args).Build();
                host.Run();
            }
            catch (Exception ex)
            {
                logger.Error(ex, "Stopping service because of exception: {0}", ex.Message);
                throw;
            }
            finally
            {
                LogManager.Shutdown();
            }
        }