private static void Tears() { ILogger logger = new Log4NetLoggerFactory(Assembly.GetExecutingAssembly()).Create("tears"); logger.WriteInformation("---------------------------------------------------------------------------"); logger.WriteInformation("Application is down"); logger.WriteInformation("---------------------------------------------------------------------------"); }
private static void Welcome() { ILogger logger = new Log4NetLoggerFactory(Assembly.GetExecutingAssembly()).Create("welcome"); logger.WriteInformation("---------------------------------------------------------------------------"); logger.WriteInformation(" Process PID: " + Process.GetCurrentProcess().Id); logger.WriteInformation(" Entry assembly: " + Assembly.GetEntryAssembly()?.GetName()); logger.WriteInformation(" Executing assembly: " + Assembly.GetExecutingAssembly().GetName()); logger.WriteInformation("Environment command line: " + Environment.CommandLine); logger.WriteInformation(" Application folder: " + Path.GetDirectoryName(new Uri(Assembly.GetExecutingAssembly().CodeBase).LocalPath)); logger.WriteInformation(" Working folder: " + Directory.GetCurrentDirectory()); logger.WriteInformation(" User name: " + WindowsIdentity.GetCurrent().Name); logger.WriteInformation(" Current culture: " + Thread.CurrentThread.CurrentCulture.Name); logger.WriteInformation(" Current UI culture: " + Thread.CurrentThread.CurrentUICulture.Name); logger.WriteInformation(" Log file appender(s): " + Log4NetConfigurator.LogFileAppenders()); logger.WriteInformation("---------------------------------------------------------------------------"); }