Esempio n. 1
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;
        }
Esempio n. 2
0
        protected override void OnStart(string[] args)
        {
            Fwk.Logging.Event ev = null;
            //ConfigurationsHelper.HostApplicationName = string.Concat("Fwk remoting ", this.ServiceName);
            try
            {
                RemotingConfiguration.Configure(AppDomain.CurrentDomain.SetupInformation.ConfigurationFile, false);
                ev              = new Event();
                ev.LogType      = EventType.Information;
                ev.Machine      = Environment.MachineName;
                ev.User         = Environment.UserName;
                ev.Message.Text = "Servicio de host de Remoting iniciado.";
            }
            catch (Exception ex)
            {
                //RemotingHelper.WriteLog("\r\nSe produjo una excepción al iniciar el servicio." +
                //    "\r\n\r\n" + ex.ToString(),
                //    EventLogEntryType.Error);
                ev              = new Event();
                ev.LogType      = EventType.Error;
                ev.Machine      = Environment.MachineName;
                ev.User         = Environment.UserName;
                ev.Message.Text = Fwk.Exceptions.ExceptionHelper.GetAllMessageException(ex);
            }
            //RemotingHelper.WriteLog("Servicio de host de Remoting iniciado.", EventLogEntryType.Information);

            StaticLogger.Log(TargetType.WindowsEvent, ev, null, null);
        }
Esempio n. 3
0
        /// <summary>
        /// Log error from dispatcher on xml File
        /// </summary>
        /// <param name="ex"></param>
        internal static void LogDispatcherError(Exception ex)
        {
            try
            {
                // TODO: ver prefijo del log
                Fwk.Logging.Event ev = new Fwk.Logging.Event(EventType.Error,
                                                             Fwk.Bases.ConfigurationsHelper.HostApplicationName,
                                                             ex.Message, Environment.MachineName, Environment.UserName);

                target_write(ev);
            }
            catch { }
        }
Esempio n. 4
0
        /// <summary>
        /// Crea una entrada en el visor de eventos
        /// </summary>
        /// <param name="msg"></param>
        /// <param name="eventType"></param>
        public static void LogWinEvent(string msg, Fwk.Logging.EventType eventType)
        {
            Fwk.Logging.Event ev = new Fwk.Logging.Event();
            ev.LogType      = eventType;
            ev.Source       = "";
            ev.Message.Text = msg;

            try
            {
                if (!logOnWindowsEvent)
                {
                    StaticLogger.Log(TargetType.WindowsEvent, ev, string.Empty, string.Empty);
                }

                Audit(msg);
            }
            catch (System.Security.SecurityException)
            {
                logOnWindowsEvent = false;
            }
        }
Esempio n. 5
0
        /// <summary>
        /// Crea una entrada en log.xml
        /// </summary>
        /// <param name="msg"></param>
        /// <param name="eventType"></param>
        public static void Audit(string msg)
        {
            if (!logOnFile)
            {
                return;
            }

            Fwk.Logging.Event ev = new Fwk.Logging.Event();
            ev.LogType = Fwk.Logging.EventType.Audit;

            ev.Message.Text = msg;
            //StaticLogger.Log(ev, string.Empty, DateFunctions.Get_Year_Mont_Day_String(DateTime.Now, '-'));

            try
            {
                StaticLogger.Log(ev);
            }
            catch (System.Security.SecurityException)
            {
                logOnFile = false;
            }
        }
Esempio n. 6
0
        /// <summary>
        /// Crea una entrada en log.xml
        /// </summary>
        /// <param name="msg"></param>
        /// <param name="eventType"></param>
        public static void Audit(string msg)
        {
            if (!logOnFile) return;

            Fwk.Logging.Event ev = new Fwk.Logging.Event();
            ev.LogType = Fwk.Logging.EventType.Audit;
            
            ev.Message.Text = msg;
            //StaticLogger.Log(ev, string.Empty, DateFunctions.Get_Year_Mont_Day_String(DateTime.Now, '-'));

            try
            {
                StaticLogger.Log(ev);
            }
            catch (System.Security.SecurityException)
            {
                logOnFile = false;

            }
        }
Esempio n. 7
0
        /// <summary>
        /// Crea una entrada en el visor de eventos
        /// </summary>
        /// <param name="msg"></param>
        /// <param name="eventType"></param>
        public static void LogWinEvent(string msg, Fwk.Logging.EventType eventType)
        {

            Fwk.Logging.Event ev = new Fwk.Logging.Event();
            ev.LogType = eventType;
            ev.Source = "";
            ev.Message.Text = msg;

            try
            {
                if (!logOnWindowsEvent)
                    StaticLogger.Log(TargetType.WindowsEvent, ev, string.Empty, string.Empty);

                Audit(msg);
            }
            catch (System.Security.SecurityException)
            {
                logOnWindowsEvent = false;

            }

        }