Logs in context not showing up

We have a Python agent set up for our Heroku app and we are seeing Errors being correctly captured from our web workers as well as celery workers. We also have logging set up along with the proper tracing (application logs contain trace.id correctly). Our problem is that if we look at any Error captured we don’t see the associated logs - the error message says:

We couldn’t find logs for this trace.

If I manually search logs for the same trace.id I can find it just fine - albeit I have to search for it in the specific log partition, not the default one.

Am I missing something in our config?

Hello @dionysio ,

It would be difficult to advise you on this high level question without reviewing the configuration. Would you be able to send a screenshot of when you receive the
We couldn’t find logs for this trace. message?

Please make sure to obfuscate any sensitive information if you do send a screenshot.

You could review the Python agent and Heroku documentation to check your setup.

Here are some useful troubleshooting cli commands:

heroku run env | grep NEW_RELIC
heroku ps:exec -a $APPNAME
heroku logs -t | tee newrelic.log

I hope this helps.

Hi cconde,

Let me give you some more specifics.

here’s the view from the Error Inbox:

and here’s what shows up, if I click on “View in logs” , but then select the correct log partition:

The exception and the log item also correspond based on the Heroku’s request_id.

I can see NEW_RELIC_LICENSE_KEY and NEW_RELIC_LOG env variables are set correctly. Also the heroku app is logging correctly, I can see new relic agent starting up and working whenever the dyno boots up. We are using the newrelic.agent.WSGIApplicationWrapper since we are using unsupported framework. We’re also calling newrelic.agent.record_exception whenever necessary.