WP Payment Pal Documentation
← Back to site

Debug Mode and Logging

Enable debug mode to troubleshoot issues with payments, webhooks, and API communication. This guide covers debug settings and log analysis.

Reading time: 3 minutes | Difficulty: Intermediate

Overview

Enable debug mode to troubleshoot issues with payments, webhooks, and API communication. This guide covers debug settings and log analysis.

Prerequisites

  • Administrator access
  • Understanding of basic troubleshooting

Accessing Debug Settings

  1. Go to WP Payment Pal > Settings
  2. Click the Debug tab
Debug settings tab overview

Enabling Debug Mode

Turn On Logging

  1. Find Enable Debug Logging toggle
  2. Turn it On
  3. Save settings
Debug toggle highlighted

What Gets Logged

When enabled, the plugin logs:

  • API requests to PayPal
  • API responses
  • Webhook events
  • Errors and exceptions
  • Payment flow steps

Debug Settings Options

Log Level

Level Records
Error Only errors
Warning Errors + warnings
Info All events
Debug Verbose details

Recommendation:

  • Info for troubleshooting
  • Error for production monitoring
Log level dropdown highlighted
Log level dropdown with options

Log Retention

Set how long to keep logs:

  • 7 days (recommended)
  • 14 days
  • 30 days
  • Custom

Older logs are automatically deleted.

Viewing Logs

In Plugin

  1. Go to Debug settings
  2. Find View Logs section
  3. Browse recent log entries

Log Format

[2024-01-15 14:30:25] INFO: Payment initiated - Form ID: 123
[2024-01-15 14:30:26] INFO: PayPal API request - Create Order
[2024-01-15 14:30:27] INFO: PayPal API response - Order ID: ABC123
[2024-01-15 14:30:45] INFO: Webhook received - PAYMENT.CAPTURE.COMPLETED
[2024-01-15 14:30:45] INFO: Transaction created - ID: 456

Common Issues to Debug

Payment Failures

Look for:

  • API error responses
  • Validation failures
  • PayPal rejection reasons

Webhook Issues

Look for:

  • Webhook receipt timestamps
  • Verification status
  • Processing errors

Connection Problems

Look for:

  • API timeout errors
  • Authentication failures
  • Network issues

Reading Log Entries

Successful Payment

INFO: Payment initiated - Form ID: 123
INFO: PayPal Order created - ID: ABC123
INFO: Customer approved payment
INFO: Webhook: PAYMENT.CAPTURE.COMPLETED
INFO: Transaction saved - ID: 456

Failed Payment

INFO: Payment initiated - Form ID: 123
ERROR: PayPal API error - Invalid amount format
DEBUG: Request body: {"amount": "invalid"}

Webhook Problem

INFO: Webhook received - PAYMENT.CAPTURE.COMPLETED
ERROR: Webhook verification failed - Invalid signature

Troubleshooting Workflow

Step 1: Enable Debug

  1. Turn on debug logging
  2. Set level to Info or Debug
  3. Save settings

Step 2: Reproduce Issue

  1. Attempt the failing action
  2. Note the exact time
  3. Capture any error messages

Step 3: Check Logs

  1. Find entries around that time
  2. Look for ERROR or WARNING
  3. Read the context

Step 4: Identify Cause

Common causes:

  • Configuration errors
  • API credential issues
  • Network problems
  • Data validation failures

Step 5: Resolve

  1. Fix the identified issue
  2. Test again
  3. Verify in logs

Security Considerations

Debug logs may contain:

  • Transaction details
  • Email addresses
  • API responses

Best practices:

  • Disable in production when not needed
  • Don’t share logs publicly
  • Clear logs after troubleshooting
  • Limit log retention

Performance Impact

Debug logging:

  • Minor performance impact
  • Disk space usage
  • More at Debug level than Error level

Recommendation:

  • Use Info level normally
  • Debug level only when needed
  • Disable when not troubleshooting

Sharing Logs with Support

When contacting support:

  1. Enable debug logging
  2. Reproduce the issue
  3. Export relevant log section
  4. Redact sensitive data
  5. Share with support team

What to Redact

  • Full email addresses
  • API keys/credentials
  • Personal information
  • Full transaction IDs (partial OK)

Log File Location

Logs are stored:

  • In WordPress uploads directory
  • Under WP Payment Pal folder
  • Named by date

Path example:

/wp-content/uploads/wppal-logs/2024-01-15.log

Clearing Logs

To clear logs:

  1. Use Clear Logs button if available
  2. Or delete files from server
  3. Old logs auto-delete per retention setting

WordPress Debug Mode

WP Payment Pal debug is separate from:

define('WP_DEBUG', true);

Both can be useful for troubleshooting.

Best Practices

  1. Enable when needed – Not always on
  2. Use appropriate level – Info usually enough
  3. Check regularly – Don’t let logs grow huge
  4. Secure logs – Contains sensitive data
  5. Document findings – Note what you learn

Troubleshooting Debug Itself

Logs not appearing

  • Verify debug is enabled
  • Check file permissions
  • Look in correct date file

Logs too large

  • Reduce log level
  • Decrease retention
  • Clear old logs

Missing information

  • Increase log level to Debug
  • Ensure event occurred after enabling

What’s Next?