-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Allow configuring W3CLogging to write to stdout #42489
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
Comments
Triage: seems like a reasonable ask, but we'd need to figure out the right API design (maybe a |
This would be very helpful!!! |
I would also find value in this. |
Unfortunately we weren't able to get to this in .NET 8 and we're locking down for release now. I'm going to move it into the .NET 9 milestone. If anyone would like to propose a design or implementation, please let us know. |
Thanks for contacting us. We're moving this issue to the |
I would like to have this feature. Some kind of configurable system, so I can log to file/stdout or write my own logger (to send to centralized log management) |
this one would be awesome! Any work around in the meantime? |
+1 |
Is there an existing issue for this?
Is your feature request related to a problem? Please describe the problem.
I am trying to configure the W3CLogging to write to stdout instead of a file on disk, since this is a best practice when running applications in a Docker container. I tried the following, but it doesn't quite work because it ultimately is trying to write to /dev/stdout/w3clog-20220629.0000.txt, for example, which isn't a valid location on Linux:
Is there some way to have the W3C logs write to stdout instead of a file on disk?
Describe the solution you'd like
It seems like if we could configure the W3CLogger to not rotate files but always write to a specific "file", that would solve this for us. Something like this, perhaps:
By setting
StaticFileName
, this would override the normal behavior you get when settingFileName
andLogDirectory
, and would ignoreRetainedFileCountLimit
andFileSizeLimit
. New logs would just be written directly to whatever file you defined by StaticFileName, which in our case could be /dev/stdout, which is the standard Linux "file" that represents stdout.If this idea doesn't really pan out, alternatively, could a separate "mode" be added to the W3CLogger that just tells it to write to stdout? Perhaps something like this:
Additional context
No response
The text was updated successfully, but these errors were encountered: