{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Logging","description":"Developer documentation for the WHMCS API — the","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"logging","__idx":0},"children":["Logging"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The following logging helper methods are made available in WHMCS."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"log-activity","__idx":1},"children":["Log Activity"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A helper method is available for adding entries to the activity log."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This function is available to all hooks, modules and template files throughout the WHMCS system."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"/**\n * Log activity.\n *\n * @param string $message The message to log\n * @param int $clientId An optional client id to which the log entry relates\n */\nlogActivity('Message goes here', 0);\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"log-module-call","__idx":2},"children":["Log Module Call"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["We recommend making use of the module log to record all external API calls and requests."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This makes debugging the external API calls your modules make easier and consistent with other modules."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"/**\n * Log module call.\n *\n * @param string $module The name of the module\n * @param string $action The name of the action being performed\n * @param string|array $requestString The input parameters for the API call\n * @param string|array $responseData The response data from the API call\n * @param string|array $processedData The resulting data after any post processing (eg. json decode, xml decode, etc...)\n * @param array $replaceVars An array of strings for replacement\n */\nlogModuleCall($module, $action, $requestString, $responseData, $processedData, $replaceVars);\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["We recommend passing data strings such as usernames and passwords into the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["$replaceVars"]}," parameter to allow them to be automatically scrubbed and omitted from module log entries."]}]},"headings":[{"value":"Logging","id":"logging","depth":1},{"value":"Log Activity","id":"log-activity","depth":2},{"value":"Log Module Call","id":"log-module-call","depth":2}],"frontmatter":{"title":"Logging","seo":{"title":"Logging"}},"lastModified":"2026-08-03T17:00:42.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/advanced/logging","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}