DataDogAuditBundle
DataDogAuditBundle copied to clipboard
[Feature Request] Async
Hi,
Is it possible to forward the logging to queue system (for example rabbitmq)? I'm afraid that flushing the logs on the same transaction will slow it down. By forwarding it to queue system on post flush, it will fasten the process while still have the logging feature.
Thanks.
Hi, all audit logs are always committed within the same database transaction, when flush is invoked.
What it means is, that everything will be atomic (if something fails to be written in database, everything fails) you will never anticipate data inconsistency if you will perform only one flush during a HTTP request, which is of course how everything should be done. Also the speed of executing single transaction is almost the same as without audit logs.
Please make performance tests to have an argument, that audit logs make your transaction reasonably slower. Being afraid is not a good argument, I suggest to be more careful with premature abstraction and usage with queues, queues add way more complexity. In case if you decide that you need async anyway, then just fork it.