-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Exposing a way to consumers to choose where to save the logs instead of defaulting always to os.Stdout #4371
Comments
I doubt we'll do that. Streaming logs into files creates major headaches for the app developers because then they have another problem on their hands: log rotation and dealing with open FDs etc...if you want to capture the log into a file use redirect operator 🤷♂️ |
Hi @milosgajdos, Thanks for your answer. I am not sure if using a redirect operator suits some use cases. Let me give more context so you can tell me if redirect operator suits or not. Use Case: A command line tool which start The command line has their own logs being printed in the os.Stdout, printing the command line logs + the registry logs together in the same os.Stdout makes the output really confusing, making the command line logs unusable. How is it possible to identify which logs are from the registry (distribution/distribution) in a code level in order to redirect them using the operator to a file? |
I didn't say a redirect operator will solve whatever issues you might face -- I merely offered it as an option to save stdout into a file if you need to.
This is a very strong statement 😄 |
Hi @milosgajdos, I only said Is there a way to identify which logs comes from the registry ? If yes then I can use the redirect operator to save the registry logs to a file. Don't you think this is a use case for others distribution/distribution consumers? From my perspectives consumers who are importing distribution/distribution on their code will usually face the same. |
I'm not sure off the top of my head. I'd have to verify that.
I actually don't. You are the first one (probably ever) who's asked for this 🤷♂️ |
Description
In v3.0.0-alpha.1 dcontext package was moved to the internal folder. Because of that it is not possible to choose what is the file to save the logs anymore.
It was possible before by using the following code:
I think exposing to consumers a way to choose where to save the logs is a valuable feature. In case there are other ways to do that using the current v3.0.0-alpha.1 please let me know.
The text was updated successfully, but these errors were encountered: