dotnet / dotnet/EntityFramework.Docs

"Logging to a file"

Open
#3,906 0 comments 0 reactions 0 assignees View on GitHub
area-interceptors
Dominant language
Mermaid
Stars
1.7k
Forks
2k
Avg merge
7d 23h
Merged PRs (30d)
16

Description

Thank you for a great article.

For the section "Logging to a file", two suggestions:

1. For the definition of _logStream, use a path for mylog.txt that would make the log file easy to find. When I just used the name of a file, as in the example, the file was created in the /bin/Debug/net6.0 subfolder of the project, which was not visible in Solution Explorer (of VS 2022).

2. In the sample code, add the line "GC.SuppressFinalize(this);" to each Dispose() function.
---
#### Document Details

⚠ *Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.*

* ID: f2643b9b-117a-8cd8-6b26-8a7ebf43cd78
* Version Independent ID: ab4359e9-9fc2-437a-d586-f580d6e7c4f9
* Content: [Simple logging - EF Core](https://docs.microsoft.com/en-us/ef/core/logging-events-diagnostics/simple-logging)
* Content Source: [entity-framework/core/logging-events-diagnostics/simple-logging.md](https://github.com/dotnet/EntityFramework.Docs/blob/main/entity-framework/core/logging-events-diagnostics/simple-logging.md)
* Product: **entity-framework**
* Technology: **entity-framework-core**
* GitHub Login: @ajcvickers
* Microsoft Alias: **avickers**

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.