public static void Main(string[] args) { var logs = new List <FileToLog> { new FileToLog(typeof(MainService), "service_main") }; logs.AddRange(DependencyInjection.GetServerLogs()); logs.AddRange(Infrastructure.DependencyInjection.GetInfrastructureLogs()); logs.AddRange(Application.DependencyInjection.GetApplicationLogs()); logs.SetupLogging(AppFileUtils.GetServerLogsPath()); Directory.SetCurrentDirectory(AppDomain.CurrentDomain.BaseDirectory); CreateHostBuilder(args).Build().Run(); }
public void DeleteServerLogsAndPreviews() { DeleteFilesInDirectory(GetPreviewsPath(), DateTime.Now.AddDays(-1)); DeleteFilesInDirectory(AppFileUtils.GetServerLogsPath(), DateTime.Now.AddDays(-3)); }