forked from MDCPS/DamageAssessment_Backend
		
	added log changes to store in a file
This commit is contained in:
		| @ -25,7 +25,10 @@ | ||||
|     <PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.21" /> | ||||
|     <PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.5" /> | ||||
|     <PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="7.0.5" /> | ||||
|     <PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" /> | ||||
|     <PackageReference Include="Microsoft.Extensions.Logging.Console" Version="8.0.0" /> | ||||
|     <PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.19.4" /> | ||||
|     <PackageReference Include="Serilog.Extensions.Logging.File" Version="3.0.0" /> | ||||
|     <PackageReference Include="Swashbuckle.AspNetCore" Version="6.2.3" /> | ||||
|   </ItemGroup> | ||||
|  | ||||
|  | ||||
| @ -14,7 +14,11 @@ builder.Services.AddCors(p => p.AddPolicy("DamageAppCorsPolicy", build => { | ||||
| })); | ||||
| // Add services to the container. | ||||
| var authkey = builder.Configuration.GetValue<string>("JwtSettings:securitykey"); | ||||
|  | ||||
| builder.Services.AddLogging(builder => | ||||
| { | ||||
|     //builder.AddConsole(); // Optional: Add other providers if needed | ||||
|     builder.AddFile("logs/Locations-{Date}.txt"); // Specify the file path and format | ||||
| }); | ||||
| builder.Services.AddAuthentication(item => | ||||
| { | ||||
|     item.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme; | ||||
|  | ||||
		Reference in New Issue
	
	Block a user