• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# ILogFactory类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: SocketInitiator

 public SocketInitiator(IApplication application, IMessageStoreFactory storeFactory, SessionSettings settings, ILogFactory logFactory, IMessageFactory messageFactory)
     : base(application, storeFactory, settings, logFactory, messageFactory)
 {
     app_ = application;
     storeFactory_ = storeFactory;
     settings_ = settings;
     logFactory_ = logFactory;
 }
开发者ID:Paccc,项目名称:quickfixn,代码行数:8,代码来源:SocketInitiator.cs


示例17: MethodLogger

        public MethodLogger(ILogFactory logFactory, IExceptionLogger exceptionLogger)
        {
            Check.IsNotNull(exceptionLogger, "exceptionLogger");
            Check.IsNotNull(logFactory, "logFactory");

            _exceptionLogger = exceptionLogger;
            _logFactory = logFactory;
        }
开发者ID:jmptrader,项目名称:WebFrameworkMVC,代码行数:8,代码来源:MethodLogger.cs


示例18: Session

        public Session(
            IApplication app, IMessageStoreFactory storeFactory, SessionID sessID, DataDictionaryProvider dataDictProvider,
            SessionSchedule sessionSchedule, int heartBtInt, ILogFactory logFactory, IMessageFactory msgFactory, string senderDefaultApplVerID)
        {
            this.Application = app;
            this.SessionID = sessID;
            this.DataDictionaryProvider = new DataDictionaryProvider(dataDictProvider);
            this.schedule_ = sessionSchedule;
            this.msgFactory_ = msgFactory;

            this.SenderDefaultApplVerID = senderDefaultApplVerID;

            this.SessionDataDictionary = this.DataDictionaryProvider.GetSessionDataDictionary(this.SessionID.BeginString);
            if (this.SessionID.IsFIXT)
                this.ApplicationDataDictionary = this.DataDictionaryProvider.GetApplicationDataDictionary(this.SenderDefaultApplVerID);
            else
                this.ApplicationDataDictionary = this.SessionDataDictionary;

            ILog log;
            if (null != logFactory)
                log = logFactory.Create(sessID);
            else
                log = new NullLog();

            state_ = new SessionState(log, heartBtInt)
            {
                MessageStore = storeFactory.Create(sessID)
            };

            // Configuration defaults.
            // Will be overridden by the SessionFactory with values in the user's configuration.
            this.PersistMessages = true;
            this.ResetOnDisconnect = false;
            this.SendRedundantResendRequests = false;
            this.ValidateLengthAndChecksum = true;
            this.CheckCompID = true;
            this.MillisecondsInTimeStamp = true;
            this.EnableLastMsgSeqNumProcessed = false;
            this.MaxMessagesInResendRequest = 0;
            this.SendLogoutBeforeTimeoutDisconnect = false;
            this.IgnorePossDupResendRequests = false;
            this.RequiresOrigSendingTime = true;
            this.CheckLatency = true;
            this.MaxLatency = 120;

            if (!IsSessionTime)
                Reset("Out of SessionTime (Session construction)");
            else if (IsNewSession)
                Reset("New session");

            lock (sessions_)
            {
                sessions_[this.SessionID] = this;
            }

            this.Application.OnCreate(this.SessionID);
            this.Log.OnEvent("Created session");
        }
开发者ID:huruixd,项目名称:quickfixn,代码行数:58,代码来源:Session.cs


示例19: ReceivePoisonMessageDecorator

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

            _log = log.Create();
            _handler = handler;
        }
开发者ID:blehnen,项目名称:DotNetWorkQueue,代码行数:14,代码来源:IReceivePoisonMessageDecorator.cs


示例20: Initialize

        /// <summary>
        /// Initializes the specified log factory.
        /// </summary>
        /// <param name="logFactory">The log factory.</param>
        public static void Initialize(ILogFactory logFactory)
        {
            if (m_Initialized)
                throw new Exception("The LogFactoryProvider has been initialized, you cannot initialize it again!");

            m_LogFactory = logFactory;
            GlobalLog = m_LogFactory.GetLog("Global");
            m_Initialized = true;
        }
开发者ID:xxjeng,项目名称:nuxleus,代码行数:13,代码来源:LogFactoryProvider.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ILogFormatter类代码示例发布时间:2022-05-24
下一篇:
C# ILog类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap