PHPackages                             dreamfactory/df-mongo-logs - 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. dreamfactory/df-mongo-logs

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

dreamfactory/df-mongo-logs
==========================

DreamFactory(tm) MongoDB Logger Package

1.3.0(1y ago)025.4k↓50%[2 PRs](https://github.com/dreamfactorysoftware/df-mongo-logs/pulls)1Apache-2.0PHP

Since Mar 25Pushed 3mo ago2 watchersCompare

[ Source](https://github.com/dreamfactorysoftware/df-mongo-logs)[ Packagist](https://packagist.org/packages/dreamfactory/df-mongo-logs)[ Docs](https://www.dreamfactory.com/)[ RSS](/packages/dreamfactory-df-mongo-logs/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (5)Versions (15)Used By (1)

Logging API requests
====================

[](#logging-api-requests)

DreamFactory 4.0.1 and newer supports a very simple solution for logging all requests. All records requested in the API will be written to the database. Logging API requests service currently supports only MongoDB.

Overview
--------

[](#overview)

DreamFactory is a secure, self-hosted enterprise data access platform that provides governed API access to any data source, connecting enterprise applications and on-prem LLMs with role-based access and identity passthrough.

Configuration
-------------

[](#configuration)

To configure the logging of all requests, you need to go to the file with the environment variables and find the LogsDB settings block.

This block contains the following variables:

- `LOGSDB_ENABLED` - boolean flag to enable or disable logging of API requests. Possible values: `"true"` or `"false"`. The default is `"false"`.
- `LOGSDB_HOST` - the host of the database to store the logs. The default is `localhost`.
- `LOGSDB_PORT` - the database connection port. The default is `27017`
- `LOGSDB_DATABASE` - the name of the database for logging.
- `LOGSDB_USERNAME` - username with database access permissions.
- `LOGSDB_PASSWORD` - user password.

If `LOGSDB_ENABLED` is set to false, no request will be logged. Also, migration will not be run.

Log structure
-------------

[](#log-structure)

### MongoDB document

[](#mongodb-document)

Each request will be stored as a separate document in the `access` collection provided database.

Each document will be as follows:

```
{
  "_id": ObjectId,
  "timestamp": string,
  "method": string,
  "uri" : string,
  "body" : string,
  "expireAt" : ISODate
}

```

- `_id` - Unique ID of document. [MongoDB ObjectId docs](https://docs.mongodb.com/manual/reference/method/ObjectId/).
- `timestamp` - Document creation date. Format "YYYY-mm-dd HH-MM-SS"
- `method` - Request method. For example: `GET`, `POST`, `PUT`, `PATCH`, `DELETE`.
- `uri` - Request path. For example: `/api/v2/system/environment`, `/api/v2/system`.
- `body` - Request body in the string format. For example: `"{\"group\":\"source control,file\"}"`, `"{\"include_count\":\"true\"}"`
- `expireAt` - The date this log will be deleted. By default, 45 days after creation. [MongoDB Date docs](https://docs.mongodb.com/manual/reference/method/Date/)

###  Health Score

46

—

FairBetter than 93% of packages

Maintenance68

Regular maintenance activity

Popularity25

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~199 days

Recently: every ~428 days

Total

10

Last Release

444d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a6d25412f9819bf51eaf3cb005d1f1239f2b81081c51018240d132b98e6ad2b8?d=identicon)[dreamfactory](/maintainers/dreamfactory)

---

Top Contributors

[![volodymyrpoli](https://avatars.githubusercontent.com/u/48056356?v=4)](https://github.com/volodymyrpoli "volodymyrpoli (12 commits)")[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (6 commits)")[![thekevinm](https://avatars.githubusercontent.com/u/36458555?v=4)](https://github.com/thekevinm "thekevinm (4 commits)")[![yaroslavmo](https://avatars.githubusercontent.com/u/40685592?v=4)](https://github.com/yaroslavmo "yaroslavmo (3 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (2 commits)")[![oleksandrono](https://avatars.githubusercontent.com/u/51999869?v=4)](https://github.com/oleksandrono "oleksandrono (1 commits)")[![oleksandrkits](https://avatars.githubusercontent.com/u/42465412?v=4)](https://github.com/oleksandrkits "oleksandrkits (1 commits)")[![daniilly](https://avatars.githubusercontent.com/u/117088089?v=4)](https://github.com/daniilly "daniilly (1 commits)")

---

Tags

logsmongodbdreamfactory

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/dreamfactory-df-mongo-logs/health.svg)

```
[![Health](https://phpackages.com/badges/dreamfactory-df-mongo-logs/health.svg)](https://phpackages.com/packages/dreamfactory-df-mongo-logs)
```

###  Alternatives

[mostafamaklad/laravel-permission-mongodb

Permission handling for Laravel 5.2 and up using mongodb

113220.0k2](/packages/mostafamaklad-laravel-permission-mongodb)[jenssegers/mongodb-session

A MongoDB session driver for Laravel 4, 5, 6, 7 and 8

76308.1k3](/packages/jenssegers-mongodb-session)[designmynight/laravel-mongodb-passport

A package to allow laravel/passport use with jenssegers/laravel-mongodb

68123.3k](/packages/designmynight-laravel-mongodb-passport)[jenssegers/mongodb-sentry

An extension for Laravel-MongoDB that lets you work with Sentry

5445.0k1](/packages/jenssegers-mongodb-sentry)[pimlie/laravel-datatables-mongodb

Laravel DataTables plugin to support Mongodb

1245.9k](/packages/pimlie-laravel-datatables-mongodb)

PHPackages © 2026

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