Mask senstive data or secrets in container logs

Hey everyone,
I am working on a docker container and if let’s say any developer prints any secrets or sensitive data on the console then that information would be logged into the docker container and anyone can see that.

So, is there something in docker we can implement and mask those secrets some patterns with ******* this kind of patterns?

You might want to raise an issue in the Moby github repo for this: Issues · moby/moby · GitHub

I’d say this is something that needs to be implemented in the image (for the application that will be running when a container is created from it). Docker itself has no way to figure what should be considered as secret and masqueraded in the output.