Output logging
See original GitHub issueHey,
I’m trying to use the new Python runtime and managed to get to a point where I’m now running python 3.6.4, I managed to install dependencies via requirements.txt
and my function runs. This was already quite a bit of trial and error.
However, I can’t seem to get the function to log anything to the output stream.
import json
import requests
import os
def main(req):
postreqdata = json.loads(open(os.environ['req']).read())
print(postreqdata)
logger.info(postreqdata)
logger.info("hey")
The output only shows
2018-03-13T04:17:31.125 [Info] Function started (Id=296e75cd-1cf1-45cd-80f9-9d8599513db6)
2018-03-13T04:17:33.297 [Info] Function completed (Success, Id=296e75cd-1cf1-45cd-80f9-9d8599513db6, Duration=2179ms)
Any pointers?
Thanks!
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:22 (3 by maintainers)
Top Results From Across the Web
Logging HOWTO — Python 3.11.1 documentation
Display console output for ordinary usage of a command line script or program · Report events that occur during normal operation of a...
Read more >Logging in Python - Real Python
Learn why and how to get started with Python's powerful logging module to meet the needs ... The Logging Module; Basic Configurations; Formatting...
Read more >Python Logging Basics - The Ultimate Guide To Logging
In the case of running Python in containers like Docker, logging to standard output is often the easiest move as this output can...
Read more >Logging in Python - GeeksforGeeks
Python has a built-in module logging which allows writing status messages to a file or any other output streams. The file can contain...
Read more >logging - Making Python loggers output all messages to stdout ...
All logging output is handled by the handlers; just add a logging.StreamHandler() to the root logger. Here's an example configuring a stream ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@1st1 sorry, took me a few days to get back to this. I also still don’t see any log output.
I created the Function via the portal by creating an “experimental python” function. All I did was follow the portal to create the function, nothing else. If the expectation is that users need to do more or something else then please remove the ability to create a python function via the UI.
The PR has been merged to the
dev
branch.