Heroku receives everything that your app sends to standard output (also
known as stdout), so the key question is how to send Python logs to
standard out.
Depending on the framework(s) you're using, here's 2 ways to do that:
 * A very short way to force `logging` to use sys.stdout:
   https://coderwall.com/p/_fg97w/creating-a-python-logger-to-stdout
 * A more elegant/idiomatic way to use a stdout-backed `logging`
   handler:
   
http://help.papertrailapp.com/kb/configuration/configuring-centralized-logging-from-python-apps/#logging-via-the-heroku-add-on
Note that, if you're calling `logging.warning` (instead of, say,
`logging.error`), you'll also need to set the level to at least
`warning` (or to a more verbose level like `info` or `debug`). The
examples above show how to specify the level at instantiation.
Troy


On Sat, May 13, 2017, at 05:20 PM, Marcio Valenzuela wrote:
> I can see:
> 
> console.log('something to log'); from my app.js
> 
> which show up as:
> 
> something to log
> 
> But that app.js runs python scripts based on a switch case
> where I use:> 
> 
> 
> import logging
> 
>
>
> logging.warning('2gpio pin toggle!') # will print a message to
> the console> 
> but this doesnt show up in the heroku logs.  How can I see that that
> script got called?> 
> Thanks
> 
> 


> --
>  -- 
>  You received this message because you are subscribed to the Google
>  Groups "Heroku" group.
>   
>  To unsubscribe from this group, send email to
>  heroku+unsubscr...@googlegroups.com
>  For more options, visit this group at
> http://groups.google.com/group/heroku?hl=en_US?hl=en
> 
>  --- 
>  You received this message because you are subscribed to the Google
>  Groups "Heroku Community" group.>  To unsubscribe from this group and stop 
> receiving emails from it,
>  send an email to heroku+unsubscr...@googlegroups.com.>  For more options, 
> visit https://groups.google.com/d/optout.

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Heroku" group.

To unsubscribe from this group, send email to
heroku+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/heroku?hl=en_US?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"Heroku Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to heroku+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to