当前位置: 首页>>代码示例>>C#>>正文


C# ILogFactory类代码示例

本文整理汇总了C#中ILogFactory的典型用法代码示例。如果您正苦于以下问题:C# ILogFactory类的具体用法?C# ILogFactory怎么用?C# ILogFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ILogFactory类属于命名空间,在下文中一共展示了ILogFactory类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RedisServerUnixTime

 /// <summary>
 /// Initializes a new instance of the <see cref="RedisServerUnixTime" /> class.
 /// </summary>
 /// <param name="timeLua">The time lua.</param>
 /// <param name="log">The log.</param>
 /// <param name="configuration">The configuration.</param>
 public RedisServerUnixTime(TimeLua timeLua,
     ILogFactory log,
     BaseTimeConfiguration configuration): base(log, configuration)
 {
     Guard.NotNull(() => timeLua, timeLua);
     _timeLua = timeLua;
 }
开发者ID:blehnen,项目名称:DotNetWorkQueue,代码行数:13,代码来源:RedisServerUnixTime.cs

示例2: TryGetFactory

        public bool TryGetFactory(out ILogFactory factory, out string errors)
        {
            factory = null;
            errors = null;

            var typeName = ConfigurationManager.AppSettings[CONFIG_KEY];
            if (string.IsNullOrEmpty(typeName))
            {
                errors = "Log assembly not found. Loaded default logger.";
                return false;
            }

            var type = Type.GetType(typeName);
            if (type == null)
            {
                errors = "Type - '{0}' not found.";
                return false;
            }

            factory = Activator.CreateInstance(type) as ILogFactory;
            if (factory == null)
            {
                errors = "Type - '{0}' is not implemented ILogFactory.";
                return false;
            }

            return true;
        }
开发者ID:akurtov,项目名称:xLog,代码行数:28,代码来源:AppConfigStrategy.cs

示例3: AssignFactory

 /// <summary>
 /// 指定一个新的日志工厂
 /// </summary>
 /// <param name="factory"></param>
 public static void AssignFactory(ILogFactory factory)
 {
     if (factory == null) {
         throw new ArgumentNullException("factory");
     }
     LogManager.factory = factory;
 }
开发者ID:yorkart,项目名称:NDWR,代码行数:11,代码来源:LogManager.cs

示例4: AmqpBuilder

        /// <summary>
        /// Initialises an instance of the <see cref="AmqpBuilder"/> class.
        /// </summary>
        /// <param name="logFactory"></param>
        /// <param name="endpointAddress"></param>
        public AmqpBuilder(ILogFactory logFactory, QueueEndpointAddress endpointAddress) : this(logFactory)
        {
            endpointAddress.ShouldNotBeNull();

            m_Connection = BuildConnection(endpointAddress);
            m_EndpointAddress = endpointAddress;
        }
开发者ID:ukkiwisurfer,项目名称:Framework.Embedded,代码行数:12,代码来源:AmqpBuilder.cs

示例5: DefaultBootstrap

        /// <summary>
        /// Initializes a new instance of the <see cref="DefaultBootstrap"/> class.
        /// </summary>
        /// <param name="rootConfig">The root config.</param>
        /// <param name="appServers">The app servers.</param>
        /// <param name="logFactory">The log factory.</param>
        public DefaultBootstrap(IRootConfig rootConfig, IEnumerable<IWorkItem> appServers, ILogFactory logFactory)
        {
            if (rootConfig == null)
                throw new ArgumentNullException("rootConfig");

            if (appServers == null)
                throw new ArgumentNullException("appServers");

            if(!appServers.Any())
                throw new ArgumentException("appServers must have one item at least", "appServers");

            if (logFactory == null)
                throw new ArgumentNullException("logFactory");

            m_RootConfig = rootConfig;

            m_AppServers = appServers.ToList();

            m_GlobalLog = logFactory.GetLog(this.GetType().Name);

            if (!rootConfig.DisablePerformanceDataCollector)
            {
                m_PerfMonitor = new PerformanceMonitor(rootConfig, m_AppServers, logFactory);
                m_PerfMonitor.Collected += new EventHandler<PermformanceDataEventArgs>(m_PerfMonitor_Collected);
            }

            m_Initialized = true;
        }
开发者ID:wulinfeng2008,项目名称:SuperSocket,代码行数:34,代码来源:DefaultBootstrap.cs

示例6: DefaultBootstrap

        /// <summary>
        /// Initializes a new instance of the <see cref="DefaultBootstrap"/> class.
        /// </summary>
        /// <param name="rootConfig">The root config.</param>
        /// <param name="appServers">The app servers.</param>
        /// <param name="logFactory">The log factory.</param>
        public DefaultBootstrap(IRootConfig rootConfig, IEnumerable<IWorkItem> appServers, ILogFactory logFactory)
        {
            if (rootConfig == null)
                throw new ArgumentNullException("rootConfig");

            if (appServers == null)
                throw new ArgumentNullException("appServers");

            if(!appServers.Any())
                throw new ArgumentException("appServers must have one item at least", "appServers");

            if (logFactory == null)
                throw new ArgumentNullException("logFactory");

            m_RootConfig = rootConfig;

            SetDefaultCulture(rootConfig);

            m_AppServers = appServers.ToList();

            m_GlobalLog = logFactory.GetLog(this.GetType().Name);

            if (!rootConfig.DisablePerformanceDataCollector)
            {
                m_PerfMonitor = new PerformanceMonitor(rootConfig, m_AppServers, logFactory);

                if (m_GlobalLog.IsDebugEnabled)
                    m_GlobalLog.Debug("The PerformanceMonitor has been initialized!");
            }

            if (m_GlobalLog.IsDebugEnabled)
                m_GlobalLog.Debug("The Bootstrap has been initialized!");

            m_Initialized = true;
        }
开发者ID:Johnses,项目名称:SuperSocket,代码行数:41,代码来源:DefaultBootstrap.cs

示例7: HeartBeatWorker

        /// <summary>
        /// Initializes a new instance of the <see cref="HeartBeatWorker" /> class.
        /// </summary>
        /// <param name="configuration">The configuration.</param>
        /// <param name="context">The context.</param>
        /// <param name="sendHeartBeat">The send heart beat.</param>
        /// <param name="threadPool">The thread pool.</param>
        /// <param name="log">The log.</param>
        /// <param name="heartBeatNotificationFactory">The heart beat notification factory.</param>
        public HeartBeatWorker(IHeartBeatConfiguration configuration, 
            IMessageContext context,
            ISendHeartBeat sendHeartBeat,
            IHeartBeatThreadPool threadPool,
            ILogFactory log,
            IWorkerHeartBeatNotificationFactory heartBeatNotificationFactory)
        {
            Guard.NotNull(() => configuration, configuration);
            Guard.NotNull(() => context, context);
            Guard.NotNull(() => sendHeartBeat, sendHeartBeat);
            Guard.NotNull(() => threadPool, threadPool);
            Guard.NotNull(() => log, log);
            Guard.NotNull(() => heartBeatNotificationFactory, heartBeatNotificationFactory);

            _context = context;
            _checkTimespan = configuration.CheckTime;
            _sendHeartbeat = sendHeartBeat;
            _smartThreadPool = threadPool;
            _logger = log.Create();

            _runningLock = new ReaderWriterLockSlim();
            _stoppedLock = new ReaderWriterLockSlim();

            _cancel = new CancellationTokenSource();
            context.WorkerNotification.HeartBeat = heartBeatNotificationFactory.Create(_cancel.Token);
        }
开发者ID:blehnen,项目名称:DotNetWorkQueue,代码行数:35,代码来源:HeartBeatWorker.cs

示例8: MessageProcessing

        /// <summary>
        /// Initializes a new instance of the <see cref="MessageProcessing"/> class.
        /// </summary>
        /// <param name="receiveMessages">The receive messages.</param>
        /// <param name="messageContextFactory">The message context factory.</param>
        /// <param name="queueWaitFactory">The queue wait factory.</param>
        /// <param name="log">The log.</param>
        /// <param name="processMessage">The process message.</param>
        /// <param name="receivePoisonMessage">The receive poison message.</param>
        /// <param name="rollbackMessage">rolls back a message when an exception occurs</param>
        public MessageProcessing(
            IReceiveMessagesFactory receiveMessages,
            IMessageContextFactory messageContextFactory,
            IQueueWaitFactory queueWaitFactory,
            ILogFactory log,
            ProcessMessage processMessage,
            IReceivePoisonMessage receivePoisonMessage,
            IRollbackMessage rollbackMessage)
        {

            Guard.NotNull(() => receiveMessages, receiveMessages);
            Guard.NotNull(() => messageContextFactory, messageContextFactory);
            Guard.NotNull(() => queueWaitFactory, queueWaitFactory);
            Guard.NotNull(() => log, log);
            Guard.NotNull(() => processMessage, processMessage);
            Guard.NotNull(() => receivePoisonMessage, receivePoisonMessage);
            Guard.NotNull(() => rollbackMessage, rollbackMessage);

            _receiveMessages = receiveMessages.Create();
            _messageContextFactory = messageContextFactory;
            _log = log.Create();
            _processMessage = processMessage;
            _receivePoisonMessage = receivePoisonMessage;
            _rollbackMessage = rollbackMessage;

            _noMessageToProcessBackoffHelper = new Lazy<IQueueWait>(queueWaitFactory.CreateQueueDelay);
            _seriousExceptionProcessBackOffHelper = new Lazy<IQueueWait>(queueWaitFactory.CreateFatalErrorDelay);

        }
开发者ID:blehnen,项目名称:DotNetWorkQueue,代码行数:39,代码来源:MessageProcessing.cs

示例9: Log4NetRemoteLoggingSinkWinService

        public Log4NetRemoteLoggingSinkWinService(int remotingPort ,ILogFactory logFactory)
        {
            InitializeComponent();

            _log = logFactory.New(GetType());
            _remotingPort = remotingPort;
        }
开发者ID:bwrobel,项目名称:Passerino,代码行数:7,代码来源:Log4NetRemoteLoggingSinkWinService.cs

示例10: HttpServer

 public HttpServer(ILogFactory logFactory, IServiceLocator locator)
 {
     Logger = logFactory.Create("Http server");
     Listener = new HttpListener();
     Listener.IgnoreWriteExceptions = true;
     foreach (string key in ConfigurationManager.AppSettings.Keys)
     {
         if (key.StartsWith("HttpAddress", StringComparison.InvariantCultureIgnoreCase))
             Listener.Prefixes.Add(ConfigurationManager.AppSettings[key]);
     }
     if (Listener.Prefixes.Count == 0)
     {
         Listener.Prefixes.Add("http://*:80/");
         Listener.Prefixes.Add("https://*:443/");
     }
     Routes = new Routes(locator);
     var customAuth = ConfigurationManager.AppSettings["CustomAuth"];
     if (!string.IsNullOrEmpty(customAuth))
     {
         var authType = Type.GetType(customAuth);
         if (!typeof(HttpAuth).IsAssignableFrom(authType))
             throw new ConfigurationErrorsException("Custom auth does not inherit from HttpAuth. Please inherit from " + typeof(HttpAuth).FullName);
         Authentication = locator.Resolve<HttpAuth>(authType);
     }
     else Authentication = locator.Resolve<HttpAuth>();
 }
开发者ID:nutrija,项目名称:revenj,代码行数:26,代码来源:HttpServer.cs

示例11: SessionFactory

 public SessionFactory(IApplication app, IMessageStoreFactory storeFactory, ILogFactory logFactory, IMessageFactory messageFactory)
 {
     application_ = app;
     messageStoreFactory_ = storeFactory;
     logFactory_ = logFactory;
     messageFactory_ = messageFactory ?? new DefaultMessageFactory();
 }
开发者ID:dafanasiev,项目名称:quickfixn,代码行数:7,代码来源:SessionFactory.cs

示例12: BaseQueue

        /// <summary>
        /// Initializes a new instance of the <see cref="BaseQueue" /> class.
        /// </summary>
        /// <param name="log">The log.</param>
        protected BaseQueue(ILogFactory log)
        {
            Guard.NotNull(() => log, log);

            Log = log.Create();
            _startedLocker = new ReaderWriterLockSlim();
            _shouldWorkLocker = new ReaderWriterLockSlim();
        }
开发者ID:blehnen,项目名称:DotNetWorkQueue,代码行数:12,代码来源:BaseQueue.cs

示例13: MessageExceptionHandler

 /// <summary>
 /// Initializes a new instance of the <see cref="MessageExceptionHandler"/> class.
 /// </summary>
 /// <param name="transportErrorHandler">The transport error handler.</param>
 /// <param name="log">The log.</param>
 public MessageExceptionHandler(IReceiveMessagesError transportErrorHandler, 
     ILogFactory log)
 {
     Guard.NotNull(() => transportErrorHandler, transportErrorHandler);
     Guard.NotNull(() => log, log);
     _transportErrorHandler = transportErrorHandler;
     _log = log.Create();
 }
开发者ID:blehnen,项目名称:DotNetWorkQueue,代码行数:13,代码来源:MessageExceptionHandler.cs

示例14: ElmahLogFactory

        /// <summary>	Constructor. </summary>
        /// <remarks>	9/2/2011. </remarks>
        /// <param name="logFactory">	The log factory that provides the original . </param>
        /// <param name="application"> The Http Application to log with. </param>
        public ElmahLogFactory(ILogFactory logFactory, HttpApplication application)
        {
            if (null == logFactory) { throw new ArgumentNullException("logFactory"); }
            if (null == application) { throw new ArgumentNullException("application"); }

            this.logFactory = logFactory;
            this.application = application;
        }
开发者ID:BilliamBrown,项目名称:ServiceStack,代码行数:12,代码来源:ElmahLogFactory.cs

示例15: DirectLogger

 public DirectLogger(ILogFactory loggerFactory)
 {
     _loggerFactory = loggerFactory;
     _logLevel = LogLevel.Debug;
     _name = "unnamed";
     _stopwatch = new Stopwatch();
     _stopwatch.Start();
 }
开发者ID:CHAOS-Community,项目名称:Portal,代码行数:8,代码来源:DirectLogger.cs


注:本文中的ILogFactory类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。