Ejemplo n.º 1
0
        protected void Application_Start(object sender, EventArgs e)
        {
            _logger.TraceMethod(MethodBase.GetCurrentMethod());

            try
            {
                // Set MEF catalog
                AggregateCatalog catalog = new AggregateCatalog();
                catalog.Catalogs.Add(new DirectoryCatalog(HttpRuntime.BinDirectory));

                // Create MEF container
                CompositionContainer container = new CompositionContainer(catalog);

                Host host = Host.Instance;
                // Load types marked by Export attribute
                container.ComposeParts(host);
                host.LoadServices(container);
            }
            catch (Exception ex)
            {
                _logger.Fatal(ex, "Error during Application_Start");
            }
            finally
            {
                _logger.TraceMethodResult(MethodBase.GetCurrentMethod());
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Add fatal log
        /// </summary>
        /// <param name="dto">Client info to logging</param>
        public void Fatal(LogDTO dto)
        {
            string message = PrepareMessage(dto);

            _logger.Fatal(message);
        }