Updated
This commit is contained in:
		| @@ -6,6 +6,11 @@ | ||||
|     <ImplicitUsings>enable</ImplicitUsings> | ||||
|   </PropertyGroup> | ||||
|  | ||||
|   <ItemGroup> | ||||
|     <PackageReference Include="EonaCat.Web.Tracer" Version="1.0.0" /> | ||||
|     <PackageReference Include="Microsoft.AspNetCore.Http" Version="2.2.2" /> | ||||
|   </ItemGroup> | ||||
|  | ||||
|   <ItemGroup> | ||||
|     <Reference Include="EonaCat.Logger"> | ||||
|       <HintPath>..\..\..\EonaCat.Logger\EonaCat.Logger\bin\Debug\netstandard2.0\EonaCat.Logger.dll</HintPath> | ||||
|   | ||||
| @@ -1,14 +1,18 @@ | ||||
| using EonaCat.Logger; | ||||
| using EonaCat.Logger.Extensions; | ||||
| using EonaCat.Logger.Managers; | ||||
| using EonaCat.Web.Tracer; | ||||
| using EonaCat.Web.Tracer.Extensions; | ||||
| using System.Diagnostics; | ||||
|  | ||||
| var builder = WebApplication.CreateBuilder(args); | ||||
|  | ||||
| // Add services to the container. | ||||
| FileLoggerOptions options = new FileLoggerOptions(); | ||||
| options.MaxRolloverFiles = 5; | ||||
| options.FileSizeLimit = 1 * 1024 * 1024 / 4; | ||||
| builder.Logging.AddEonaCatFileLogger(fileLoggerOptions: options, filenamePrefix:"web"); | ||||
| //FileLoggerOptions options = new FileLoggerOptions(); | ||||
| //options.MaxRolloverFiles = 5; | ||||
| //options.FileSizeLimit = 1 * 1024 * 1024 / 4; | ||||
| //builder.Logging.AddEonaCatFileLogger(fileLoggerOptions: options, filenamePrefix:"web"); | ||||
|  | ||||
| builder.Services.AddRazorPages(); | ||||
|  | ||||
| var app = builder.Build(); | ||||
| @@ -21,6 +25,15 @@ if (!app.Environment.IsDevelopment()) | ||||
|     app.UseHsts(); | ||||
| } | ||||
|  | ||||
| WebTracer.OnLog += WebTracer_OnLog; | ||||
|  | ||||
| void WebTracer_OnLog(object? sender, string e) | ||||
| { | ||||
|     Console.WriteLine(e); | ||||
| } | ||||
|  | ||||
| app.UseWebTracer(); | ||||
|  | ||||
| app.UseHttpsRedirection(); | ||||
| app.UseStaticFiles(); | ||||
|  | ||||
| @@ -50,7 +63,7 @@ void RunLoggingExceptionTests() | ||||
|     } | ||||
| } | ||||
|  | ||||
| Task.Run(RunWebLoggingTests); | ||||
| //Task.Run(RunWebLoggingTests); | ||||
| //Task.Run(RunLoggingTests); | ||||
| //Task.Run(RunLoggingExceptionTests); | ||||
| //Task.Run(RunWebLoggingExeptionTests); | ||||
|   | ||||
							
								
								
									
										5
									
								
								EonaCat.Logger.Web/EonaCat.Logger.Web/libman.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								EonaCat.Logger.Web/EonaCat.Logger.Web/libman.json
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,5 @@ | ||||
| { | ||||
|   "version": "1.0", | ||||
|   "defaultProvider": "cdnjs", | ||||
|   "libraries": [] | ||||
| } | ||||
		Reference in New Issue
	
	Block a user