public CommentService(IUnitOfWorkFactory uowFactory, IRepositoryFactory repositoryFactory, ILogFactory logFactory) { _unitOfWorkFactory = uowFactory; _repositoryFactory = repositoryFactory; _commentBuilder = new CommentBuilder(); _logger = logFactory.CreateLogger(GetType()); }
public ExternalDataService(IUnitOfWorkFactory unitOfWorkFactory, ILogFactory logFactory) { this.uow = unitOfWorkFactory.Create(typeof(AppDbContext)); userRepository = uow.CreateRepository <ExternalData>(); logger = logFactory.CreateLogger <ExternalDataService>(); }
public CategoryService(IUnitOfWorkFactory uowFactory, IRepositoryFactory repositoryFactory, ILogFactory logFactory) { _unitOfWorkFactory = uowFactory; _repositoryFactory = repositoryFactory; _categoryBuilder = new CategoryBuilder(); _blogBuilder = new BlogBuilder(); _logger = logFactory.CreateLogger(GetType()); }
public UserService(IBlogService blogService, IUnitOfWorkFactory uowFactory, IRepositoryFactory repositoryFactory, ILogFactory logFactory) { _blogUserBuilder = new BlogUserBuilder(); _blogService = blogService; _logger = logFactory.CreateLogger(GetType()); _repositoryFactory = repositoryFactory; _unitOfWorkFactory = uowFactory; }
/// <summary> /// Create a new logger. /// </summary> /// <param name="type">Type that requested a logger.</param> /// <returns>Logger for the specified type;</returns> public static ILogger CreateLogger(Type type) { if (_factory == null) { LogFilter lf = new LogFilter(); lf.AddStandardRules(); lf.AddType(type, LogLevel.Error); _factory = NullLogFactory.Instance;// (lf); } return(_factory.CreateLogger(type)); }
public BlogService(ICategoryService categoryService, IPostService postService, IUnitOfWorkFactory uowFactory, IRepositoryFactory repositoryFactory, ILogFactory logFactory) { _blogBuilder = new BlogBuilder(); _userBuilder = new BlogUserBuilder(); _categoryService = categoryService; _postService = postService; _unitOfWorkFactory = uowFactory; _repositoryFactory = repositoryFactory; _logger = logFactory.CreateLogger(GetType()); }
private MessageMetaData[][] GetMessages(HtmlDocument[] htmlDocs) { var tasksList = new List <Task <MessageMetaData[]> >(); var logger = logFactory.CreateLogger(typeof(HtmlScraper)); Task <MessageMetaData[]> task; foreach (var doc in htmlDocs) { task = GetMessagesAsync(doc, logger); tasksList.Add(task); } var result = Task.WhenAll(tasksList).Result; return(result); }
/// <summary> /// Gets the log with the specified name. /// </summary> /// <param name="name">The name of the log.</param> /// <returns>The <see cref="ILog"/> with the specified name.</returns> public static ILog GetLogger(string name) { if (string.IsNullOrEmpty(name)) { throw new ArgumentNullException("name"); } ILog logger; if (!_loggers.TryGetValue(name, out logger)) { logger = _factory.CreateLogger(name); _loggers.Add(name, logger); } return(logger); }
public DomainMigratorService(ILogFactory logFactory, IContextFactory contextFactory) { _logger = logFactory.CreateLogger("DomainMigrator"); _contextFactory = contextFactory; }
/// <summary> /// /// </summary> /// <param name="next"></param> /// <param name="logFactory">The logging service</param> public LoggingMiddleware(OwinMiddleware next, ILogFactory logFactory) : base(next) { logService = logFactory.CreateLogger <LoggingMiddleware>(); }
/// <summary> /// Create a new logger. /// </summary> /// <param name="type">Type that requested a logger.</param> /// <returns>Logger for the specified type;</returns> public static ILogger CreateLogger(Type type) { return(_factory.CreateLogger(type)); }
protected MongoRepository(ILogFactory logFactory, IMongoContextFactory contextFactory, string loggerName) { Logger = logFactory.CreateLogger(loggerName); _contextFactory = contextFactory; }
/// <summary> /// Get logger. /// </summary> /// <param name="loggerName">Logger name.</param> /// <returns>Logger.</returns> public static ILog GetLogger(string loggerName) { return(loggers.GetOrAdd(loggerName, name => logFactory.CreateLogger(name))); }
/// <summary> /// Create a new logger. /// </summary> /// <returns>Logger for the specified type;</returns> public static ILogger CreateLogger <T>() { return(_factory.CreateLogger(typeof(T))); }
protected Repository(ILogFactory logFactory, IContextFactory contextFactory, string loggerName) : this(logFactory.CreateLogger(loggerName), contextFactory) { }
public HomeController(IExternalDataService externalDataService, ILogFactory logFactory) { this.externalDataService = externalDataService; logService = logFactory.CreateLogger <AccountController>(); }
private QueueService(ILogFactory logFactory) { _logger = logFactory.CreateLogger("QueueService"); }
private TableRepository(ILogFactory logFactory) { _logger = logFactory.CreateLogger("TableRepository"); }
/// <summary> /// Create a new logger or get the default logger. /// </summary> /// <returns>Create a new logger or get the default logger.</returns> public static ILogger CreateLogger() { return(_factory.CreateLogger()); }
public InstrumentedAuthorizationService(IAuthorizationService underlyingAuthService, ILogFactory logFactory) { _underlyingAuthService = underlyingAuthService; _logger = logFactory.CreateLogger(); }
/// <summary> /// Initializes a new instance of the <see cref="HealthChecker" /> class. /// </summary> /// <param name="logFactory">The logger.</param> public HealthChecker(ILogFactory logFactory) { logger = logFactory.CreateLogger <HealthChecker>(); this.timeout = TimeSpan.FromSeconds(5); }
private BlobRepository(ILogFactory logFactory) { _logger = logFactory.CreateLogger("BlobRepository"); }
internal static ILog CreateLogger(Type type) { return(logFactory.CreateLogger(type)); }