PHPackages                             desthercz/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. desthercz/logger

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

desthercz/logger
================

Logging package for Laravel 5+

v0.12.0(1y ago)09.6k↓50%MITPHPPHP ^7.3|^8.0

Since May 27Pushed 1y agoCompare

[ Source](https://github.com/desthercz/logger)[ Packagist](https://packagist.org/packages/desthercz/logger)[ RSS](/packages/desthercz-logger/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (7)Dependencies (1)Versions (26)Used By (0)

\#Logger

Logger complements or replaces standard Laravel logging. It logs to local files and optionally provides email alerts.

\###Installation

Register the service provider:
`DestherCZ\Logger\LoggerServiceProvider::class,`

Add facade reference:
`'Logger' => DestherCZ\Logger\LoggerFacade::class,`

### Configuration

[](#configuration)

Publish the configuration file with: `php artisan vendor:publish --provider=DestherCZ\Logger\LoggerServiceProvider`.

- `'laravel' => true,` captures Laravel log facade messages
- `'folder' => 'custom'` sets the default subfolder for custom logs
- `'daily' => []` list of log files to be handled as daily logs
- `'max_daily' => 7` maximum number of daily log files to keep
- `'email.send' => false` turns sending of error emails on/off
- `'email.level' => 'ERROR'` sets the level at which email notifications are sent
- `'email.recipient' => 'recipient@example.com',` sets the email recipient

### Usage

[](#usage)

Use the facade to write to custom log files. By default files are stored in `storage/logs/custom`:

```
Logger::info('auth', 'User login from 1.2.3.4');
Logger::warning('audit', 'A record was updated');
Logger::error('exceptions', 'Fatal exception: ');

```

If you wish to store a logfile in a subfolder, use dot notation:

```
Logger::info('audit.auth', 'User login from 1.2.3.4'); // Logs to `storage/logs/custom/audit/auth.log`

```

A `requestInfo()` method is available to provide context for the message, including IP address, request type/URL, `Auth::user()->id` and input data

```
Logger::warning('audit', 'An unusual request', Logger::requestInfo());

```

Fatal errors occurring during the logging process, are stored in `storage/logs/fatal-logger-errors.log`. For example, a message will be logged here when the system is unable to send an error notification.

### Hook into Laravel exceptions:

[](#hook-into-laravel-exceptions)

Make sure the `logger.laravel` configuration option is set to true, and update your error handler:

```
// app/Exceptions/Handler.php
use Logger;

public function report(Exception $e)
{
    $class = (new \ReflectionClass($e))->getShortName();
    Logger::error('exceptions', "Exception {$class} | {$e->getMessage()}", Logger::requestInfo());
    return parent::report($e);
}

```

### Email alerts

[](#email-alerts)

Emails are only triggered if email sending is turned on, `app.debug` is false and the relevant error level meets the requirement. The Laravel mail system must be configured for emails to function.

### Database handler

[](#database-handler)

- Add the table using `php artisan logger:migration` and `php artisan migrate`
- Use the config file to set which channels should be logged to the database
- You may now query the database using the Eloquent model `DbEntry`

### Changelog

[](#changelog)

- v0.6: Enable daily log files by configuration
    - Upgrade: add new config file entries: `'daily' => [], 'max_daily' => 7,`
- v0.5: Enable configuration of base folder and dot notation for subfolders
    - Upgrade: add new config file entry: `'folder' => 'custom',`
- v0.4: Add database handler.
    - Upgrade: add new config file entries. To log entries to the database, add and run the migration, then update config file settings accordingly.
- v0.3: Remove Papertrail handler, use config file instead of .env, require PHP7.
    - Upgrade: publish and update the config file, make sure Papertrail handler is not required.

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance46

Moderate activity, may be stable

Popularity22

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 78.6% 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 ~150 days

Recently: every ~186 days

Total

25

Last Release

407d ago

PHP version history (3 changes)v0.3.1PHP &gt;=7.0.0

v0.9.0PHP &gt;=7.3.0

v0.11.1PHP ^7.3|^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1002427?v=4)[desther](/maintainers/desther)[@desther](https://github.com/desther)

---

Top Contributors

[![nztim](https://avatars.githubusercontent.com/u/3453450?v=4)](https://github.com/nztim "nztim (33 commits)")[![desthercz](https://avatars.githubusercontent.com/u/25509616?v=4)](https://github.com/desthercz "desthercz (9 commits)")

### Embed Badge

![Health badge](/badges/desthercz-logger/health.svg)

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

###  Alternatives

[overtrue/laravel-query-logger

A dev tool to log all queries for laravel application.

413307.5k6](/packages/overtrue-laravel-query-logger)[guanguans/laravel-exception-notify

Monitor exception and report to the notification channels(Log、Mail、AnPush、Bark、Chanify、DingTalk、Discord、Gitter、GoogleChat、IGot、Lark、Mattermost、MicrosoftTeams、NowPush、Ntfy、Push、Pushback、PushBullet、PushDeer、PushMe、Pushover、PushPlus、QQ、RocketChat、ServerChan、ShowdocPush、SimplePush、Slack、Telegram、WeWork、WPush、XiZhi、YiFengChuanHua、ZohoCliq、ZohoCliqWebHook、Zulip).

14642.7k1](/packages/guanguans-laravel-exception-notify)[regulus/activity-log

A clean and simple Laravel 5 activity logger for monitoring user activity on a website or web application.

164220.1k2](/packages/regulus-activity-log)

PHPackages © 2026

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