Forum


Replies: 1   Views: 899
How to enable logging
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by victo.paraschiv  · 27-05-2021 - 15:07

Hi all,

I have an embed HTML with a large HTML payload that takes about 15 seconds, I was going to take a look at PHPDOCX to find the bottleneck and think about how I might speed things up.

I can't find any posts about how to enable phpdocx logging, can you help? (I'm assuming the logging will help me close in on the slow section of the code)

Posted by admin  · 27-05-2021 - 15:35

Hello,

On https://www.phpdocx.com/documentation/introduction/tutorial (Appendix: debugging options section) you can read how to enable logging messages. You just need to inject a PSR-3 logger.

Anyway, logging messages illustrate how the DOCX is being created but they won't help to improve the performance. Please check the following information about improving the perfomance:

The most important tips are using phpdocx 9.5 or newer, use php 7 or newer and  use several HTML contents instead of a huge HTML. Because the HTML needs to be parsed, analyzed and transformed, so huge HTML contents may take more time to be transformed.

Regards.