You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

fopen() not working in CPM

Received Response
42
Views
1
Comments
edited Mar 22, 2024 1:52AM in General Technical Discussions 1 comment

Summary:

We have an asynchronous Contact CPM for both create and update events which uses fopen(), fwrite() and fclose() to log/debug CPM execution. Writing to file works fine when CPM is tested from 'Process designer' but the logs are not created in the file once CPM is deployed and triggered on contact update.

CPM execution is confirmed as it is doing all it's job except writing to the log file.

Code Snippet (add any code snippets that support your topic, if applicable):

 public static function debug($msg)

  {

    $fp = fopen( __DIR__ .   "/scripts/custom/src/cpmLog" .   date("Ymd") .  ".txt",   "a+"   );

    fwrite($fp, date("Y-m-d H:i:s") . " " . $msg . "\n");

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!