jasekiw/php-request-logger

Minimal PHP Request Logger with one require statement or composer require, you choose

1.0 2019-01-06 03:50 UTC

This package is auto-updated.

Last update: 2024-12-29 05:44:46 UTC


README

Build Status

Quick Temporary Usage

Copy RequestLogger.php to the entry directory of your web server. Log the request with these two lines.

<?php
require_once(__DIR__ . "/RequestLogger.php");
RequestLogger\logRequest();

Installing as a composer package

composer require jasekiw/php-request-logger

Usage

Write the current request to request_log.log where the RequestLogger.php file is located.

<?php
RequestLogger\logRequest();

If you want to write it elsewhere just pass the file path to the function.

<?php
RequestLogger\logRequest(__DIR__ . "/request_log.php");