Example #1
0
        public IList <IStatusReport> GetStatusReports()
        {
            var reports   = new List <IStatusReport>();
            var instances = _resolver.ResolveAllInstances <IStatus>();

            if (instances == null)
            {
                return(reports);
            }

            foreach (var i in from x in instances where x != null select x)
            {
                var status = i?.GetStatus();
                if (status != null)
                {
                    reports.Add(status);
                }
            }

            return(reports);
        }
Example #2
0
        public ILog CreateLog(IDictionary <string, string> properties = null)
        {
            var log     = _resolver.ResolveAllInstances <ILog>();
            var bLogger = new BroadcastLogger(log, _resolver);

            if (_resolver.IsRegistered <Dictionary <string, string> >("LoggingContext"))
            {
                var defaultProperties = _resolver.Resolve <Dictionary <string, string> >("LoggingContext");
                bLogger.AddToContext(defaultProperties);
            }

            bLogger.AddToContext(properties);
            return(bLogger);
        }