PHPackages                             abbe98/request-logging - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. abbe98/request-logging

ActiveLibrary[Database &amp; ORM](/categories/database)

abbe98/request-logging
======================

A simpe PHP class for logging incoming requests.

1.1.0(11y ago)029MITPHPPHP &gt;=5.0.0

Since Sep 11Pushed 11y ago1 watchersCompare

[ Source](https://github.com/Abbe98/request-logging)[ Packagist](https://packagist.org/packages/abbe98/request-logging)[ Docs](https://github.com/Abbe98/request-logging)[ RSS](/packages/abbe98-request-logging/feed)WikiDiscussions master Synced 4d ago

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

\#request-logging

*Request logging library in PHP*

\##Installation

Include `rqeuest_logging.php` or add the [composer package](https://packagist.org/packages/abbe98/request-logging).

Define the database configuration:

```
define('HOST', '127.0.0.1'); // the IP of the database
define('DBNAME', 'reqlog_test'); // the database name to be used
define('USERNAME', 'root'); // the username to be used with the database
define('PASSWORD', ''); // the password to be used with the username

```

And run the following SQL in the database you defined above:

```
CREATE TABLE IF NOT EXISTS `requests` (
`id` int(255) NOT NULL,
  `ip` varchar(45) COLLATE utf8mb4_bin NOT NULL,
  `http_forwared` int(45) NOT NULL,
  `browser_ua` varchar(600) COLLATE utf8mb4_bin NOT NULL,
  `timestamp` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
  `tag` varchar(700) COLLATE utf8mb4_bin NOT NULL
) ENGINE=InnoDB  DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin AUTO_INCREMENT=27 ;

ALTER TABLE `requests`
 ADD PRIMARY KEY (`id`);

ALTER TABLE `requests`
MODIFY `id` int(255) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=27;

```

\##Usage

Log the current request(IP, HTTP forwarded, Browser User Agent and Time Samp). The `$tagString` is optional:

`$log = new ReqLog($tagString);`

Get the number of visits from the current computer/browser(by adding `$tagString` you get the tag specific data):

`$log->num_visits();`

Get the number of visits from the current computer(`$tagString` is optional):

`$log->num_ip_visits();`

Get the percent that the current browser version has(`$tagString` is not supported):

`$log->this_browser_percent();`

**Licensed under MIT.**

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~22 days

Total

2

Last Release

4241d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9368ceb9fa144bf96d707391af5723f3489f1d0d6d08399b8569cdd31de37f7e?d=identicon)[Abbe98](/maintainers/Abbe98)

---

Top Contributors

[![Abbe98](https://avatars.githubusercontent.com/u/2631719?v=4)](https://github.com/Abbe98 "Abbe98 (9 commits)")

---

Tags

loggingdatabaseIPrequests

### Embed Badge

![Health badge](/badges/abbe98-request-logging/health.svg)

```
[![Health](https://phpackages.com/badges/abbe98-request-logging/health.svg)](https://phpackages.com/packages/abbe98-request-logging)
```

###  Alternatives

[itbdw/ip-database

IP数据库 IPV4 IPV6（解析为国家、省、市、县、运营商）

1.5k123.8k7](/packages/itbdw-ip-database)[wazaari/monolog-mysql

A handler for Monolog that sends messages to MySQL

140884.1k6](/packages/wazaari-monolog-mysql)[dereuromark/cakephp-databaselog

A CakePHP plugin for storing and viewing application logs in the database

44165.0k2](/packages/dereuromark-cakephp-databaselog)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
