oneawebmarketing/loghub-laravel

Laravel Wrapper for LogHub.cloud

1.0.0 2025-01-22 14:53 UTC

This package is auto-updated.

Last update: 2025-06-22 16:04:45 UTC


README

LogHub is a cloud logging platform to aggregate your logs from all your projects.

Installing

The recommended way to install LogHub PHP is through Composer.

composer require oneawebmarketing/loghub-laravel

Activation

In your bootstrap/app.php add the LogHubExceptionsHandler to your Exception Handlers

<?php

use Illuminate\Foundation\Application;
use Illuminate\Foundation\Configuration\Exceptions;
use Illuminate\Foundation\Configuration\Middleware;
use LogHub\LogHubExceptionsHandler;

return Application::configure(basePath: dirname(__DIR__))
    ->withRouting(
        web: __DIR__.'/../routes/web.php',
        commands: __DIR__.'/../routes/console.php',
        health: '/up',
    )
    ->withMiddleware(function (Middleware $middleware) {
        //
    })
    ->withExceptions(function (Exceptions $exceptions) {
        LogHubExceptionsHandler::handles($exceptions);
    })->create();

.env file and configuration

Provide your LogHub.cloud API Key in your .env with the key LOGHUB_API_KEY

By default the plugin will be sending Logs to LogHub if in local and production environment but feel free to change this as you like.

For this you can use the below artisan command and choose LogHub\ServiceProvider.

php artisan vendor:publish

Set the desired environments in config/loghub.php.

Security

If you discover a security vulnerability within this package, please send an email to security@loghub.cloud. All security vulnerabilities will be promptly addressed. Please do not disclose security-related issues publicly until a fix has been announced.

License

This repository is made available under the MIT License (MIT). Please see License File for more information.