web design, England, Britain, UK, belgium
 

PHP - log anything - Joomla & VirtueMart Tips & How To's

GJC Website Design UK, Joomla Developer, VirtueMart Developer, Template Developer, web site designs, England, Britain, UK, Belgium, search-engine optimisation (SEO). Multilingual.

Home Joomla VirtueMart Tips PHP - log anything

Sun

12

Nov

PHP - log anything
  • PHP
  • Log Anything

Logging is very useful!!! :)

//Write action to txt log
$log = "User: ".$_SERVER['REMOTE_ADDR'].' - '.date("F j, Y, g:i a").PHP_EOL.
"Connection: ".print_r($connection).PHP_EOL.
"Request: ".print_r($request,true).PHP_EOL.
"Response: ".print_r($response,true).PHP_EOL.
"-------------------------".PHP_EOL;
//-
#print 'Debug Line '.__LINE__.' $log <pre>'; print_r ($log); print "</pre><br />\n";
$fp = fopen(dirname(__FILE__).'/ST_log'.date("j.n.Y").'.txt', 'a+');
fwrite( $fp, $log );
fwrite($fp, "\n\n###########################################\n\n");
fclose($fp);
Last Updated on Friday, 26 October 2018 17:19
 
VirtueMart
Your Cart is currently empty.



PHP - log anything|Joomla & VirtueMart Tips & How To's



GJC Website Design UK, Joomla Developer, VirtueMart Developer, Template Developer, web site designs, England, Britain, UK, Belgium, search-engine optimisation (SEO). Multilingual.


log, print, php, eol, response, connection, true, request, line, fwrite, txt, date, file, fopen, fclose, debug, dirname, write, useful, logging, action, user, addr, remote, server

|

We use cookies to improve our website and your experience when using it. Cookies used for the essential operation of the site have already been set.
To find out more about the cookies we use and how to delete them, see our privacy policy.

I accept cookies from this site.