serilog-sinks-seq icon indicating copy to clipboard operation
serilog-sinks-seq copied to clipboard

Internal Logs created in wrong location

Open mio-moto opened this issue 3 years ago • 2 comments

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:

image

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

mio-moto avatar Mar 04 '22 09:03 mio-moto

Thanks for the note, I agree that this is confusing, we'll take a look 👍

nblumhardt avatar Mar 04 '22 22:03 nblumhardt

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!

nblumhardt avatar Sep 12 '22 04:09 nblumhardt