Skip to content

Papertrail Log Drain Connection — Quick Fix

DodaTech Updated 2026-06-24 2 min read

In this tutorial, you'll learn about Papertrail Log Drain Connection. We cover key concepts, practical examples, and best practices.

The Problem

Logs are not being sent to Papertrail or are not appearing in the Papertrail UI. The syslog forwarder may fail to connect, TLS may be misconfigured, or the destination endpoint may be incorrect.

Error example:

syslog: connect: connection refused
TLS handshake failed: certificate verify failed
Cannot resolve host: logs2.papertrailapp.com

The Fix

Step 1: Verify the Papertrail endpoint

WRONG — using an old or incorrect Papertrail URL:

# Papertrail provides a unique endpoint for each account

RIGHT — check your Papertrail settings:

# In Papertrail: Settings -> Log Destinations
# The endpoint looks like: logs2.papertrailapp.com:12345

# Test resolution
nslookup logs2.papertrailapp.com

Step 2: Test syslog connectivity

WRONG — forwarding logs without testing the connection:

# Always test connectivity before configuring the daemon

RIGHT — test the endpoint:

# Test TCP connectivity
nc -zv logs2.papertrailapp.com 12345

Output:

Connection to logs2.papertrailapp.com (52.0.0.123) port 12345 [tcp/*] succeeded!

If the connection fails, check your firewall rules for outbound access.

Use DodaTech's Log Drain Health Monitor to test connectivity, validate TLS configurations, and verify log delivery to Papertrail from all your servers.

Prevention Tips

  • Use DNS-based endpoint configuration for automatic failover
  • Enable TLS for syslog forwarding to encrypt log data in transit
  • Configure the local syslog daemon to queue logs if Papertrail is unreachable
  • Monitor log volume and compare with Papertrail's received count
  • Use DodaTech's Centralized Logging Manager for multi-destination log routing

Common Mistakes with log drain

  1. Non-exhaustive pattern matches that compile with warnings then crash at runtime
  2. Misunderstanding that String is [Char] with poor performance for large text operations
  3. Using foldl instead of foldl' causing stack overflow on large lists

These mistakes appear frequently in real-world PAPERTRAIL code. DodaTech's contributors have identified these patterns through analysis of open-source projects and production systems.

Practice Exercise

Write a pure function that safely divides two integers using Maybe, then test it with edge cases like division by zero and negative numbers.

This exercise reinforces the concepts covered in this guide. Try implementing it before checking online solutions.

FAQ

### What protocol does Papertrail use to receive logs?

Papertrail supports syslog over TCP/UDP (plain) and TLS over TCP. The TLS endpoint typically uses port XXXXX (provided in your account settings). UDP is faster but less reliable; TCP and TLS provide guaranteed delivery.

Why do logs appear in the local syslog but not in Papertrail?

Check that the syslog daemon (rsyslog, syslog-ng) is configured to forward to Papertrail and that the destination port is correct. Also check that the syslog daemon is running and has restarted after configuration changes.

How do I configure rsyslog to forward to Papertrail?

Add a line to /etc/rsyslog.conf: *.* @@logs2.papertrailapp.com:12345 (@ for UDP, @@ for TCP). For TLS, use the Papertrail TLS configuration guide. Restart rsyslog after changes: systemctl restart rsyslog.

Related: DodaTech's Centralized Logging Guide compares Papertrail, Loggly, Splunk, and Datadog log management for different deployment scenarios.

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro