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.
 
 
 
 
 
 

46 lines
1.4 KiB

namespace EnterpriseCoreV3
{
using CounsellorBL;
using log4net;
using log4net.Config;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using System.IO;
using System.Reflection;
public static class Program
{
private readonly static ILog _log = LogManager.GetLogger(typeof(Program));
public static void Main(string[] args)
{
LoadLog4netConfig();
_log.Info("Application Start");
CreateHostBuilder(args).Build().Run();
}
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureServices((hostContext, services) =>
{
services.AddHostedService<LifetimeEventsHostedService>();
})
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
});
private static void LoadLog4netConfig()
{
// Fix Data
// new TestService().Fix();
var repository = LogManager.CreateRepository(
Assembly.GetEntryAssembly(),
typeof(log4net.Repository.Hierarchy.Hierarchy)
);
XmlConfigurator.Configure(repository, new FileInfo("Log4Net.config"));
}
}
}