Since you can't inject SF2 services into a Doctrine document, how do you write a log (using monolog) from a document?
Asked
Active
Viewed 150 times
0
-
Why would you want to do that? – Nicolai Fröhlich Jun 28 '13 at 11:00
-
Because I need to log some kind of business logic (yeah, I know and agree, it shouldn't occur there) executed into the document. – David Jun 28 '13 at 11:58
-
what kind of business logic? like logging changes on entities/documents? The only changes you might want to log are ones being persisted to your database afterwards ... those can be logged in a Listener. There is normally no need to have the logger available in your entity. – Nicolai Fröhlich Jun 28 '13 at 12:04