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

How to dynamically disable a specific Sink from configuration? #370

Open
pedoc opened this issue Mar 26, 2023 · 0 comments
Open

How to dynamically disable a specific Sink from configuration? #370

pedoc opened this issue Mar 26, 2023 · 0 comments

Comments

@pedoc
Copy link

pedoc commented Mar 26, 2023

An minimal example configuration is as follows:

{
    "Serilog": {
        "WriteTo": [
            {
                "Name": "Async",
                "Args": {
                    "BufferSize": 512,
                    "Configure": [
                        {
                            "Name": "Console",
                            "Args": {
                                "outputTemplate": "[{Timestamp:HH:mm:ss.fff} {Level:u3}] {Message:lj} <s:{SourceContext}>{NewLine}{Exception}"
                            }
                        },
                        {
                            "Name": "Debug",
                            "Args": {
                                "outputTemplate": "[{Timestamp:HH:mm:ss.fff} {Level:u3}] {Message:lj} <s:{SourceContext}>{NewLine}{Exception}"
                            }
                        }
                    ]
                }
            }
        ]
    }
}

I want to disable Console Sink when Environment.UserInteractive=false,How should it be configured?

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant