If this is your first visit, check our documentation. To post, register or login.

TaxCloud Logging

Started by larrylmiller on 20 Dec 2018, 10:01 PM · Views: 2,085

Results 1 to 3 of 3
20 Dec 2018, 10:01 PM
#1
larrylmiller avatar

larrylmiller

New Zenner

Join Date:
Oct 2016
Location:
Mississippi
Posts:
8
Plugin Contributions:
0

Post #1 by larrylmiller

I am looking for a way to log TaxCloud transactions.

I tried multiple times to log date and time with no luck.

I added this to several locations in func.taxcloud.php. No errors, no output.

$iplogfile = 'logs/taxcloud.html';
$ipaddress = $_SERVER['REMOTE_ADDR'];
$webpage = $_SERVER['SCRIPT_NAME'];
$timestamp = date('d/m/Y h:i:s');
$browser = $_SERVER['HTTP_USER_AGENT'];
$fp = fopen($iplogfile, 'a+');
chmod($iplogfile, 0777);
fwrite($fp, '['.$timestamp.']: '.$ipaddress.' '.$webpage.' '.$browser. "\n<br><br>");
fclose($fp);

Am I on the correct path?

Thanks

URL: https://shop.mcrsafety.com
ZC version: 1.5.5f
Plugins: Email Archive Manager
PHP version: 5.6.39

21 Dec 2018, 2:52 AM
#2
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Post #2 by mc12345678

Not sure exactly what you are trying to accomplish. If you just want a quick and dirty log of entering a portion of code, could use:

trigger_error('log details', E_USER_WARNING);

Where whatever is to be logged takes the place of 'log details'.

That is if logging is possible on the current configuration.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

21 Dec 2018, 1:35 PM
#3
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,144
Plugin Contributions:
56

Post #3 by lat9

The simplest way to do this is via PHP's error_log function:

error_log('['.$timestamp.']: '.$ipaddress.' '.$webpage.' '.$browser. "\n<br><br>" . PHP_EOL, 3, DIR_FS_LOGS . '/taxcloud.html');