I’m working on an ORM that allows you to query multiple databases — the idea being that read queries go to replicas and write queries go to the primary. I also want to make sure that you can read your own writes to avoid race conditions where you query the replica before a write has been replicated, but I can’t tell from the logs which database is being queried since
DB only configures a single logger.
I also think it’d be useful to aggregate logs to see what the split is between reads and writes.
In this case, would it make sense not to use
DB::Log and instead set up my own loggers for reads vs writes or is there a way to distinguish them better with what already exists?