PHPackages                             clarkwinkelmann/flarum-ext-gate-logger - 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. [Debugging &amp; Profiling](/categories/debugging)
4. /
5. clarkwinkelmann/flarum-ext-gate-logger

ActiveFlarum-extension[Debugging &amp; Profiling](/categories/debugging)

clarkwinkelmann/flarum-ext-gate-logger
======================================

Log all gate queries for debug purpose

0.1.0(4y ago)032MITPHP

Since Oct 31Pushed 4y ago1 watchersCompare

[ Source](https://github.com/clarkwinkelmann/flarum-ext-gate-logger)[ Packagist](https://packagist.org/packages/clarkwinkelmann/flarum-ext-gate-logger)[ RSS](/packages/clarkwinkelmann-flarum-ext-gate-logger/feed)WikiDiscussions main Synced 2d ago

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

Gate Logger (for developers)
============================

[](#gate-logger-for-developers)

[![MIT license](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](https://github.com/clarkwinkelmann/flarum-ext-gate-logger/blob/master/LICENSE.md) [![Latest Stable Version](https://camo.githubusercontent.com/9abf5cec3dbfbaad770ca7c4b854f5a8cc745a9787b3c7886c4b7b87b2094c4a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636c61726b77696e6b656c6d616e6e2f666c6172756d2d6578742d676174652d6c6f676765722e737667)](https://packagist.org/packages/clarkwinkelmann/flarum-ext-gate-logger) [![Total Downloads](https://camo.githubusercontent.com/1f3604dc0c249faa7ddf556d794f9a215610acaf5d75466e8fe48a37c81e6179/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f636c61726b77696e6b656c6d616e6e2f666c6172756d2d6578742d676174652d6c6f676765722e737667)](https://packagist.org/packages/clarkwinkelmann/flarum-ext-gate-logger) [![Donate](https://camo.githubusercontent.com/0d6e4d8b50b5983a58205941b1a581b1305903393b7a39da574e3f60af3c7f5b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f70617970616c2d646f6e6174652d79656c6c6f772e737667)](https://www.paypal.me/clarkwinkelmann)

This extension logs information about all calls to Flarum's Gate to the default Flarum logger with `debug` priority.

This means all calls to `User::can()`, `User::cannot()`, `User::assertCan()`, etc. But not `User::hasPermission()`.

This creates *a lot* of logs, so it's probably best to only enable the extension right when you want to debug something.

There is no user-facing interface. It only logs to a file (in `storage/logs` with default logger).

Performance impact will largely be related to how fast the logger can write to disk. If you are using a custom log driver that doesn't write to disk, performance impact might be negligible, as the logic is otherwise identical to native Flarum.

Caveats (not permanent, only when the extension is enabled):

- The extension completely replaces Flarum's Gate class with a custom one, so as new Flarum updates get released, this extension might cause Flarum to behave differently than a standard installation, or could be missing important security fixes!
- If an extension overrides `AbstractPolicy::checkAbility()` in its policy class, the method will never be called!

Log format
----------

[](#log-format)

The first line of the log should be prefixed by the time and debug level automatically (this is added by the logger library).

The first line will then show the gate ability name, followed by information about the actor (username or `[Guest]`) and the gate parameter (model class and ID or `[GLOBAL]` for global policies)

The next lines will show every policy class and method that are resolved for those parameters. After each policy the output will be shown (`ALLOW`, `FORCE_ALLOW`, `DENY`, `FORCE_DENY`, `[TRUE]`, `[FALSE]` or `[NULL]`) When a method exists on the policy with the ability name and returns non-null, the `can` method on the policy will be skipped. In this case the output will be shown as `SKIPPED`.

The final line will show the computed decision and which method lead to that decision. It will be one of `(Criteria Priority: )` if any of the policy classes returned non-null, `(Admin role)` if the user is admin, `(Has permission: key)` if the ability name defaulted to a permission key, or `(Default)` if nothing was matched.

If some gate calls are nested, they will appear as separate entries in the order in which the Gate return statements were reached.

Some examples of the logs that will be created:

```
[YYYY-MM-DD HH:mm:ss] flarum.DEBUG: Gate Logger addToDiscussion(Actor: Admin, Flarum\Tags\Tag: 2)
Flarum\Tags\Access\TagPolicy@addToDiscussion: [TRUE] => ALLOW
Flarum\Tags\Access\TagPolicy@can: SKIPPED
Flarum\Approval\Access\TagPolicy@addToDiscussion: [TRUE] => ALLOW
Decision: ALLOW (Criteria Priority: ALLOW)
[YYYY-MM-DD HH:mm:ss] flarum.DEBUG: Gate Logger administrate(Actor: Admin, [GLOBAL])
Flarum\Tags\Access\GlobalPolicy@can: [NULL]
Decision: ALLOW (Admin role)
[YYYY-MM-DD HH:mm:ss] flarum.DEBUG: Gate Logger clarkwinkelmann-author-change.edit-date(Actor: OneModerator, [GLOBAL])
Flarum\Tags\Access\GlobalPolicy@can: [NULL]
Decision: ALLOW (Has permission clarkwinkelmann-author-change.edit-date)
[YYYY-MM-DD HH:mm:ss] flarum.DEBUG: Gate Logger addToDiscussion(Actor: [Guest], Flarum\Tags\Tag: 1)
Flarum\Tags\Access\TagPolicy@addToDiscussion: [FALSE] => DENY
Flarum\Tags\Access\TagPolicy@can: SKIPPED
Flarum\Approval\Access\TagPolicy@addToDiscussion: [FALSE] => DENY
Decision: DENY (Criteria Priority: DENY)
[YYYY-MM-DD HH:mm:ss] flarum.DEBUG: Gate Logger viewHiddenGroups(Actor: [Guest], [GLOBAL])
Flarum\Tags\Access\GlobalPolicy@can: [NULL]
Decision: DENY (Default)

```

Installation
------------

[](#installation)

```
composer require clarkwinkelmann/flarum-ext-gate-logger

```

Support
-------

[](#support)

This extension is under **minimal maintenance**.

It was developed for a client and released as open-source for the benefit of the community. I might publish simple bugfixes or compatibility updates for free.

You can [contact me](https://clarkwinkelmann.com/flarum) to sponsor additional features or updates.

Support is offered on a "best effort" basis through the Flarum community thread.

Links
-----

[](#links)

- [GitHub](https://github.com/clarkwinkelmann/flarum-ext-gate-logger)
- [Packagist](https://packagist.org/packages/clarkwinkelmann/flarum-ext-gate-logger)
- [Discuss](https://discuss.flarum.org/d/29351)

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity40

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

Unknown

Total

1

Last Release

1654d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0538135c1debcef5602dce7ece027909cc832b7a6284ab9189a19aa8de98d60d?d=identicon)[clarkwinkelmann](/maintainers/clarkwinkelmann)

---

Top Contributors

[![clarkwinkelmann](https://avatars.githubusercontent.com/u/5264300?v=4)](https://github.com/clarkwinkelmann "clarkwinkelmann (2 commits)")

---

Tags

debugflarumgate

### Embed Badge

![Health badge](/badges/clarkwinkelmann-flarum-ext-gate-logger/health.svg)

```
[![Health](https://phpackages.com/badges/clarkwinkelmann-flarum-ext-gate-logger/health.svg)](https://phpackages.com/packages/clarkwinkelmann-flarum-ext-gate-logger)
```

###  Alternatives

[symfony/var-dumper

Provides mechanisms for walking through any arbitrary PHP variable

7.4k855.5M8.0k](/packages/symfony-var-dumper)[barryvdh/laravel-debugbar

PHP Debugbar integration for Laravel

19.1k124.3M624](/packages/barryvdh-laravel-debugbar)[php-debugbar/php-debugbar

Debug bar in the browser for php application

4.4k21.3M40](/packages/php-debugbar-php-debugbar)[fruitcake/laravel-debugbar

PHP Debugbar integration for Laravel

19.1k662.9k29](/packages/fruitcake-laravel-debugbar)[kint-php/kint

Kint - Advanced PHP dumper

2.8k19.3M283](/packages/kint-php-kint)[tracy/tracy

😎 Tracy: the addictive tool to ease debugging PHP code for cool developers. Friendly design, logging, profiler, advanced features like debugging AJAX calls or CLI support. You will love it.

1.8k24.4M1.3k](/packages/tracy-tracy)

PHPackages © 2026

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