serilog-sinks-seq
serilog-sinks-seq copied to clipboard
Internal Logs created in wrong location
Issue
When developing a serilog configuration including seq, I have encountered that the internal log location gets placed in the wrong folder.
The location of %TMP% is selected fine for the Buffer File, however, the internal log is placed next to the working directory:

Reproduciton
My relevant config
{
"Serilog": {
"Using": [
"Serilog.Sinks.Seq",
"Serilog.Expressions"
],
"MinimumLevel": "Debug",
"WriteTo": [
{
"Name": "Logger",
"Args": {
"configureLogger": {
"Filter": [
{
"Name": "ByExcluding",
"Args": {
"expression": "(StartsWith(SourceContext, 'Microsoft')) and (@l in ['Trace', 'Debug', 'Information'])"
}
}
],
"WriteTo": [
{
"Name": "Seq",
"Args": {
"serverUrl": "<some-uri>",
"apiKey": "<some-api-key>",
"bufferBaseFilename": "%TMP%/Logs/hub-app",
"bufferSizeLimitBytes": 1073741824
}
}
]
}
}
}
]
},
}
I'm not sure if the filter expression is even relevant, but that's the configuration.
I have another problem with the configuration, as sub-directories do not generated in %TMP%/Logs/something/something/hub-app, but I'm not yet sure if that is a plain user-error.
Additional Environment Infos
- Windows 11
- .NET 5.0 + ASPCore 5.0.11 (or so)
- Debug Build
Thanks for the note, I agree that this is confusing, we'll take a look 👍
Hi @DarkMio; just reviewing this one, I can't work out how the sink might be creating those internal-*.log files. I initially thought they must be failed request logs, but all file creation in the sink uses either .clef, .json, or .bookmark extensions.
Is it possible the internal log is being generated via Serilog's SelfLog, somehow? Or if not, can you please send a snippet of content from one of the stray files so we can pinpoint it further? Thanks!