Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Internal Logs created in wrong location #171

Closed
DarkMio opened this issue Mar 4, 2022 · 3 comments
Closed

Internal Logs created in wrong location #171

DarkMio opened this issue Mar 4, 2022 · 3 comments

Comments

@DarkMio
Copy link

DarkMio commented Mar 4, 2022

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
@nblumhardt
Copy link
Member

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

@nblumhardt nblumhardt added the bug label Jul 14, 2022
@nblumhardt
Copy link
Member

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 nblumhardt added discussion and removed bug labels Sep 12, 2022
@KodrAus
Copy link
Member

KodrAus commented Jun 12, 2024

Just coming back through some triage. It's been a while since we've had any activity on this issue and couldn't reproduce ourselves so I'll go ahead and close this one.

Please feel free to re-open or log any new issues if you're still hitting unexpected behavior.

@KodrAus KodrAus closed this as completed Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants