Your data. Anywhere you go.

New Relic for iOS or Android


Download on the App Store    Android App on Google play


New Relic Insights App for iOS


Download on the App Store


Learn more

Close icon

Uwsgi + paste not logging data


#1

Please paste the permalink to the page in question below:

Please share your agent version and other relevant versions below:

python 2.7.3
uwsgi 1.9.14
newrelic==2.60.0.46
Pylons==1.0.1
Paste==1.7.5.1

Please share your question/describe your issue below. Include any screenshots that may help us understand your question:

We are attempting to run newrelic under uwsgi + paste via:
NEW_RELIC_CONFIG_FILE=newrelic.ini newrelic-admin run-program uwsgi --ini production.ini --pidfile /tmp/production.ini.uwsgi.pid --lazy --harakiri-verbose --harakiri 30 --daemonize /tmp/production.ini.uwsgi.log --buffer-size=32768 --enable-threads --single-interpreter

and it is failing to log data.
1/ The test app works fine on the server.
2/ Running test app via paste works fine on dev machine
3/ Running it under uwsgi + debug logs shows modules are being instrumented

Is there an incompatibility between uwsgi + paste?


#2

@joseph2 Thanks for posting to the forum. Yes, we have seen issues where Paste interferes with the Python agent’s logging. If you’re doing something similar to:

from paste.script.util.logging_config import fileConfig
fileConfig(config_filepath)  

You will need to reenable the Python agent’s logging after doing that by doing:

import logging
loggers = logging.root.manager.loggerDict.keys()
newrelic_loggers = [l for l in loggers if l.startswith('newrelic')]
for log in newrelic_loggers:
    logging.root.manager.loggerDict[log].disabled = 0

Something else to keep in mind is that although Pylons is one of our supported web frameworks, we’ve seen cases where it’s necessary to wrap the application entry point in order to see data in the UI.

The cases where we’ve seen it necessary to wrap the application entry point is when using loadapp from paste.deploy and it returns an application object. For example, if you have something along the lines of the following in your deployment script and aren’t seeing data, please try wrapping the application entry point:

from paste.deploy import loadapp
application = loadapp()

Let us know if you have any questions or run into any issues.