Hi.
I am currently trying to get ray to use my already setup logging pipeline.
We use structlog with a loki handler, file handler and advanced console handler. The python root logger is hijacked, so all libs and modules use out logger, working perfectly
By default ray.init
initialises new logging for ray. Because I already have my logging set up, I want it to not do that.
So by setting configure_logging=False
this can be swtiched off.
But then the log just completely disappears… probably because this is being done?
# Configure the "ray" logger for the driver process.
if configure_logging:
setup_logger(logging_level, logging_format or ray_constants.LOGGER_FORMAT)
else:
logging.getLogger("ray").handlers.clear()
So when the flag is set to false, all handlers are removed from my ray logger. But the log is also not propagated. So no log appears
This all springs from a whole different source though.
We use structured logging, so we use kwargs in our log calls, or the log extras to be backwards compatible, to add more context to our logs. I would like ray to add its extra info (that is currently available in the json logger), to those extras. so actor name, remote method name, etc etc.
How can this be done?
Also how can I ensure that all the ray logs from spawned processes use my logger? I need the logs in our loki server, I dont understand how to provide this logging config correctly.
and last but not least.
Does it make sense to have a names ray actor as logging manager? so all processes use the same logging process? is this a bad idea? how could this be done?