mirror of https://github.com/abpframework/abp
				
				
				
			
			You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							47 lines
						
					
					
						
							1.1 KiB
						
					
					
				
			
		
		
	
	
							47 lines
						
					
					
						
							1.1 KiB
						
					
					
				using System;
 | 
						|
using Microsoft.AspNetCore.Hosting;
 | 
						|
using Microsoft.Extensions.Hosting;
 | 
						|
using Serilog;
 | 
						|
using Serilog.Events;
 | 
						|
 | 
						|
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo;
 | 
						|
 | 
						|
public class Program
 | 
						|
{
 | 
						|
    public static int Main(string[] args)
 | 
						|
    {
 | 
						|
        Log.Logger = new LoggerConfiguration()
 | 
						|
            .MinimumLevel.Debug()
 | 
						|
            .Enrich.FromLogContext()
 | 
						|
            .WriteTo.Async(c => c.File("Logs/logs.txt"))
 | 
						|
            .WriteTo.Async(c => c.Console())
 | 
						|
            .CreateLogger();
 | 
						|
 | 
						|
        try
 | 
						|
        {
 | 
						|
            Log.Information("Starting web host.");
 | 
						|
            CreateHostBuilder(args).Build().Run();
 | 
						|
            return 0;
 | 
						|
        }
 | 
						|
        catch (Exception ex)
 | 
						|
        {
 | 
						|
            Log.Fatal(ex, "Host terminated unexpectedly!");
 | 
						|
            return 1;
 | 
						|
        }
 | 
						|
        finally
 | 
						|
        {
 | 
						|
            Log.CloseAndFlush();
 | 
						|
        }
 | 
						|
    }
 | 
						|
 | 
						|
 | 
						|
    internal static IHostBuilder CreateHostBuilder(string[] args) =>
 | 
						|
        Host.CreateDefaultBuilder(args)
 | 
						|
            .ConfigureWebHostDefaults(webBuilder =>
 | 
						|
            {
 | 
						|
                webBuilder.UseStartup<Startup>();
 | 
						|
            })
 | 
						|
            .UseAutofac()
 | 
						|
            .UseSerilog();
 | 
						|
}
 |