Ejemplo n.º 1
0
        static void target_write(Event ev)
        {
            Fwk.Logging.Targets.XmlTarget target = new Logging.Targets.XmlTarget();
            target.FileName = String.Concat(Fwk.HelperFunctions.DateFunctions.Get_Year_Mont_Day_String(DateTime.Now, '-'), "_", "DispatcherErrorsLog.xml");

            target.Write(ev);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Log error from dispatcher on xml File
        /// </summary>
        /// <param name="ex"></param>
        internal static TechnicalException LogDispatcherErrorConfig(Exception ex)
        {
            StringBuilder s = new StringBuilder("Se ha intentado levantar el despachador de servicios.");
            s.AppendLine("Verifique que esten correctamente configurados en el .config los AppSettings.");
            s.AppendLine("ServiceDispatcherName y ServiceDispatcherConnection");
            if (ex != null)
            {
                s.AppendLine("..................................");
                s.AppendLine("Error Interno:");
                s.AppendLine(Fwk.Exceptions.ExceptionHelper.GetAllMessageException(ex));
            }

            TechnicalException te = new TechnicalException(s.ToString());
            te.ErrorId = "7007";
            Fwk.Exceptions.ExceptionHelper.SetTechnicalException<FacadeHelper>(te);

            try
            {
                // TODO: ver prefijo del log
                Fwk.Logging.Event ev = new Fwk.Logging.Event(EventType.Error, 
                    Fwk.Bases.ConfigurationsHelper.HostApplicationName,
                    s.ToString(), Environment.MachineName, Environment.UserName);

                Fwk.Logging.Targets.XmlTarget target = new Logging.Targets.XmlTarget();
                target.FileName = String.Concat(Fwk.HelperFunctions.DateFunctions.Get_Year_Mont_Day_String(DateTime.Now,'-') ,"_", "DispatcherErrorsLog.xml");

                target.Write(ev);
               

            }
            catch { }
            return te;
        }