PHPackages                             tzk/laravel-user-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. [Logging &amp; Monitoring](/categories/logging)
4. /
5. tzk/laravel-user-logger

ActivePackage[Logging &amp; Monitoring](/categories/logging)

tzk/laravel-user-logger
=======================

A package injecting metadata about the logged user into the logs

v1.0.0(8y ago)08MITPHPPHP &gt;=5.6.4

Since Jul 4Pushed 8y ago1 watchersCompare

[ Source](https://github.com/TZK-/LaravelUserLogger)[ Packagist](https://packagist.org/packages/tzk/laravel-user-logger)[ RSS](/packages/tzk-laravel-user-logger/feed)WikiDiscussions master Synced yesterday

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

Laravel User Logger
===================

[](#laravel-user-logger)

Laravel User Logger is a package used to append user specific data into the log files. It could be used to track which user produced an exception in order to help debugging.

Exemple
-------

[](#exemple)

```
#31 app\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(104): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#32 app\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php(150): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#33 app\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php(117): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))
#34 app\public\index.php(53): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))
#35 {main}  {"user":1}

```

As you can see the stack trace is completed by a custom attribute *user* displaying the id of the user who provoked the exception.

If the user isn't logged it will write *anonymous*. Else if the exception has been thrown before the session start, the user information will not be displayed.

Installation
============

[](#installation)

Begin by installing the package with Composer.

```
composer require tzk/laravel-user-logger
```

Once the installation is complete, add the service provider in your **config/app.php** file:

```
TZK\UserLogger\Providers\UserLoggerServiceProvider::class,
```

Then you'll need to change in your **app/Http/Kernel.php** file the middleware

```
\Illuminate\Session\Middleware\StartSession::class

```

to this one

```
\TZK\UserLogger\Http\Middlewares\StartSession::class

```

Configuration
=============

[](#configuration)

By default the package uses the primary key of your User model. This behavior can be overridden by publishing the package config file.

```
php artisan vendor:publish --provider="TZK\UserLogger\Providers\UserLoggerServiceProvider"
```

This command will create a **user\_logger.php** config file in your config folder in which you could specify which user attribute you would display in your logs.

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

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

3283d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5c09e688d140a9685431cc8231acace7fc84d78ff0197274483eb25bc5df2026?d=identicon)[TZK-](/maintainers/TZK-)

---

Tags

laravelmonologmonolog-processoruser

### Embed Badge

![Health badge](/badges/tzk-laravel-user-logger/health.svg)

```
[![Health](https://phpackages.com/badges/tzk-laravel-user-logger/health.svg)](https://phpackages.com/packages/tzk-laravel-user-logger)
```

###  Alternatives

[spatie/laravel-health

Monitor the health of a Laravel application

87411.3M154](/packages/spatie-laravel-health)[illuminate/log

The Illuminate Log package.

6225.0M603](/packages/illuminate-log)[spatie/laravel-flare

Send Laravel errors to Flare

111.2M6](/packages/spatie-laravel-flare)

PHPackages © 2026

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