本文整理汇总了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");
}
示例2: LidgrenClientNetworkSession
public LidgrenClientNetworkSession(INetClient netClient, ILoggerFactory loggerFactory)
{
_netClient = netClient;
_logger = loggerFactory.GetLogger(this.GetType());
ClientDisconnected += (obj, args) => _logger.Info("ZAK HERE: Client disconnected");
}
示例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);
}
示例4: SettingsController
public SettingsController(IUserReaderService userReaderService, IUserWriterService userWriterService, IAuthenticationProvider authenticationProvider, ILoggerFactory loggerFactory)
{
_userReaderService = userReaderService;
_userWriterService = userWriterService;
_authenticationProvider = authenticationProvider;
_logger = loggerFactory.GetLogger("Settings");
}
示例5: TestConsole
private TestConsole(IDbEngine engine, ILoggerFactory loggerFactory)
{
_engine = engine;
_logger = new LoggerHelper(loggerFactory.GetLogger(typeof(TestConsole)),
Assembly.GetExecutingAssembly(),
"StringConstants");
}
示例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);
}
示例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>();
}
示例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;
}
示例9: Startup
//Constructors
public Startup(ILoggerFactory logFactory)
{
if (logFactory == null)
{
throw new ArgumentNullException();
}
_logger = logFactory.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
}
示例10: LidgrenServerNetworkSession
public LidgrenServerNetworkSession(INetServer netServer, IServerMessageSender serverMessageSender, ILoggerFactory loggerFactory)
{
_netServer = netServer;
_serverMessageSender = serverMessageSender;
_logger = loggerFactory.GetLogger(this.GetType());
ActiveConnections = new Dictionary<int, INetConnection>();
}
示例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());
}
示例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());
}
示例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");
}
示例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);
}
示例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);
}