Skip to content

Fallback to line formatter on missing cli dumper #145

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
wants to merge 1 commit into from

Conversation

greg0ire
Copy link
Contributor

@greg0ire greg0ire commented Aug 3, 2017

The ConsoleFormatter is not so great when it does not come configured
with a dumper. A better fix might be to provide a poor man's dumper when
the var dumper component is not installed.

Q A
License MIT

symfony-bot
symfony-bot previously approved these changes Aug 3, 2017
@javiereguiluz
Copy link
Member

Some context: the original issue was that the application didn't have VarDumper installed and then the logs were poorly formatted: no context, no extra, etc.

The ConsoleFormatter is not so great when it does not come configured
with a dumper: context and extra keys are not shown at all. A better fix
might be to provide a poor man's dumper when the var dumper component is
not installed.
@greg0ire
Copy link
Contributor Author

greg0ire commented Aug 3, 2017

@javiereguiluz I added more context in the commit message.

@sroze
Copy link
Contributor

sroze commented Aug 3, 2017

Shouldn't this be directly managed in MonologBundle?

@greg0ire
Copy link
Contributor Author

greg0ire commented Aug 3, 2017

@sroze you mean like this?

A better fix might be to provide a poor man's dumper when
the var dumper component is not installed.

Or should ConsoleHandler::getDefaultFormatter() be changed?

@fabpot
Copy link
Member

fabpot commented Sep 11, 2017

I would indeed fix this issue upstream, instead of adding a workaround here.

@nicolas-grekas
Copy link
Member

ping @greg0ire

@greg0ire
Copy link
Contributor Author

@nicolas-grekas I'll try to have a look at that soonish

@greg0ire
Copy link
Contributor Author

@nicolas-grekas here you go: symfony/symfony#24598

@greg0ire greg0ire closed this Oct 19, 2017
@greg0ire greg0ire deleted the formatter_fallback branch October 19, 2017 19:52
nicolas-grekas added a commit to symfony/symfony that referenced this pull request Oct 24, 2017
This PR was merged into the 3.3 branch.

Discussion
----------

Prefer line formatter on missing cli dumper

| Q             | A
| ------------- | ---
| Branch?       | 3.3
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | none, but closes symfony/recipes#145
| License       | MIT
| Doc PR        | n/a

The console formatter does a better job, unless the VarDumper component
is missing, in which case the LineFormatter should be preferred.

Commits
-------

574f9f5 Prefer line formatter on missing cli dumper
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants