Skip to content

Commit d8e2db3

Browse files
committed
not logging in file on local environment
1 parent 4d24c0e commit d8e2db3

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ Based on the above configuration, the UI will be accessible at the following URL
274274
- `LogBackend.Loki` (Loki formatter to file), or
275275
- `LogBackend.CompactJson` (compact JSON format to file).
276276
- **Environment-Specific Configuration:**
277-
- **Local:** Logs to console.
277+
- **Local:** Only logs to console even if you choose `LogBackend.Any`.
278278
- **Production:** Logs to file (in ECS or Loki format depending on the backend).
279279
- **Other Environments:** Logs to both console and file.
280280
- **Automatic Log Cleanup:** Log files are automatically cleaned up based on the configured retention period.

src/SharedKernel/Logging/SerilogExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public static WebApplicationBuilder AddSerilog(this WebApplicationBuilder builde
4444

4545
builder.Host.UseSerilog();
4646

47-
if (daysToRetain <= 0 || logBackend == LogBackend.None)
47+
if (daysToRetain <= 0 || logBackend == LogBackend.None || builder.Environment.IsLocal())
4848
{
4949
return builder;
5050
}

0 commit comments

Comments
 (0)