Exemple #1
0
        public static void Main(string[] args)
        {
            Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
            Log.Logger = new LoggerConfiguration().WriteTo.Async(a => a.RollingFileAlternate(".\\logs", fileSizeLimitBytes: 1024 * 1024 * 10, outputTemplate: "|L|{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level}] {Message}{NewLine}{Exception}")).CreateLogger();
            AppDomain.CurrentDomain.ProcessExit += (sender, eventArgs) => Shutdown();
            Console.CancelKeyPress += (sender, eventArgs) =>
            {
                Shutdown();
                eventArgs.Cancel = true;
            };

            Thread threadweb = new Thread(() => StartWebServer(args));

            threadweb.Start();

            Log.Information("Starting service");

            LocationService.Init();
            ForecastService.Init();
        }