Logentries provides direct support using our PHP library.
Log in to Logentries and create a new log by clicking the Add New Log button. Now click Manual Configuration button from the list of options. Give your log a name of your choice, select Token TCP and finally click the Register new log button. A token will be displayed in green. Please record it as we will use it later to configure the library.
Get the PHP library from our Github repository. Unzip it and place the folder in your apps root directory
Inside the le_php-master folder, open logentries.php as you need to enter a parameter. Replace LOGENTRIES_TOKEN with the token we copied earlier. It connects this logger with that file on Logentries. If you haven’t taken note of the token when creating your log, you can retrieve it by logging in to Logentries. Once logged in, select the host containing the log for which you want to retrieve the token (e.g. from the side bar on the left hand side of the page). All the token-based logs of this host are then displayed with a Token icon on the right hand side. Click this icon to display the token.
Use the logger in your code:
require_once dirname(__FILE__) . '/le_php-master/logentries.php'; $log->Debug("Debugging Message"); $log->Info("Informational message"); $log->Notice("Notice Message"); $log->Warn("Warning Message"); $log->Error("Error Message");