I'm trying to write to the error log (sys.stderr) using the code below. In this example I trigger the write by sending a GET request to my app's home URL. When I do this, the error log immediately fills up with a massive amount of text and causes a 502 error. This same code is working fine on my development server, so not sure why it's causing problems on PA. Insights much appreciated!
logger = logging.getLogger()
handler = logging.StreamHandler(stream=sys.stderr)
logger.addHandler(handler)
logger.setLevel(logging.DEBUG)
logger.debug("Debug message")