Beispiel #1
0
        /// <summary>
        /// Registra listas de exceptions em um único pacote
        /// </summary>
        /// <param name="ex">
        /// Lista de exceptions
        /// </param>
        /// <param name="storeId">
        /// Identificador do cliente
        /// </param>
        /// <param name="appName">
        /// The app Name.
        /// </param>
        public void LogException(List<Exception> ex, string storeId = null, string appName = null)
        {
            var sb = new StringBuilder(ex.Count);
            foreach (var error in ex.Select(exception => new Error(exception)))
            {
                sb.AppendLine(ErrorJson.EncodeString(error));
            }

            var aggregateException = new EventException("Erros Agregados", sb.ToString(), storeId, appName);
            this.LogException(aggregateException, storeId, appName);
        }
Beispiel #2
0
        /// <summary>
        /// Registra um evento
        /// </summary>
        /// <param name="eventVO">
        /// The event VO.
        /// </param>
        public void LogEvent(EventVO eventVO)
        {
            // Encadeamento
            if (!this.IsChild && threadChain != null)
            {
                foreach (var childLogger in threadChain)
                {
                    childLogger.LogEvent(eventVO);
                }
            }

            if (!this.IsChild && staticChain != null)
            {
                foreach (var childLogger in staticChain)
                {
                    childLogger.LogEvent(eventVO);
                }
            }

            var exception = new EventException(eventVO);
            this.elmah.Log(new Error(exception));
        }