static void Main(string[] args) { ILogService logService = new FileLogService(typeof(Program)); logService.Debug("Debug started"); logService.Error("Logging Error"); logService.Fatal("Fatal message"); Console.WriteLine("Fatal message"); Console.WriteLine("Debugging"); Console.ReadLine(); }
static void Main(string[] args) { ILogService logService = new FileLogService(typeof(Program)); HelloWorldServiceClient client = new HelloWorldServiceClient(); logService.Info("Preparing to call the Hello World Service"); Console.WriteLine(client.GetMessage("Console Client App")); logService.Info("Hello World Service has returned"); Console.WriteLine("Log has been written"); Console.WriteLine("Press any key to exit..."); Console.Read(); }
public IList <DTOOrder> GetRecentByDropShipperId(long dropShipperId) { var baseLog = LogManager.GetLogger("RequestLogger"); var log = new FileLogService(baseLog, null); var dbFactory = new DbFactory(); var time = new TimeService(dbFactory); var actionService = new SystemActionService(log, time); var orderHistory = new OrderHistoryService(log, time, dbFactory); var dsService = new DropShipperApiService(log, time, dbFactory, actionService, orderHistory); return(dsService.GetRecentByDropShipperId(dropShipperId)); }
public CallResult UpdateShipments(DTOOrder order) { var baseLog = LogManager.GetLogger("RequestLogger"); var log = new FileLogService(baseLog, null); var dbFactory = new DbFactory(); var time = new TimeService(dbFactory); var actionService = new SystemActionService(log, time); var orderHistory = new OrderHistoryService(log, time, dbFactory); var dsService = new DropShipperApiService(log, time, dbFactory, actionService, orderHistory); return(dsService.UpdateShipments(order)); }
public IList <StyleEntireDto> GetQuantities(int market, string marketplaceId) { var baseLog = LogManager.GetLogger("RequestLogger"); var log = new FileLogService(baseLog, null); var dbFactory = new DbFactory(); var time = new TimeService(dbFactory); var actionService = new SystemActionService(log, time); var orderHistory = new OrderHistoryService(log, time, dbFactory); var dsService = new DropShipperApiService(log, time, dbFactory, actionService, orderHistory); return(dsService.GetQuantities((MarketType)market, marketplaceId)); }
public void TestLog2DB() { // Arrange var testDbPath = @"MyData.db"; File.Delete(testDbPath); var input = FileLogService.LoadFromFile(@"..\..\..\..\..\logfile.txt"); var output = new LogWriterService(testDbPath, "LogEntries"); var service = new LogParsingService(input, output, 4); // Act service.Process(); // Assert var result = output.GetLogEntries(); Assert.IsTrue(result.Count == 3); }
public static void StartService(int port) { try { ILogService logService = new FileLogService(typeof(DataEngine)); logService.Info("启动数据服务引擎..."); // UriBuilder builder = new UriBuilder(Uri.UriSchemeNetTcp, "localhost", port, "/Data"); UriBuilder builder = new UriBuilder(Uri.UriSchemeNetPipe, "localhost"); _host = new ServiceHost(typeof(DataService), builder.Uri); ServiceThrottlingBehavior throttling = _host.Description.Behaviors.Find <ServiceThrottlingBehavior>(); if (throttling != null) { throttling.MaxConcurrentSessions = maxConnections; } else { throttling = new ServiceThrottlingBehavior(); throttling.MaxConcurrentSessions = maxConnections; _host.Description.Behaviors.Add(throttling); } //GlobalErrorBehaviorAttribute errorBehavior = _host.Description.Behaviors.Find<GlobalErrorBehaviorAttribute>(); //if (errorBehavior == null) //{ // _host.Description.Behaviors.Add(errorBehavior); //} _host.AddServiceEndpoint(typeof(IDataService), CommunicationSettingsFactory.CreateDataServicePipeBinding(Timeout), "IDataService"); _host.AddServiceEndpoint(typeof(IPingService), CommunicationSettingsFactory.CreateDataServicePipeBinding(Timeout), "IPingService"); _host.Open(); } catch (Exception ex) { _logService.Error(string.Format("ExistCatch:Error:<-{0}->:{1} \r\n Error detail:{2}", "StartService", ex.Message, ex.ToString())); } }
private void log(LogLevel level, string moduleName, string functionName, string messageType, string message) { FileLogService service = new FileLogService(); service.Log(level, "BS", moduleName, functionName, messageType, message); }
public AppAccessTokenManagerService(DALFacade dALFacade) { _logger = new FileLogService(typeof(IUserManagerService)); _dALFacade = dALFacade; }
public UserRepository(TemplateDBContext context) { _logger = new FileLogService(typeof(IUserRepository)); _context = context; }
public SecurityHelper(BLLFacade bLLFacade) { _logger = new FileLogService(typeof(ISecurityHelper)); _bLLFacade = bLLFacade; }
public RegisterdAppActiveService(BLLFacade bLLFacade) { _logger = new FileLogService(typeof(IRegisterdAppActiveService)); _bLLFacade = bLLFacade; }
public void TestCleanup() { _sut = null; }
public void TestInitialize() { _sut = new FileLogService(); }
public CrewingService(IDbCrewingUnitOfWork crewingUnitOfWork, IMapper mapper) { this.mapper = mapper; uow = crewingUnitOfWork; logService = new FileLogService(); }
public RegisteredAppRepository(TemplateDBContext context) { _logger = new FileLogService(typeof(IRegisteredAppRepository)); _context = context; }
public UserActiveService(BLLFacade bLLFacade) { _logger = new FileLogService(typeof(IUserActiveService)); _bLLFacade = bLLFacade; }
public RegisterdAppManagerService(DALFacade dALFacade) { _logger = new FileLogService(typeof(IUserManagerService)); _dALFacade = dALFacade; }