forked from MDCPS/DamageAssessment_Backend
added log changes to store in a file
This commit is contained in:
@ -19,7 +19,10 @@
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="7.0.9" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.9" />
|
||||
<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>
|
||||
|
||||
|
@ -31,6 +31,11 @@ builder.Services.AddAuthentication(item =>
|
||||
ClockSkew = TimeSpan.Zero
|
||||
};
|
||||
});
|
||||
builder.Services.AddLogging(builder =>
|
||||
{
|
||||
//builder.AddConsole(); // Optional: Add other providers if needed
|
||||
builder.AddFile("logs/answers-{Date}.txt"); // Specify the file path and format
|
||||
});
|
||||
// Add services to the container.
|
||||
|
||||
builder.Services.AddControllers();
|
||||
|
Reference in New Issue
Block a user