Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Display long strings in log contexts without trimming them #20371

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

Closed
javiereguiluz opened this issue Oct 31, 2016 · 2 comments
Closed

Display long strings in log contexts without trimming them #20371

javiereguiluz opened this issue Oct 31, 2016 · 2 comments

Comments

@javiereguiluz
Copy link
Member

After upgrading to Symfony 3.2-beta1, I realized that some strings in log contexts are being trimmed:

long_message

I find this behavior annoying and unnecessary. If I click on the "Show context" log, there is no need to save space trimming long strings because I want to get all the information to solve the problem as quickly as possible. Maybe it's a good idea to trim absurdly long strings (10,000 characters?) but the rest of strings should be displayed unmodified.

@ogizanagi
Copy link
Contributor

ogizanagi commented Nov 1, 2016

@javiereguiluz : You've labelled this issue with VarDumper. But a quick solution would be to increase the maximum number of chars before the HtmlDumper trims string, in the WebProfilerExtension from the WebProfilerBundle.
AFAIK, you can do so by simply changing the value of the maxStringLength option (which defaults to 160 chars) by calling HtmlDumper::setDisplayOptions, or rather by adding it to the method call in the service definition insideWebProfilerBundle/Resources/config/profiler.xml.

Would increasing this option to an higher value be enough, or do you think it requires a different feature from the HtmlDumper in order to only trim absurdly long strings (and let other ones unchanged)?

@javiereguiluz
Copy link
Member Author

@ogizanagi thanks for your comment. I like your proposal a lot. I'm trying to fix this in #20380.

nicolas-grekas added a commit that referenced this issue Nov 2, 2016
…luz)

This PR was merged into the 3.2-dev branch.

Discussion
----------

Don't trim long strings in the profiler logs

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #20371
| License       | MIT
| Doc PR        | -

Commits
-------

7a17080 Don't trim long strings in the profiler logs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants