Log Management With Papertrail

A simpler way of logging

App developer or system administrator need to keep track and monitor all the behaviour that is happening in their application or server. So logging plays vital role for debugging any future bug or any event triggered. Sometime managing those logs is troublesome when the app is in production with thousands of users. Hence papertrail is one solution for easy log management.

Papertrail manage logs seamlessly from apps, servers, and cloud services. It provides a smooth and intuitive user interface and contains charts and analytics exports along with monitoring webhooks. Some key feature is listed below.

  • All app logs, text log files, and syslog at one place
  • Realtime log with pause, search, infinite scroll, alerts, and clickable log elements.
  • Any useful logs can be saved for future quick access
  • Less technical staff can view logs without any SSH/RDP knowledge or access
  • Search hours of logs typically in seconds and jump to a specific time (in 2 clicks).
  • Log Velocity Analytics provides a quick visualization of log throughput for new or saved searches. It helps identify patterns or anomalies, further reducing the time to troubleshoot errors.

Papertrail aggregates syslog, Routers & firewalls, Text log files, Ruby on Rails, MySQL, Windows events, Cloud hosting, Tomcat, Apache, Heroku apps and so on. Papertrail

Integrate System Log

Run the install script

wget -qO - --header="X-Papertrail-Token: kfjZTymxGUNzAo2lE" \
https://papertrailapp.com/destinations/26929081/setup.sh | sudo bash

This script will make the syslog daemon send logs to Papertrail (and ask for your confirmation).

Integrate in Laravel

Larave has inbuilt support for papertrail. Copy URL and PORT from Papertrail Log destination and use in the .env variables PAPERTRAIL_URL and PAPERTRAIL_PORT. Also change log channel to papertrail.

.env file

LOG_CHANNEL=papertrail
PAPERTRAIL_URL=logs3.papertrailapp.com
PAPERTRAIL_PORT=11111

Now you can simply view log in papertrail dashboard.