Logging to stdout/stderr

175 views
Skip to first unread message

Piotr Deszyński

unread,
Mar 1, 2013, 4:14:40 AM3/1/13
to pha...@googlegroups.com
Hello,

I would like to make error handling for Phalcon App using Logger Multiple, but it seems impossible. Whether is really simple to log something using File Adapter, then Stream adapter doesn't look like it's usable. I see also that printing/echoing from the any place in Phalcon is also impossible.

Is there a way to disable Phalcon magick which is done behind the scenes and allow to var_dump/print/echo and also use the Stream Adapter?

Best regards

Andres Gutierrez

unread,
Mar 2, 2013, 10:23:00 PM3/2/13
to pha...@googlegroups.com
There is no Phalcon magic to avoid that output will be printed on the screen. 

Check out this controller: 


You can see that running here:


The stderr stream normally sends output to the web server logger. The output stream is the same as an echo/print.

2013/3/1 Piotr Deszyński <desz...@red-sky.pl>

--
You received this message because you are subscribed to the Google Groups "Phalcon PHP Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phalcon+u...@googlegroups.com.
To post to this group, send email to pha...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/phalcon/-/t_rX-d1IUGcJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Piotr Deszyński

unread,
Mar 5, 2013, 2:30:18 AM3/5/13
to pha...@googlegroups.com, andres.g...@phalconphp.com
That's true, if there is no view used. If I'm using view (php templates) then there's no possibility to send any output into php://stdout/stderr (I've tried putting also var_dump inside index controller inside the https://github.com/phalcon/album-o-rama application). I'm using phalcon v1.0

Best regards.

Andres Gutierrez

unread,
Mar 5, 2013, 2:57:35 PM3/5/13
to pha...@googlegroups.com
You need to tell the view component where to put the output produced in the controller. In Volt you can use {{ content() }}, in php templates <?php echo $this->getContent(); ?>

https://github.com/phalcon/album-o-rama/blob/master/apps/frontend/views/catalog/artist.volt#L1

Album O'Rama has also an agressive cache, if you're developing with this base is better remove it:

To view this discussion on the web visit https://groups.google.com/d/msg/phalcon/-/8GZQIH-DpRgJ.

Piotr Deszyński

unread,
Mar 6, 2013, 1:51:25 AM3/6/13
to pha...@googlegroups.com, andres.g...@phalconphp.com
I thought it's the only possible option. It would be great if there was a possibility to disable output buffering from controller completely (for e.g. for developing purposes). Putting inside the templates <?php echo $this->getContent(); ?> just to see some additional messages (like debug messages) just doesn't feel right for me. Thanks fr the answer thought!

Best regards
Reply all
Reply to author
Forward
0 new messages