itpath/huntglitch

Huntglitch package for the glitch

1.0.0 2025-08-08 04:28 UTC

This package is auto-updated.

Last update: 2025-08-08 07:31:56 UTC


README

Huntglitch is a development monitoring platform that can help you instantly solve bugs, broken codes and avoid crashes and false API calls with ease. Huntglitch gives you answers, not hints.

You can use Huntglitch to find out any errors or bugs in the critical codes of your app or software, quickly find out bugs, prevent lags due to rising user requests by forecasting future demand and quickly monitor the overall health of your app or software with ease.

๐Ÿท๏ธ #Loggingย  #Debuggingย  #Laravelย  #PHPย  #Monitoringย  #QueryLogger

๐Ÿ“š Documentation

๐Ÿ“ Getting Started with Huntglitch

Before implementing the package, please complete these setup steps:

  1. Register an Account
    Sign up for a free Huntglitch account here: https://app.huntglitch.com/register

  2. Create a Project
    Once registered, create a new project here: https://app.huntglitch.com/project/create

  3. Follow the Installation & Implementation Guide
    Implement this package in your Laravel application by following the steps in the Installation and Usage in Laravel sections of this README.

  4. View Your Logs & Error Reports
    After the integration is complete and your application starts generating logs, you can view all errors, warnings, and queries in your Huntglitch dashboard:
    https://app.huntglitch.com/projects โ†’ Select your project to view detailed logs.

โšก Features

  • Automatic logging of exceptions and errors
  • Track and store MySQL query logs
  • Integrate easily with Laravel exception handler
  • PSR-4 autoloading support
  • Laravel vendor publish support for easy config
  • Built-in support for tagging logs with severity levels

๐Ÿ›  Supported Versions

  • PHP: ^8.0
  • Laravel: ^9.0 | ^10.0 | ^11.0 | ^12.0

๐Ÿ“ฆ Installation

Run the following command to install the package via Composer:

composer require itpath/huntglitch

๐ŸŒ Environment Variables

Add these variables to your .env file if you are using Huntglitch integration:

HUNTGLITCH_PROJECT_ID={your-project-id}
HUNTGLITCH_DELIVERABLE_ID={your-deliverable-id}
HUNTGLITCH_LOG_ENDPOINT=https://api.huntglitch.com/

And update config/app.php to use them:

'HUNTGLITCH_PROJECT_ID' => env('HUNTGLITCH_PROJECT_ID', ''),
'HUNTGLITCH_DELIVERABLE_ID' => env('HUNTGLITCH_DELIVERABLE_ID', ''),
'HUNTGLITCH_LOG_ENDPOINT' => env('https://api.huntglitch.com/', ''),

Finally, regenerate the autoloader:

composer dump-autoload

๐Ÿš€ Usage in Laravel

โžค Basic Usage in a try-catch block

use Itpath\Huntglitch\Huntglitch;

try {
    echo 100 / 0;
} catch (Throwable $e) {
    $glitch = new Huntglitch();
    $glitch->add($e);
}

โžค Global Usage for Exception Logging

For Laravel 9, 10, and 11 (Handler.php method)

Update the register() method in app/Exceptions/Handler.php:

use Itpath\Huntglitch\Huntglitch;

public function register()
{
    $this->reportable(function (Throwable $e) {
        $glitch = new Huntglitch();
        $glitch->add($e);
    });
}

For Laravel 12 (bootstrap/app.php method)

In Laravel 12, the Handler.php file is no longer used for exception handling.
Instead, open bootstrap/app.php and add the following inside the exception configuration section:

use Illuminate\Foundation\Configuration\Exceptions;
use Itpath\Huntglitch\Huntglitch;

->withExceptions(function (Exceptions $exceptions): void {
    $exceptions->report(function (\Throwable $e) {
        $glitch = new Huntglitch();
        $glitch->add($e);
    });
})
->create();

๐Ÿงช Methods Overview

add($exception, $type = 'error', $additionalData = [])

  • Logs a message or exception
  • Optional second parameter sets severity (e.g., debug, info, warning, error)
  • Third optional parameter is an array for custom context data

Predefined Logging Methods

You can also use:

addError($e, $data);
addWarning($e, $data);
addInfo($e, $data);
addDebug($e, $data);
addNotice($e, $data);

All these methods accept:

  • string|Throwable $e
  • array $data (optional)

FAQs

1. What does this package do?

๐Ÿ” The Huntglitch package provides an Error & Query Logger Package to monitor errors, warning, info and debug of Laravel applications.

2. How do I install the package?

๐Ÿ“ฆ Run the following command in your terminal:

composer require itpathsolutions/huntglitch

3. Which Laravel versions are supported?

This package supports Laravel 9, 10, 11, and 12 with PHP 8+ compatibility.

5. How do I update the package to the latest version?

Run the following command to update:

composer update itpathsolutions/huntglitch

6. Can I contribute to this package?

๐Ÿค Absolutely! Contributions are welcome. See the CONTRIBUTING guidelines for details.

7. Where can I get support?

For any support or queries, contact us via IT Path Solutions.

Contributing

We welcome contributions from the community! Feel free to Fork the repository and contribute to this module. You can also create a pull request, and we will merge your changes into the main branch. See CONTRIBUTING for details.

Security Vulnerabilities

Please review our Security Policy on how to report security vulnerabilities.

License

This package is open-source and available under the MIT License. See the LICENSE file for details.

Get Support

  • Feel free to contact us if you have any questions.
  • If you find this project helpful, please give us a โญ Star.

You may also find our other useful packages: