PHPackages                             solvrtech/laravel-logbook - 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. solvrtech/laravel-logbook

ActiveLibrary

solvrtech/laravel-logbook
=========================

This package provides integration with LogBook.

v1.0.2(2y ago)3921MITPHPPHP &gt;=8.0

Since Sep 13Pushed 2y ago1 watchersCompare

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

READMEChangelog (1)Dependencies (9)Versions (4)Used By (0)

laravel-logbook
===============

[](#laravel-logbook)

[Laravel-logbook](https://github.com/solvrtech/laravel-logbook) package extends Laravel's logging functionality by adding additional capabilities to send the log messages to the targeted LogBook installation. You can install the package by running the following command in the root folder of your Laravel application:

```
composer require solvrtech/laravel-logbook
```

then publish the **config/logging.php** config file as follows:

```
php artisan vendor:publish --tag=logbook
```

Edit the channels stack in the **config/logging.php** file to use “logbook” as follows:

```
// ...
'channels' => [
    // ...

    'logbook' => [
        'driver' => 'logbook',
        'level' => env('LOG_LEVEL', 'debug')
    ],
]
```

**laravel-logbook** also needs appropriate configuration in your application’s **.env** file.
For example:

```
LOG_CHANNEL=logbook
LOG_LEVEL=debug
LOGBOOK_API_URL="https://logbook.com"
LOGBOOK_API_KEY="4eaa39a6ff57c4..."

# Instance ID is a unique identifier per instance of your apps
LOGBOOK_INSTANCE_ID="default"
```

- **LOGBOOK\_INSTANCE\_ID**
    Define a unique identifier for the app’s deployment. This is useful when you have multiple app instances or deployments (e.g. in horizontally-scaled environments). For example, you can set “app-1” for the first instance and “app-2” for the second one. The instance ID information will be shown as part of log details in LogBook.
- **LOGBOOK\_API\_URL**
    The actual URL of your LogBook installation
- **LOGBOOK\_API\_KEY**
    The API key that LogBook had generated for the app
- **LOG\_CHANNEL**
    Must use **logbook** as defined in the **config/logging.php** file
- **LOG\_LEVEL**
    Specify the minimum log level that will be submitted to your LogBook installation. The ordered log levels are (from lowest to highest):

1. DEBUG
2. INFO
3. NOTICE
4. WARNING
5. ERROR
6. CRITICAL
7. ALERT
8. EMERGENCY

For example, if you set LOG\_LEVEL=WARNING, then only higher priority log levels such as WARNING, ERROR, CRITICAL, ALERT, and EMERGENCY are going to be submitted to your LogBook installation.

Submitting logs into LogBook
----------------------------

[](#submitting-logs-into-logbook)

To submit any log message, you just need to use the Laravel **Log** facade in your controller or service class:

```
use Illuminate\Support\Facades\Log;

class UserController extends Controller {

public function show($message) {
      Log::emergency($message);
      Log::alert($message);
      Log::critical($message);
      Log::error($message);
      Log::warning($message);
      Log::notice($message);
      Log::info($message);
      Log::debug($message);
      // ...
   }
}
```

More info about Laravel logging can be found in [their documentation page.](https://laravel.com/docs/10.x/logging)

Submitting logs asynchronously
------------------------------

[](#submitting-logs-asynchronously)

By default, logs from your application will be submitted synchronously as soon as they are recorded and this might lead to a performance issue for your application. Fortunately, you can submit the logs asynchronously by queuing the logs ( inside database or Redis) and then create a background task to submit the queue of logs in batch.

### 1. Storage for Queues

[](#1-storage-for-queues)

Set the following configuration in your application **.env** file:

```
# "database" or "redis"
LOGBOOK_TRANSPORT="database"
LOGBOOK_BATCH=15
```

- **LOGBOOK\_TRANSPORT:**specifies the type of storage for queuing mechanisms. Supported values are “database” or “redis”.
- **LOGBOOK\_BATCH:**maximum number of logs to be sent from your application into LogBook in a batch.

After configuring the storage for queuing of submitted logs, you will need to create a background task that will run: **php artisan logbook:log:consume** periodically. You can set this by using Systemd or Supervisor.

### 2.a Using Systemd

[](#2a-using-systemd)

Create a new service file, for example **/etc/systemd/system/log-consume.service**, then add the following configurations into the file:

```
[Unit]
Description=Log Consume
After=network.target

[Service]
ExecStart=/usr/bin/php artisan logbook:log:consume
WorkingDirectory=/path/to/your/laravel
User=www-data
Restart=always

[Install]
WantedBy=multi-user.target

```

Start the service and enable it during system reboot:

```
sudo systemctl start log-consume && sudo systemctl enable log-consume
```

### 2.b Using Supervisor

[](#2b-using-supervisor)

Create a new configuration file for the log consume service, for example **/etc/supervisor/conf.d/log-consume.conf**. Add the following configurations into the file:

```
[program:log-consume]
command=php /path/to/your/laravel/artisan logbook:log:consume
directory=/path/to/your/laravel
autostart=true
autorestart=true
stderr_logfile=/var/log/log-consume.err.log
stdout_logfile=/var/log/log-consume.out.log
user=www-data

```

To start the service, run the following commands:

```
sudo supervisorctl reread && sudo supervisorctl update && sudo supervisorctl start log-consume
```

Optional: set your application version
--------------------------------------

[](#optional-set-your-application-version)

Application version is an optional parameter that can also be included inside log submission data into your LogBook installation. To do so, add the "version" config in **/config/app.php** file:

```
return [
    // ...

    'version' => "1.0.0"
];
```

It's worth noting that while it's recommended to set the application version, it is an optional step. When the "version" config is not found, log submission should work normally, but the version information will not be found in the submitted logs.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 76.5% 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 ~4 days

Total

3

Last Release

960d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1950c853a0d75ec1868adc401a60eb255e067816e62f21b1c27f293cb6895cf9?d=identicon)[ketut-angga](/maintainers/ketut-angga)

---

Top Contributors

[![ketut-angga](https://avatars.githubusercontent.com/u/48515170?v=4)](https://github.com/ketut-angga "ketut-angga (39 commits)")[![insbali](https://avatars.githubusercontent.com/u/61682495?v=4)](https://github.com/insbali "insbali (12 commits)")

### Embed Badge

![Health badge](/badges/solvrtech-laravel-logbook/health.svg)

```
[![Health](https://phpackages.com/badges/solvrtech-laravel-logbook/health.svg)](https://phpackages.com/packages/solvrtech-laravel-logbook)
```

###  Alternatives

[laravel/cashier

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.

2.5k25.9M106](/packages/laravel-cashier)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k12.1M99](/packages/laravel-pulse)[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.4k43.5M5.2k](/packages/larastan-larastan)[laravel/passport

Laravel Passport provides OAuth2 server support to Laravel.

3.4k85.0M529](/packages/laravel-passport)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[spatie/laravel-enum

Laravel Enum support

3655.4M31](/packages/spatie-laravel-enum)

PHPackages © 2026

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