Ejemplo n.º 1
0
        public void SaveToDBOnly()
        {
            var configWrapTest = new LogConfigWrapperTests();

            configWrapTest.SerializeToXMLTest();

            bool allEnabled = LoggingSettings.Instance.Config.Log4NetConfigurations.All(c => c.IsEnabled = false);

            Assert.IsTrue(allEnabled);

            LoggingSettings.Instance.Config.EmailConfiguration.IsEnabled = false;

            try
            {
                throw new Exception("Is this real or just a fantasy");
            }
            catch (Exception ex)
            {
                LogWrapper.Log(SeverityLevel.Debug, "testing", ex,
                               LoggerInstanceConstants.MainLoggerInstance,
                               @"1021391480þ923703585þ1þ605þ605þ3þ0þZþþþþþþ05/04/2016 15:52:59.6942þ12þVIDAKOVIC, LYNNþþMEDICAL SERVICES RICþþþþ0þR-ZþüPAYER NAME MATCHING REQUIRED.üýüBILLING NAME MATCHING REQUIRED.üþ05/04/2016þ15:52:59.6942þ1021391480.1þþ114X67712481þ246.00þREHAB INST OF CHICAGOþPþþ3þ1244þþ1205879095þ1659306587þ1114933660þ0þ605þþþþþþþþþþþþ20160504þZ1ýZ1þþPAYER NAME MATCHING REQUIREDýBILLING NAME MATCHING REQUIRED",
                               new Dictionary <string, string>
                {
                    { "Additional Data 1", "SomeImportantValue" },
                    { "TheAnswer", "42" },
                    { "HAP Status", "I am online, Dave" },
                    { "oversize", new string('p', 5000) },
                    { new string('t', 5000), "oversize name" }
                },
                               new Dictionary <string, string>
                {
                    { "InputParamter1", "True" },
                    { "NextParam", "String" },
                    { "NullableParm", null },
                    { "oversize", new string('p', 5000) },
                    { new string('t', 5000), "oversize name" }
                },
                               "UnitTest.SaveToDBOnly");

                try
                {
                    throw new Exception("it's inception");
                }
                catch (Exception ex2)
                {
                    LogWrapper.Log(SeverityLevel.Debug, "testing2", ex2,
                                   LoggerInstanceConstants.MainLoggerInstance,
                                   @"BAH",
                                   new Dictionary <string, string>
                    {
                        { "Additional Data 1", "SomeImportantValue" },
                        { "TheAnswer", "42" },
                        { "HAP Status", "I am online, Dave" },
                        { "oversize", new string('p', 5000) },
                        { new string('t', 5000), "oversize name" }
                    },
                                   new Dictionary <string, string>
                    {
                        { "InputParamter1", "True" },
                        { "NextParam", "String" },
                        { "NullableParm", null },
                        { "oversize", new string('p', 5000) },
                        { new string('t', 5000), "oversize name" }
                    },
                                   "UnitTest.SaveToDBOnly");
                }

                //LogWrapper.Flush();
            }
            Task.Delay(1000 * 60).Wait();
            LogWrapper.Flush(true);
            Task.Delay(1000 * 60).Wait();
        }