private static void WaitForProcess() { while (WowProcess.Get() == null) { Log.Information("Unable to find the Wow process is it running ?"); Thread.Sleep(1000); } }
public Startup(IConfiguration configuration) { Configuration = configuration; var logfile = "out.log"; var config = new LoggerConfiguration() //.Enrich.FromLogContext() .MinimumLevel.Information() .MinimumLevel.Override("Microsoft", LogEventLevel.Information) .WriteTo.File(logfile, rollingInterval: RollingInterval.Day) .WriteTo.Debug(outputTemplate: "[{Timestamp:HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}") .WriteTo.Console(outputTemplate: "[{Timestamp:HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}"); Log.Logger = config.CreateLogger(); Log.Logger.Information("Startup()"); while (WowProcess.Get() == null) { Log.Information("Unable to find the Wow process is it running ?"); Thread.Sleep(1000); } }