[DBAL-436] Logger should specify connection used in a master/slave situation Created: 31/Jan/13  Updated: 01/Apr/13  Resolved: 01/Apr/13

Status: Resolved
Project: Doctrine DBAL
Component/s: None
Affects Version/s: 2.3.2
Fix Version/s: 2.3.3
Security Level: All

Type: Bug Priority: Major
Reporter: Jarrod Nettles Assignee: Benjamin Eberlei
Resolution: Invalid Votes: 0
Labels: None


 Description   

Suppose there is a master connection with four slaves specified. Connections are being handled by the Doctrine\DBAL\Connections\MasterSlaveConnection class. Under the current implementation, all queries are logged under the "master" connection, even queries that are routed to the slaves by the Doctrine\DBAL\Connections\MasterSlaveConnection class.

Since slave connections are separate, distinct connections, queries should be logged appropriately under their respective connections.



 Comments   
Comment by Benjamin Eberlei [ 01/Apr/13 ]

Two reasons why this is not feasible:

1. We actually don't ship loggers on our own, so if you want you can implement this yourself. We wouldn't have a way to "add" this, we only provide the interface.

2. However the logger does not have access to the connection to find out which slave or master its currently using, you can create a logger that has a "setConnection($conn)" method and call this during bootstrapping the logger+connection.

Generated at Sun Dec 21 02:01:11 UTC 2014 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.