News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Liip Blog:
New in Symfony 2.4 Show logs in console
August 21, 2013 @ 10:53:44

On the Liip blog they've shared a new post from Tobias Schultze about a new feature that will be in the 2.4 release of the popular Symfony framework - the ability to show log messages in console output.

When you want to output text to the console you usually used the OutputInterface instance that is passed when your command gets executed. But there are two problems: it's cumbersome to print information depending on the verbosity settings and if the service you call also wants to give feedback you would need to pass on the $output. [...] To solve these [two problems] I thought it would be much easier to rely on the logger which is highly related. So I added integration between Symfonys Console Component and Symfonys logging library Monolog in PR #8167.

This gives you a new handler, the ConsoleHandler, that makes it easier to just write out based on console events instead of just appending to the output. It includes switches for verbosity levels too. He shows how to implement it in your application, configuring it through the YAML config both in the service and under the Monolog settings as a handler.

0 comments voice your opinion now!
symfony2 log console command component consolehandler monolog

Link: http://blog.liip.ch/archive/2013/08/20/new-in-symfony-2-4-show-logs-in-console.html

blog comments powered by Disqus

Similar Posts

Zend Developer Zone: Initial Release of Zend_Locale_UTF8

Jani Hartikainen's Blog: The problems faced by a common model interface in frameworks

Lineke Kerckhoffs-Willems' Blog: How to use the Symfony2 SonataAdminBundle

ServerGrove Blog: Symfony2 components overview: Process

Manuel Pichler's Blog: First release of the staticReflection component


Community Events





Don't see your event here?
Let us know!


voicesoftheelephpant language tool opinion security symfony introduction podcast laravel interview library composer version mvc release series update community package framework

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework