Closed iandees closed 4 years ago
I signed up for papertrail.
I added the syslog host/port that they gave to the EC2 box's rsyslog config:
echo "*.* @logs4.papertrailapp.com:1234" > /etc/rsyslog.d/60-papertrail.conf
sudo service rsyslog restart
At this point I started to get messages in papertrail.
I added the following to /etc/rsyslog.d/50-censusreporter-nginx.conf
to poll the access logs and dump them to syslog (and thus to papertrail). From https://petermolnar.eu/log-nginx-to-rsyslog/.
$ModLoad imfile
$InputFileName /var/log/nginx/api.censusreporter.org.error.log
$InputFileTag nginx_error_api:
$InputFileStateFile stat-nginx-error-api
$InputFileSeverity error
$InputFileFacility local6
$InputFilePollInterval 1
$InputRunFileMonitor
$InputFileName /var/log/nginx/api.censusreporter.org.access.log
$InputFileTag nginx_access_api:
$InputFileStateFile stat-nginx-access-api
$InputFileSeverity notice
$InputFileFacility local6
$InputFilePollInterval 1
$InputRunFileMonitor
$InputFileName /var/log/nginx/censusreporter.org.error.log
$InputFileTag nginx_error_django
$InputFileStateFile stat-nginx-error-django
$InputFileSeverity error
$InputFileFacility local6
$InputFilePollInterval 1
$InputRunFileMonitor
$InputFileName /var/log/nginx/censusreporter.org.access.log
$InputFileTag nginx_access_django
$InputFileStateFile stat-nginx-access-django
$InputFileSeverity notice
$InputFileFacility local6
$InputFilePollInterval 1
$InputRunFileMonitor
I also set up a filter in Papertrail to ignore healthcheck requests. There were a bunch of requests that came in from New Relic that were cluttering things up.
Next up here is to: