PHP Server side implementation for JSNLog (
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.


PHP Server side implementation for JSNLog (

Uses the PHP "error_log" function to save the log message from the JSNLog AJAX request to the default error log.

Example output:
[Tue Nov 26 15:43:22 2013] [error] [client] [JSPHPLog]: This message sent from JSNLog, referer: http://client site/JSPHPLog/sample.php


To install, simply copy "jsnlog.logger.php","jsnlog.config.php", and "jsnlog.ini.php" files to the root directory of your website, then include "jsnlog.config.php" in the PHP templates you want logging enabled on. See "sample.php" for an example. "jsnlog.config.php" sets up the JSNLog Javascript automatically. Note: "jsnlog.config.php" assumes the JSNLog source javascript (jsnlog.min.js) is located in the same directory.

Configuration options


The default configuration will setup a single Logger and Appender, and will send Logger messages to the default error log for your server (as referenced by the PHP "error_log" function). No additional configuration is needed.

Custom configuration (simple)

To customize the Appenders or Logger configuration settings, you can add appender options to the "jsnlog.ini.php" file. For instance, to change change the "batchSize" or "level" options for the default appender, set up the first "[appender]" section as shown below:
 ; add other appender options as well