php l0gg3r 0.2.2: a very simple php logger

freaky_head

Italiano :: English :: Download Source Code

it Ciao ragazzi, ho deciso di modificare lo script precedentemente proposto aggiungendo nuove feature piuttosto funzionali. Da notare quindi:

  • Logrotate function -> invio "periodico" del file di log all'email dell'amministratore e contemporaneo reset del file di log principale [access.log]. Verrà comunque mantenuto sul server un backup del file di log [accessDataOra.log], per ovviare ad eventuali problemi in fase di invio della mail stessa;
  • Country identification based on IP address -> script basato su http://www.phptutorial.info/iptocountry/the_script.html, il quale utilizza il database fornito da software77.net;
  • Pie charts -> realizzazione di grafici a torta mediante Google Chart Tools.

File utili:

  • l0gg3r.php (contiene le funzioni necessarie al logging)
  • list.php (lista formattata del file di log)
  • stats.php (statistiche e grafici a torta)

Si raccomanda di modificare le righe 40,41 del file l0gg3r.php, in modo da indicare l'email cui inviare il file di log:

  1. ...
  2. $to = "admin@yoursite.com";
  3. $site_name = "www.yoursite.com";
  4. ...
Per un'immagine d'esempio guarda in fondo a questo post.

um Hello guys, I decided to modify the previously proposed script adding new functional features. See the list below:

  • Logrotate function -> "periodic" log file sending to the admin mail address and main log file reset [access.log]. A backup log file will be maintained on the server [accessDateTime.Log] to avoid data loss if the mail sending fails;
  • Country identification based on IP address -> script based on http://www.phptutorial.info/iptocountry/the_script.html, which uses the database provided by software77.net;
  • Pie charts -> pie charts using Google Chart Tools.

Useful files:

  • l0gg3r.php (it contains the functions needed for logging)
  • list.php (log file formatted list)
  • stats.php (statistics and pie charts)

It is recommended to change the lines 40,41of the file l0gg3r.php, to indicate the admin mail address:

  1. ...
  2. $to = "admin@yoursite.com";
  3. $site_name = "www.yoursite.com";
  4. ...
You can see a sample image at the bottom of this post.

Download Source Code:

php_l0gg3r_0.2.2.tar.gz


2010-03-28-201451_1280x800_scrot.png
stats.php (output example)

2010-03-29-235842_1280x730_scrot.png
list.php (output example)

(Icon by dimpoart)


Replies: 0

  1. How sad... there are currently no comments.

Leave a Reply