Jump to content

Logs Available Within WHMCS


Recommended Posts

  • WHMCS Technical Analyst II

In this post, we are going to explore the logs that are available within WHMCS, including:

  • Where to find them
  • How and when to use them
  • How to maintain them

Activity Log

The activity log in WHMCS records events that occur to allow for tracking who and what initiated various actions and to allow for troubleshooting any errors or problems that occur. There are 2 types of log entries:

  • Client Logs -  Client logs are events and actions relating to a specific client and can be viewed from the Log tab within a Clients Profile
  • System Logs - This includes both client and system log entries and can be accessed via Utilities > Logs > Activity Log

The Activity Log will be, if it is not already, the most commonly used log within your installation. It should be used as part of ALL troubleshooting within WHMCS, in a lot of cases, in conjunction with using another log, such as the Module Debug Log, which we will come onto later.

Each action/event records the date/time the action occurred, a description indicating what happened, the currently logged in admin user who invoked the action (System shows for non admin initiated actions) and the IP Address of the user who caused it (ie. the admins IP, the clients IP or the system IP). In both locations, you can filter the log entries for entries on a specific date, performed by a specific username/IP, and/or containing certain keywords you specify. This allows you to narrow the log down quickly and easily for the specific action or event you are looking for.

Let's look at two working examples of why you might want to use the Activity Log.

Example one:

You become aware that the cron on your installation didn't execute or complete at the expected time, which you received an email alert about. The cron is going to be logged to the full system log, located at Utilities > Logs > Activity Log as detailed above. When the cron starts, it will log "Cron Job: Starting Daily Automation Tasks" (without quotation marks) when it completes and "Cron Job: Completed Daily Automation Tasks" when it completes. Using the Activity Log, you can immediately answer three questions:

1) Did the cron run at all?

2) Did the cron run, but fail to complete?

3) If it ran, but did not complete, what was the last task it was performing

You can then focus your troubleshooting based on the results, using one of our troubleshooting guides, such as: http://help.whmcs.com/m/automation/l/683269-advanced-cron-troubleshooting

Example Two:

A client makes payment for a domain renewal, which fails. As an admin you become aware of this failure due to the email sent by WHMCS informing you a domain renewal received it's payment but failed to renew with the registrar. The Activity Log will hold the error message response. To review this, we will navigate to the client in question and select the Log tab, where you will see the entry, an example of this would be:

Domain Renewal Failed - Domain ID: 1 - Domain: google.com - Error: Purchase price is greater than available balance

In this instance, this message means that we have not got enough credit in our eNom account to renew the domain name, using the Activity Log, we have identified this and now resolve it. Whilst WHMCS is very intuitive and will in most cases provide the error in the alert you receive, it will be present in the Activity Log, should you need it.

Maintenance

The Activity Log will grow as your installation grows, in most cases, you won't want to purge entries from it to preserve all historical actions that have occurred within your installation. WHMCS does however provide two ways you can reduce the size of the log:

1) To reduce the amount of System Level Activity Log entries that are stored, you can navigate to 'Setup → General Settings → General' and enter a value in the 'Limit Activity Log' field.

2) To reduce the amount of Client Level Activity Log entries, you can navigate to 'Utilities → System → System Cleanup' and delete log entries before a certain date, as well as view the current volume of entries.

The log itself is stored in the 'tblactivitylog' database table.

 

Module Debug Log

This module debugging tool can be used to identify and resolve problems communicating with remote API systems. It will record and display the raw API data being sent to, and received back from the remote system. Logging should only ever be enabled for testing, and never left enabled all the time.The Module Debug Log is located at Utilities > Logs > Module Debug Log. You will want to use this log whenever you encounter a problem communicating with remote API systems. To effectively use this log, you will want to enable it, reproduce the issue, then revisit it to collect the Request and Response data. This log will allow you to analyse the request data that is being sent, to ensure the request is correct as well as analyse the response data, which in most cases is the data you require to troubleshoot the issue.

Lets take a look at a working example of when you might want to use the Module Debug Log.

Example:

We are adding a new server to a WHMCS installation, in this example, we are adding a cPanel server at `Setup → Products/Services → Servers', we add the server and select 'Test Connection', and see this error:

Failed: Array

We need to need gain more visibility on the issue here. We therefore navigate to Utilities > Logs > Module Debug Log and enable debug logging, once enabled, we go back to the server we are adding and select 'Test Connection' again. We now navigate to back to the Module Debug Log and review the Request and Response data. In this example, the Response data is:

{"cpanelresult":{"apiversion":"2","error":"Access denied","data":{"reason":"Access denied","result":"0"},"type":"text"}}

We can see that the cPanel server is responding with "Access denied" indicating the credentials we added are being rejected. Now we know the issue, we can go and review the credentials we have added and resolve this.

Once resolved, navigate back to Utilities > Logs > Module Debug Log and disable it as well as reset it to clear the entries we no longer require.

The Module Debug Log entries are stored in the 'tblmodulelog' table.

 

Gateway Log

The Gateway Log is a log of communication between WHMCS and your payment gateways, it is located at 'Billing → Gateway Log'. This log can be used if transactions aren't being automatically handled by WHMCS. You will want to use this log whenever you need to troubleshoot any payment related issues within WHMCS, such as invoices not being automatically marked as paid.

Lets take a look at a working example of when you might want to use the Gateway Log.

Example:

A client contacts you and says they made payment for their service through PayPal, but they have just received an invoice reminder to pay it, after checking your PayPal account you verify the client did make payment. At this point, you will want to navigate to the Gateway Log to begin troubleshooting this. You will want to locate the transaction in question, which in this case should be the response from PayPal's IPN and review the Result. In this example, the Result shows this:

Invalid Receiver Email

We now know the cause, so we focus on that specific error and resolve it. In many cases you can find errors such as this in our documentation: https://docs.whmcs.com/PayPal#Invalid_Receiver_Email

You can clear all entries within the Gateway Log by navigating to 'Utilities → System → System Cleanup'.

The entries in the log are stored in the 'tblgatewaylog' database table.

 

Admin Login Log

The Admin Login Log is located at Utilities > Logs > Admin Log and provides historical data as to when an admin user logged in and out, as well as the IP address associated with this access.

This log is useful if you want to review which admin users have accessed your installation and when they did so.

The entries in this log are stored in the 'tbladminlog' database table.

 

Email Message Log

The Email Message Log is located at Utilities > Logs > Email Message Log and records all emails sent to your clients, it is also accessible on a per client basis through the 'Emails' tab in a clients profile. You can use this log if a client indicates to you that they have not received an email, such as an invoice reminder email. If a message is recorded in the Email Message Log and there's no error in the Activity Log (detailed above) you can conclude it left WHMCS without any errors from your mail server and continue your investigate from there. Alternatively, if you do not see an entry, you can use the Activity Log to troubleshoot further on your WHMCS installation.

To reduce this log, you can navigate to 'Utilities → System → System Cleanup' and prune saved emails before a certain date, as well as view the current volume of entries.

The entries in this table are stored in the 'tblemails' database table

 

Ticket Mail Import Log

If an email has not been piped into the ticket system, you will want to review the Ticket Mail Import Log, located at Utilities > Logs > Ticket Mail Import Log. This shows all the emails processed by WHMCS and any errors that may have occurred.

You will want to use this log whenever you believe there is an issue with emails being piped in to your ticket system, perhaps a user has reported when they email one of your Support Departments, they receive a response saying a ticket was not opened, or do not receive any response. You can then focus your troubleshooting around the results you see in the Ticket Mail Import Log.

As always, we document some common errors: https://docs.whmcs.com/Email_Piping#Common_Problems

You can clear all entries within the Ticket Mail Import Log by navigating to 'Utilities → System → System Cleanup'.

The entries are stored in the 'tblticketmaillog' database table.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated