public TomatoLogClientRedisTest() { EventRedisOptions options = new EventRedisOptions { Channel = "TomatoLogChannel", ConnectionString = "127.0.0.1:6379,defaultDatabase=10,password=123456", Logger = null, LogLevel = Microsoft.Extensions.Logging.LogLevel.Information, ProjectLabel = "20272", ProjectName = "TomatoLog-Server", SysOptions = new EventSysOptions { EventId = true, IP = true, IPList = true, MachineName = true, ProcessId = true, ProcessName = true, ThreadId = true, Timestamp = true, UserName = true }, Tags = null, Version = "1.0.1" }; client = new TomatoLogClientRedis(options); }
public TomatoLogClientRabbitMQTest() { EventRabbitMQOptions options = new EventRabbitMQOptions { Logger = null, LogLevel = Microsoft.Extensions.Logging.LogLevel.Information, ProjectLabel = "20272", ProjectName = "TomatoLog", SysOptions = new EventSysOptions { EventId = true, IP = true, IPList = true, MachineName = true, ProcessId = true, ProcessName = true, ThreadId = true, Timestamp = true, UserName = true }, Tags = null, Version = "1.0.1", Exchange = "TomatoLog-Exchange", ExchangeType = "direct", Host = "127.0.0.1", Password = "******", Port = 5672, QueueName = "TomatoLog-Queue", RouteKey = "All", UserName = "******", vHost = "TomatoLog" }; client = new TomatoLogClientRabbitMQ(options); }
public TomatoLogClientKafkaTest() { var options = new EventKafkaOptions { Logger = null, LogLevel = Microsoft.Extensions.Logging.LogLevel.Information, ProjectLabel = "20272", ProjectName = "TomatoLog", SysOptions = new EventSysOptions { EventId = true, IP = true, IPList = true, MachineName = true, ProcessId = true, ProcessName = true, ThreadId = true, Timestamp = true, UserName = true }, Tags = null, Version = "1.0.1", BootstrapServers = "127.0.0.1:9092", Topic = "TomatoLog" }; client = new TomatoLogClientKafka(options); }
public static ILoggerFactory UseTomatoLogger(this ILoggerFactory factory, ITomatoLogClient logClient) { if (logClient == null) { throw new ArgumentNullException(nameof(logClient)); } factory.AddProvider(new TomatoLogClientLoggerProvider(logClient)); return(factory); }
public HomeController(ILogger <HomeController> logger, ITomatoLogClient logClient) { this.logger = logger; this.logClient = logClient; }
public static void Set(ITomatoLogClient client, LogFlowTypes flowType) { CachedClient = client ?? throw new ArgumentNullException(nameof(client)); FlowType = flowType; }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory factory, ITomatoLogClient logClient) { factory.UseTomatoLogger(logClient); if (env.EnvironmentName == Environments.Development) { app.UseDeveloperExceptionPage(); } app.UseEndpoints(endpoints => { endpoints.MapControllerRoute( name: "default", pattern: "{controller=Home}/{action=Index}/{id?}"); }); }
public TomatoLogClientLoggerProvider(ITomatoLogClient logClient) { this.logClient = logClient; loggers = new ConcurrentDictionary <string, TomatoLogClientLogger>(); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory factory, ITomatoLogClient logClient) { factory.UseTomatoLogger(logClient); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } app.UseMvc(); }
public HomeController(ITomatoLogClient logClient) { this.logClient = logClient; }