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


C# ILoggerFactory.GetLogger方法代码示例

本文整理汇总了C#中ILoggerFactory.GetLogger方法的典型用法代码示例。如果您正苦于以下问题:C# ILoggerFactory.GetLogger方法的具体用法?C# ILoggerFactory.GetLogger怎么用?C# ILoggerFactory.GetLogger使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ILoggerFactory的用法示例。


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

示例1: db4oDbEngine

        public db4oDbEngine(ILoggerFactory factory)
        {
            _logFactory = factory;
            _logger = new LoggerHelper(factory.GetLogger(typeof(db4oDbEngine)),
                Assembly.GetExecutingAssembly(),
                "StringConstants");
            _dataStores = new ArrayList();

            _logger.Info("LogMsg.Initializing", Db4o.version());

            //Set initial container configuration
            //activation depth is 1 (meaining primitive types only), since
            //this assembly handles activation of all objects in a persistence
            //boundary manually.
            Db4o.configure().activationDepth(1);

            //The content model objects do not know about db4o, therefore
            //they can't possibly implement the callback interface.  Thus, save
            //some compute cycles and don't even check
            Db4o.configure().callbacks(false);

            //Don't call constructors when instantiating objects
            Db4o.configure().callConstructors(false);

            //Throw an exception when storing a type that is not storable
            //Usually this is due to a missing default ctor, but attempting to
            //save event objects also causes this problem
            Db4o.configure().exceptionsOnNotStorable(true);

            //Tell db4o that the NotPersisted attribute decorates those
            //fields that shouldn't be stored
            Db4o.configure().markTransient(typeof(NotPersistedAttribute).FullName);

            //Create a logger object for db4o's log messages, then use
            //a db4oPrintStreamLogger to adapt the logger object's interface
            //to the PrintStream that db4o expects.

            ILogger db4oLogger = factory.GetLogger(typeof(db4oPrintStreamLogger));
            db4oPrintStreamLogger ps = new db4oPrintStreamLogger(db4oLogger);
            Db4o.configure().setOut(ps);

            //Based on the log levels of the logger object, set db4o's log level
            if (db4oLogger.IsDebugEnabled) {
                //Debug level, so enable all the log messages
                Db4o.configure().messageLevel(3);
            } else if (db4oLogger.IsInfoEnabled) {
                //Include new/update/delete msgs, but no activation details
                Db4o.configure().messageLevel(2);
            } else {
                //No extra logging.  Just report open and close
                Db4o.configure().messageLevel(1);
            }

            _logger.Info("LogMsg.Initialized");
        }
开发者ID:anelson,项目名称:infohub,代码行数:55,代码来源:db4oDbEngine.cs

示例2: LidgrenClientNetworkSession

        public LidgrenClientNetworkSession(INetClient netClient, ILoggerFactory loggerFactory)
        {
            _netClient = netClient;
            _logger = loggerFactory.GetLogger(this.GetType());

            ClientDisconnected += (obj, args) => _logger.Info("ZAK HERE: Client disconnected");
        }
开发者ID:zakvdm,项目名称:Frenetic,代码行数:7,代码来源:LidgrenClientNetworkSession.cs

示例3: db4oDataStore

        public db4oDataStore(db4oDbEngine engine, ExtObjectContainer container, String path, ILoggerFactory factory)
        {
            _engine = engine;
            _container = container;
            _path = path;

            _typeProcessor = new db4oTypeProcessor(this);

            //Here at load time, process the type information for all the types currently
            //stored in the container
            foreach (StoredClass sc in _container.storedClasses()) {
                Type storedType = Type.GetType(sc.getName());

                if (storedType != null) {
                    if (!_typeProcessor.IsAssemblyProcessed(storedType.Assembly)) {
                        _typeProcessor.ProcessAssembly(storedType.Assembly);
                    }
                }
            }

            _recursor = new ObjectRecursor(this);

            _logger = new LoggerHelper(factory.GetLogger(typeof(db4oDataStore)), Assembly.GetExecutingAssembly(), "StringConstants");

            _logger.Debug("LogMsg.DataStoreConstructed", path);
        }
开发者ID:anelson,项目名称:infohub,代码行数:26,代码来源:db4oDataStore.cs

示例4: SettingsController

 public SettingsController(IUserReaderService userReaderService, IUserWriterService userWriterService, IAuthenticationProvider authenticationProvider, ILoggerFactory loggerFactory)
 {
     _userReaderService = userReaderService;
     _userWriterService = userWriterService;
     _authenticationProvider = authenticationProvider;
     _logger = loggerFactory.GetLogger("Settings");
 }
开发者ID:medvekoma,项目名称:portfotolio,代码行数:7,代码来源:SettingsController.cs

示例5: TestConsole

 private TestConsole(IDbEngine engine, ILoggerFactory loggerFactory)
 {
     _engine = engine;
     _logger = new LoggerHelper(loggerFactory.GetLogger(typeof(TestConsole)),
         Assembly.GetExecutingAssembly(),
         "StringConstants");
 }
开发者ID:anelson,项目名称:infohub,代码行数:7,代码来源:TestConsole.cs

示例6: UIComponentFactory

        public UIComponentFactory(IKernel container, ILoggerFactory loggerFactory) {
            this.container = container;
            this.logger = loggerFactory.GetLogger("UIComponentFactory");

            workitemTreeControl = new Lazy<WorkitemTreeControl>(CreateWorkitemTreeControl, false);
            projectTreeControl = new Lazy<ProjectTreeControl>(CreateProjectTreeControl, false);
        }
开发者ID:cagatayalkan,项目名称:VersionOne.Client.VisualStudio,代码行数:7,代码来源:UIComponentFactory.cs

示例7: PerfTestController

 /// <summary>
 /// Constructor
 /// </summary>
 public PerfTestController(IPerfTestSvc perfTestSvc, ICurrentUserSvc currentUserSvc,
     ILoggerFactory loggerFactory)
 {
     this.perfTestSvc = perfTestSvc;
     this.currentUserSvc = currentUserSvc;
     logger = loggerFactory.GetLogger(GetType());
     resultsMap = new Dictionary<string, TestSuiteResult>();
 }
开发者ID:shj333,项目名称:dotnet_utils,代码行数:11,代码来源:PerfTestController.cs

示例8: Simulacre

 public Simulacre(IEar ear, IMouth mouth, ICortex cortex, INerve nerve, ILoggerFactory logFac)
 {
     this.ear = ear;
     this.mouth = mouth;
     this.cortex = cortex;
     this.logger = logFac.GetLogger(this.GetType());
     this.nerve = nerve;
 }
开发者ID:IronSlug,项目名称:elys,代码行数:8,代码来源:Simulacre.cs

示例9: Startup

        //Constructors

        public Startup(ILoggerFactory logFactory)
        {
            if (logFactory == null)
            {
                throw new ArgumentNullException();
            }
            _logger = logFactory.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
        }
开发者ID:ngallo,项目名称:Log4NetWrapper,代码行数:10,代码来源:Startup.cs

示例10: LidgrenServerNetworkSession

        public LidgrenServerNetworkSession(INetServer netServer, IServerMessageSender serverMessageSender, ILoggerFactory loggerFactory)
        {
            _netServer = netServer;
            _serverMessageSender = serverMessageSender;
            _logger = loggerFactory.GetLogger(this.GetType());

            ActiveConnections = new Dictionary<int, INetConnection>();
        }
开发者ID:zakvdm,项目名称:Frenetic,代码行数:8,代码来源:LidgrenServerNetworkSession.cs

示例11: ClientInputSender

 public ClientInputSender(LocalClient localClient, Log<ChatMessage> chatLog, ISnapCounter snapCounter, IOutgoingMessageQueue outgoingMessageQueue, ILoggerFactory loggerFactory)
 {
     this.LocalClient = localClient;
     this.ChatLog = chatLog;
     this.SnapCounter = snapCounter;
     this.OutgoingMessageQueue = outgoingMessageQueue;
     this.Logger = loggerFactory.GetLogger(this.GetType());
 }
开发者ID:zakvdm,项目名称:Frenetic,代码行数:8,代码来源:ClientInputSender.cs

示例12: MethodLoggingInterceptorBase

 /// <summary>
 /// Constructor used when running performance tests
 /// </summary>
 protected MethodLoggingInterceptorBase(IPerfTestSvc perfTestSvc, 
     ICurrentUserSvc currentUserSvc,
     IConfigurationSvc configurationSvc,
     ILoggerFactory loggerFactory)
 {
     this.perfTestSvc = perfTestSvc;
     this.currentUserSvc = currentUserSvc;
     this.configurationSvc = configurationSvc;
     logger = loggerFactory.GetLogger(GetType());
 }
开发者ID:shj333,项目名称:dotnet_utils,代码行数:13,代码来源:MethodLoggingInterceptorBase.cs

示例13: IdGeneratorSvc

 /// <summary>
 /// Constructor
 /// </summary>
 public IdGeneratorSvc(IRedisClientsManager redisManager,
     IConfigurationSvc configurationSvc,
     ILoggerFactory loggerFactory)
 {
     this.redisManager = redisManager;
     logger = loggerFactory.GetLogger(GetType());
     idKeyPrefix = configurationSvc.GetStringConfig("IdGenerator:$Internal$:KeyPrefix", "BHS:IdGenKey:");
     idKeyPrefix = StringUtils.MustEndWith(idKeyPrefix, ":");
     logger.Info("Using " + idKeyPrefix + " as prefix for id generation keys in Redis");
 }
开发者ID:shj333,项目名称:dotnet_utils,代码行数:13,代码来源:IdGeneratorSvc.cs

示例14: AssetFactory

        internal AssetFactory(IDataLayerInternal dataLayer, Project currentProject, ILoggerFactory loggerFactory, IEnumerable<AttributeInfo> attributesToQuery) {
            this.dataLayer = dataLayer;
            this.currentProject = currentProject;
            this.attributesToQuery = attributesToQuery;

            logger = loggerFactory.GetLogger("AssetFactory");

            typeMappings.Add(Entity.DefectType, dataLayer.DefectType);
            typeMappings.Add(Entity.TaskType, dataLayer.TaskType);
            typeMappings.Add(Entity.TestType, dataLayer.TestType);
        }
开发者ID:cagatayalkan,项目名称:VersionOne.Client.VisualStudio,代码行数:11,代码来源:AssetFactory.cs

示例15: Worker

        public Worker(Type jobType, JobSetup setup, IContainerFactory containerFactory, ILoggerFactory loggerFactory)
        {
            this.jobType = jobType;
            this.setup = setup;
            this.containerFactory = containerFactory;
            this.thread = new Thread(Run)
            {
                IsBackground = true,
                Name = "Worker: " + jobType.FullName
            };

            this.logger = loggerFactory.GetLogger(jobType, setup.JobId);
        }
开发者ID:hash,项目名称:trigger.net,代码行数:13,代码来源:Worker.cs


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