ComusThumbz Documentation
Admin Login

Billing Logs

Overview

The Admin Billing Logs page provides a detailed view of all payment processor activity. This is an essential debugging and monitoring tool that captures every interaction between the platform and payment providers, including webhooks, API calls, errors, and informational messages.

Key capabilities include:

  • View all payment processor log entries
  • Filter logs by provider, message type, and date range
  • Search through log messages and details
  • Monitor error rates and debug payment issues
  • Track webhook deliveries and responses
  • View JSON details for complex log entries
  • Paginated navigation for large log volumes

 


System Requirements

PHP Requirements

Requirement Minimum Recommended
PHP Version 7.4+ 8.0+
Memory Limit 64M 128M

PHP Extensions Required

  • mysqli - Database connectivity
  • json - JSON decoding for log details
  • session - Session management for CSRF protection

PHP Settings

session.autostart = Off
date.timezone = Your/Timezone

Features & UI Elements

Page Header

[Screenshot: billing-logs-header]

The page header displays:

  • Title: "Billing Logs"
  • Icon: fa-file-alt (document icon)
  • Breadcrumb: Dashboard / Billing / Logs

 

Statistics Dashboard

[Screenshot: billing-logs-stats]

Four statistics cards showing log overview:

Card Color Icon Description
Total Logs Green fa-list Total number of log entries
Debug Gray fa-bug Debug-level log count
Info Blue fa-info-circle Info-level log count
Errors Red fa-exclamation-circle Error-level log count
Tip: A high error count relative to info logs indicates potential integration problems. Healthy systems typically show < 5% error rate.

Filter Panel

[Screenshot: billing-logs-filters]

A filter panel with the following options:

Filter Type Description
Provider Dropdown Filter by specific payment provider
Type Dropdown Filter by message type (Debug/Info/Error)
Search Text Input Search in message text and details
Date From Date Picker Start date for date range
Date To Date Picker End date for date range

Action Buttons:

  • Apply Filters (Green) - Apply selected filters
  • Clear Filters - Reset all filters to default

Logs Table

[Screenshot: billing-logs-table]

The main log display table:

Column Description
ID Log entry ID (auto-increment)
Provider Payment provider name
Type Message type with color badge
Message Log message summary
Date Timestamp of log entry
Actions View details button

Type Badges:

Type Badge Color Icon
Debug Gray fa-bug
Info Blue fa-info-circle
Error Red fa-exclamation-circle

Log Detail Modal

[Screenshot: billing-logs-modal]

When clicking "View Details", a modal displays:

Log Information:

  • Log ID
  • Provider name
  • Message type
  • Full message text
  • Timestamp

 

Details Section:

  • Formatted JSON display (if messagedetails contains JSON)
  • Or plain text display for non-JSON content
  • Related transaction ID (if linked)
  • IP address (if logged)

 

Pagination

  • 100 log entries per page
  • Previous/Next navigation
  • Page number links
  • Maintains filter parameters across pages

Step-by-Step Usage

Viewing Recent Logs

  1. Navigate to Admin Panel → Billing → Logs
  2. Logs display in reverse chronological order (newest first)
  3. Browse through entries in the table
  4. Click "View Details" to see full log entry

Filtering by Provider

  1. Open the filter panel
  2. Select a provider from the Provider dropdown
  3. Click Apply Filters
  4. Only logs from that provider are shown

 

Tip: Filter by provider when troubleshooting a specific integration issue.

 

Filtering by Message Type

  1. Open the filter panel
  2. Select a type from the Type dropdown:
  • Debug - Detailed technical information
  • Info - Standard operational messages
  • Error - Problems requiring attention
  1. Click Apply Filters

Filtering by Date Range

  1. Click the Date From picker and select a start date
  2. Click the Date To picker and select an end date
  3. Click Apply Filters
  4. Only logs within the range are shown

 

Note: Date range filtering is useful for investigating issues during specific periods or analyzing payment patterns.

 

Searching Logs

  1. Enter a search term in the Search field
  2. Click Apply Filters
  3. Results match against:
  • messagetxt (summary)
  • messagedetails (JSON/text content)

Useful Search Terms:

Search Finds
webhook Webhook delivery logs
failed Failed operations
transactionid Specific transaction reference
userid:123 Logs mentioning a specific user
amount Price/amount related logs
subscription Subscription lifecycle events

Viewing Full Log Details

 

  1. Find the log entry in the table
  2. Click the View button (eye icon)
  3. Modal opens with complete information:
  • Full message text (not truncated)
  • Formatted JSON details (if applicable)
  • Related transaction link
  • Technical details (IP, etc.)
  1. Click outside modal or press ESC to close

Analyzing Webhook Deliveries

Webhooks are critical for payment processing. To review:

  1. Filter by Type: Info
  2. Search for "webhook"
  3. Review webhook entries:
  • Incoming webhook received
  • Webhook parsed successfully
  • Action taken (subscription created, payment recorded, etc.)

Healthy Webhook Flow:

Info: Received webhook from [provider]

Info: Webhook validated successfully

Info: Processing [eventtype] event

Info: Transaction [id] created successfully

 

Investigating Errors

  1. Filter by Type: Error
  2. Review error messages
  3. Click to view full details
  4. Common error patterns:

Authentication Errors:

Error: Invalid API key or signature

Error: Webhook signature verification failed


Solution: Verify API credentials in provider settings

 

Processing Errors:

Error: User not found for subscription

Error: Duplicate transaction detected


Solution: Check user linkage, review deduplication logic

 

Network Errors:

Error: Connection timeout to [provider]

Error: SSL certificate verification failed


Solution: Check server connectivity, update certificates

 


Best Practices

Log Monitoring Schedule

 

Tip: Regular log monitoring catches issues before they affect revenue:

 

Frequency Check Focus
Daily Error count Any new errors in last 24h?
Daily Webhook volume Expected number of webhooks?
Weekly Error rate Error rate trending up or down?
Weekly Provider comparison All providers functioning equally?
Monthly Log volume Unusual patterns or spikes?

Error Rate Thresholds

Error Rate Status Action
< 1% Healthy Normal monitoring
1-5% Warning Investigate top errors
5-10% Elevated Immediate review required
> 10% Critical Stop and investigate

Log Retention

 

Configuration Required: Consider implementing log rotation to manage database size:

 

-- Delete debug logs older than 30 days
DELETE FROM tblBillingLog
WHERE messagetype = 0
AND addeddate < DATESUB(NOW(), INTERVAL 30 DAY);

-- Delete info logs older than 90 days
DELETE FROM tblBillingLog
WHERE messagetype = 1
AND added
date < DATESUB(NOW(), INTERVAL 90 DAY);


-- Keep error logs for 1 year
DELETE FROM tblBillingLog
WHERE message
type = 2
AND addeddate < DATESUB(NOW(), INTERVAL 365 DAY);

 

Common Log Patterns to Watch

Successful Transaction:

Info: Webhook received: payment.completed

Info: User #123 - Transaction created: $29.99

Info: Subscription extended to 2025-02-01

 

Failed Webhook:

Error: Webhook signature mismatch

Error: Could not verify request origin

Debug: Raw payload: {...}

 

Rebill Issue:

Info: Processing subscription rebill

Error: Payment declined - insufficient funds

Info: Subscription marked for retry

 


Troubleshooting

Common Issues

No Logs Appearing

Cause: Logging not enabled or table empty

Solutions:

  1. Check if logging is enabled in processor config
  2. Verify tblBillingLog table exists
  3. Test with a manual log entry:

 

INSERT INTO tblBillingLog

(internalproviderid, messagetype, messagetxt, addeddate)

VALUES (1, 1, 'Test log entry', NOW());

 

  1. If table doesn't exist, run CREATE TABLE from Installation Requirements

 

Logs Not Recording Webhooks

Cause: Webhook endpoint not logging

Solutions:

  1. Check processor class implements logging
  2. Verify webhook URL is correct in provider dashboard
  3. Add debug logging to webhook endpoint:
// At start of webhook handler

$log->write(0, 'Webhook received: ' . $SERVER['REQUESTURI']);

 

  1. Check server error logs for PHP errors in webhook handler

 

JSON Details Not Displaying

Cause: Invalid JSON stored in messagedetails

Solutions:

  1. Check if data is valid JSON:

 

SELECT logid, messagedetails

FROM tblBillingLog

WHERE JSONVALID(messagedetails) = 0

AND messagedetails IS NOT NULL

LIMIT 10;

 

  1. Review processor logging code
  2. Ensure proper JSON encoding before storage

 

Filter Not Working

Cause: Date format or SQL issue

Solutions:

  1. Verify date format matches database (YYYY-MM-DD)
  2. Check for timezone mismatches
  3. Verify SQL query is building correctly
  4. Clear all filters and try one at a time

 

Database Issues

Table Growing Too Large

Cause: No log rotation implemented

Solution:

  1. Check current size:
SELECT

    COUNT(*) as totalrows,

    ROUND(DATALENGTH/1024/1024, 2) as datamb,

    ROUND(INDEXLENGTH/1024/1024, 2) as indexmb

FROM informationschema.TABLES

WHERE TABLENAME = 'tblBillingLog';

 

  1. Implement log rotation (see Log Retention section)
  2. Consider archiving old logs before deletion

 

Provider Not in Dropdown

Cause: Provider inactive or deleted

Solution:

-- Check all providers (including inactive)

SELECT internalproviderid, providername, isactive

FROM tblPaymentProviders;

 


-- Find logs for missing provider ID
SELECT DISTINCT internalproviderid
FROM tblBillingLog
WHERE internalproviderid NOT IN (
SELECT internalproviderid FROM tblPaymentProviders
);

 


Security Considerations

Sensitive Data

 

Warning: Billing logs may contain sensitive information:

 

  • Transaction IDs and amounts
  • User identifiers
  • IP addresses
  • Webhook payloads with personal data

Best Practices:

  • Limit access to billing logs section
  • Don't expose log data in URLs
  • Mask sensitive fields in log display
  • Implement proper session timeouts

 

Access Control

  • Only administrators can view billing logs
  • Session validation on page load
  • CSRF protection on filter submissions

Data Privacy

Under GDPR and similar regulations:

  • Logs containing user data must be deletable
  • Consider anonymizing older logs
  • Document log retention in privacy policy

 


Translatable Strings

{
    "billinglogstitle": "Billing Logs",
    "billinglogsbreadcrumb": "Dashboard / Billing / Logs",
    "billinglogsstattotal": "Total Logs",
    "billinglogsstatdebug": "Debug",
    "billinglogsstatinfo": "Info",
    "billinglogsstaterrors": "Errors",
    "billinglogsfilterprovider": "All Providers",
    "billinglogsfiltertype": "All Types",
    "billinglogsfiltersearch": "Search logs...",
    "billinglogsfilterdatefrom": "Date From",
    "billinglogsfilterdateto": "Date To",
    "billinglogsfilterapply": "Apply Filters",
    "billinglogsfilterclear": "Clear Filters",
    "billinglogstableid": "ID",
    "billinglogstableprovider": "Provider",
    "billinglogstabletype": "Type",
    "billinglogstablemessage": "Message",
    "billinglogstabledate": "Date",
    "billinglogstableactions": "Actions",
    "billinglogstypedebug": "Debug",
    "billinglogstypeinfo": "Info",
    "billinglogstypeerror": "Error",
    "billinglogsmodaltitle": "Log Details",
    "billinglogsmodallogid": "Log ID",
    "billinglogsmodalprovider": "Provider",
    "billinglogsmodaltype": "Type",
    "billinglogsmodalmessage": "Message",
    "billinglogsmodaldetails": "Details",
    "billinglogsmodaldate": "Date",
    "billinglogsmodalip": "IP Address",
    "billinglogsmodaltransaction": "Related Transaction",
    "billinglogsmodalclose": "Close",
    "billinglogsnologs": "No log entries found",
    "billinglogsnomatching": "No logs match your filters",
    "billinglogsunknownprovider": "Unknown Provider",
    "billinglogsviewdetails": "View Details",
    "billinglogsnodetails": "No additional details available"
}


Version History

Version Date Changes
1.0.0 2025-10-20 Initial billing logs page
1.1.0 2025-11-01 Added filter panel
1.2.0 2025-11-15 Added statistics dashboard
1.3.0 2025-12-01 Added log detail modal with JSON formatting
1.4.0 2025-12-15 Modern UI with green theme
1.5.0 2025-01-02 Added search functionality, increased page size to 100