Exemplo n.º 1
0
        private static void ConfigureAutoFac()
        {
            var builder = new ContainerBuilder();

            builder.RegisterInstance(ApplicationInsightsAppLogger.GetLogger()).As <IAppLogger>();
            ApplicationContainer = builder.Build();
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            ConfigureAutoFac();
            ConfigureMyApplicationInsights();

            var logger = ApplicationInsightsAppLogger.GetLogger();

            logger.LogDebug("Application Started", "Startup", new { badthing = true }, null);

            Console.WriteLine("Done!");
            Console.ReadLine();
            logger.LogDebug("Application Stopped", "Stopped", null, null);
            logger.Flush();
        }