Creating server side logs with PHP

Sometime creating sever side logs are necessary to know who is accessing your website at real time.Server side logs also provides some facilities  like getting visitor’s IP address,timing etc.Server side logs also provides the logs of bots which is absent in Google Analytics.This PHP script will make logs of everything which access your page and save the logs in different folder according to their user agent.This script will save all logs day-wise in a text file  .To use this script you just need to add an extra line in your code which is given below.

Here is the  complete script for creating server-side logs.