コード例 #1
0
        private void AdicionarLogGenerico(string descricaoLog)
        {
            var _logContext = new LogGenericoContext();

            _logContext.LogGenericos.Add(new LogGenerico {
                NmTipoLog = Tipo.INTEGRACAO.GetDescription(), NmOrigem = Origem.SALESFORCE.GetDescription(), DtHoraLogGenerico = DateTime.Now, DescLogGenerico = descricaoLog, DescExcecao = ""
            });
            _logContext.SaveChanges();
        }
コード例 #2
0
        private static void AdicionarLogGenerico(string descricaoLog, string stackTrace = "")
        {
            var _logContext = new LogGenericoContext();

            _logContext.LogGenericos.Add(new LogGenerico {
                NmTipoLog = Tipo.INTEGRACAO.GetDescription(), NmOrigem = Origem.EPM.GetDescription(), DtHoraLogGenerico = DateTime.Now, DescLogGenerico = descricaoLog, DescExcecao = stackTrace
            });
            _logContext.SaveChanges();
        }
コード例 #3
0
        private static void AdicionarLogGenerico(Exception ex, string nmOrigem, string descLogGenerico)
        {
            var _logContext = new LogGenericoContext();

            _logContext.LogGenericos.Add(new LogGenerico
            {
                NmTipoLog         = "MIGRACAO",
                NmOrigem          = nmOrigem,
                DtHoraLogGenerico = DateTime.Now,
                DescLogGenerico   = descLogGenerico + " - " + ex?.Message,
                DescExcecao       = ex?.StackTrace.Substring(0, 600)
            });
            _logContext.SaveChanges();
        }
コード例 #4
0
        public void AddLogJob(string descJob)
        {
            var dbContext = new LogGenericoContext();

            dbContext.LogGenericos.Add(new LogGenerico
            {
                DescLogGenerico   = descJob,
                DtHoraLogGenerico = DateTime.Now,
                NmOrigem          = "JOB",
                NmTipoLog         = "",
                DescExcecao       = ""
            });
            dbContext.SaveChanges();
        }