コード例 #1
0
        public IObserver <EventEntry> CreateSink(XElement element)
        {
            Guard.ArgumentNotNull(element, "element");

            var subject = new EventEntrySubject();

            subject.LogToConsole(FormatterElementFactory.Get(element), XmlUtil.CreateInstance <IConsoleColorMapper>(element.Attribute("colorMapperType")));
            return(subject);
        }
コード例 #2
0
        public IObserver <EventEntry> CreateSink(XElement element)
        {
            Guard.ArgumentNotNull(element, "element");

            var subject = new EventEntrySubject();

            subject.LogToFlatFile((string)element.Attribute("fileName"), FormatterElementFactory.Get(element));
            return(subject);
        }
        public IObserver <EventEntry> CreateSink(XElement element)
        {
            Guard.ArgumentNotNull(element, "element");

            int rollSizeKB = (int?)element.Attribute("rollSizeKB") ?? default(int);
            RollFileExistsBehavior rollFileExistsBehavior = (RollFileExistsBehavior)Enum.Parse(typeof(RollFileExistsBehavior), (string)element.Attribute("rollFileExistsBehavior") ?? default(RollFileExistsBehavior).ToString());
            RollInterval           rollInterval           = (RollInterval)Enum.Parse(typeof(RollInterval), (string)element.Attribute("rollInterval") ?? default(RollInterval).ToString());
            int maxArchivedFiles = (int?)element.Attribute("maxArchivedFiles") ?? default(int);

            var subject = new EventEntrySubject();

            subject.LogToRollingFlatFile(
                (string)element.Attribute("fileName"),
                rollSizeKB,
                (string)element.Attribute("timeStampPattern"),
                rollFileExistsBehavior,
                rollInterval,
                FormatterElementFactory.Get(element),
                maxArchivedFiles);

            return(subject);
        }