Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nested LoggerChains causing big call stack #72

Merged

Conversation

acanicatti
Copy link
Contributor

See Issue 70. LoggerChains are nested inside each other and when Doctrine calls startQuery on the EntityManager's SQLLogger, the LoggerChains will create call stacks for each nest. If xdebug is enabled, once the call stack reaches the "max_nesting_level", an Exception will be thrown.

This code flattens the EntityManager's SQLLogger by detecting if it is already a LoggerChain and if so only appending the AuditLogger created.

…ding AuditLogger. Also added null check to AuditHelper
Copy link
Owner

@DamienHarper DamienHarper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some tests are failing

src/DoctrineAuditBundle/Helper/AuditHelper.php Outdated Show resolved Hide resolved
Copy link
Owner

@DamienHarper DamienHarper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just have a look at my last comments and I think it will be all good

@acanicatti
Copy link
Contributor Author

Made the changes requested. Let me know if everything looks alright! Thanks!

Copy link
Owner

@DamienHarper DamienHarper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this contribution, I'll change the strict type comparison on my own ;)

@DamienHarper DamienHarper merged commit 9edf428 into DamienHarper:master Sep 5, 2019
@DamienHarper DamienHarper added the enhancement New feature or request label Oct 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants