function wh_log($log_msg) {
date_default_timezone_set(‘Asia/Kolkata’);
$log_filename = $_SERVER[‘DOCUMENT_ROOT’].“/log”;
if (!file_exists($log_filename))
{
// create directory/folder uploads.
mkdir($log_filename, 0777, true);
}
$log_file_data = $log_filename.‘/log_’ . date(‘d-M-Y’) . ‘.log’;
$log_msg = date(‘d-M-Y g:i a’).“–“.$log_msg;
file_put_contents($log_file_data, $log_msg . “n“, FILE_APPEND);
}
wh_log(‘This is a log message’);
mkdir( __DIR__ . ‘/logs/’, 0755, true );
$date = date(‘Y-m-d’);
$datetime = date(‘Y-m-d H:i:s’);
file_put_contents(__DIR__ . ‘/logs/index.php’, “”);
file_put_contents(__DIR__ . “/logs/webhooks-{$date}.log”, “[$datetime] “.json_encode($_REQUEST).“n“, FILE_APPEND);
// date_default_timezone_set(“Asia/Kolkata”);
mkdir( __DIR__ . ‘/logs/’, 0755, true );
$date = date(‘Y-m-d’);
$datetime = date(‘Y-m-d H:i:s’);
file_put_contents(__DIR__ . ‘/logs/index.php’, “”);
file_put_contents(__DIR__ . “/logs/webhooks-{$date}.log”, “[$datetime] “.json_encode($_REQUEST).“n“, FILE_APPEND);
file_put_contents(__DIR__ . “/logs/webhooks-data-{$date}.log”, “[$datetime] “.$data[‘uuid’].“n“, FILE_APPEND);