Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Exceptionlog Laravel Package

adrianoalves/laravel-exceptionlog

Minimal Laravel 7+ package to persist exceptions to a database logs table. Install via Composer, migrate, then call ExceptionLog::persist($exception, $level). Includes simple level mapper (app, DB, server, console, jobs) and is customizable.

View on GitHub
Deep Wiki
Context7

ExceptionLog Custom Laravel 7+ Package

Simplest/Minimum Laravel Exception Log Persistence Layer Package

Installation

Use composer require adrianoalves/laravel-exceptionlog to install the package.

Execute php artisan migrate to create the logs database table

How to Use

Just call the following Method in your application:

try{
  // ... put your watched code here
}
catch( \Exception $exception ){
    ExceptionLog::persist( $exception, ExceptionLog\LevelMapper::LEVEL_ERROR_APPLICATION );
}

It is simple as pie :)

Log Levels

The package has a much simple mapper to organize exceptions in levels/categories.

const LEVEL_NOTICE            = 1;

    const LEVEL_WARNING           = 2;

    const LEVEL_ERROR_APPLICATION = 3;

    const LEVEL_ERROR_DATABASE    = 4;

    const LEVEL_ERROR_SERVER      = 5;

    const LEVEL_ERROR_CONSOLE     = 6;

    const LEVEL_ERROR_JOB         = 7;

    public static $mapper = [
        1 => [ 'label' => 'Notificação' ],
        2 => [ 'label' => 'Aviso' ],
        3 => [ 'label' => 'Erro: Sistema' ],
        4 => [ 'label' => 'Erro: Persistência' ],
        5 => [ 'label' => 'Erro: Servidor' ],
        6 => [ 'label' => 'Erro: Console' ],
        7 => [ 'label' => 'Erro: Execução de Job' ],
    ];

You can create and customize your own levels and dictionaries to better identify your application Exceptions.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge