static App() { Container = AutoFacConfiguration.RegisterAutoFac(); Log = typeof(App).GetLogger(); AppDomain.CurrentDomain.FirstChanceException += CurrentDomain_FirstChanceException; AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; Log.Info("Starting..."); }
protected override void Configure() { var logPath = LogSetup.GetLogsFolderPath("Logs"); LogSetup.Execute(); var directPath = Path.Combine(logPath, "ChocolateyGui.{Date}.log"); var logConfig = new LoggerConfiguration() .WriteTo.Async(config => config.RollingFile(directPath, retainedFileCountLimit: 10, fileSizeLimitBytes: 150 * 1000 * 1000)) .SetDefaultLevel(); Logger = Log.Logger = logConfig.CreateLogger(); Container = AutoFacConfiguration.RegisterAutoFac(LicensedChocolateyGuiAssemblySimpleName, LicensedGuiAssemblyLocation); }
internal static void Configure() { var logPath = LogSetup.GetLogsFolderPath("Logs"); LogSetup.Execute(); var directPath = Path.Combine(logPath, "ChocolateyGuiCli.{Date}.log"); var logConfig = new LoggerConfiguration() .WriteTo.Sink(new ColouredConsoleSink(), LogEventLevel.Information) .WriteTo.Async(config => config.RollingFile(directPath, retainedFileCountLimit: 10, fileSizeLimitBytes: 150 * 1000 * 1000)) .SetDefaultLevel(); Logger = Log.Logger = logConfig.CreateLogger(); Container = AutoFacConfiguration.RegisterAutoFac(); }
protected override void Configure() { LocalAppDataPath = Path.Combine( Environment.GetFolderPath( Environment.SpecialFolder.LocalApplicationData, Environment.SpecialFolderOption.DoNotVerify), ApplicationName); if (!Directory.Exists(LocalAppDataPath)) { Directory.CreateDirectory(LocalAppDataPath); } AppDataPath = Path.Combine( Environment.GetFolderPath( Environment.SpecialFolder.CommonApplicationData, Environment.SpecialFolderOption.DoNotVerify), ApplicationName); Container = AutoFacConfiguration.RegisterAutoFac(); var logPath = Path.Combine(AppDataPath, "Logs"); if (!Directory.Exists(logPath)) { Directory.CreateDirectory(logPath); } var directPath = Path.Combine(logPath, "ChocolateyGui.{Date}.log"); var logConfig = new LoggerConfiguration() .WriteTo.Async(config => config.LiterateConsole()) .WriteTo.Async(config => config.RollingFile(directPath, retainedFileCountLimit: 10, fileSizeLimitBytes: 150 * 1000 * 1000)) .SetDefaultLevel(); Logger = Log.Logger = logConfig.CreateLogger(); Internationalization.Initialize(); }