PHPackages                             ch17/blue-log - 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. ch17/blue-log

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

ch17/blue-log
=============

Laravel log to database

v2.0.0(1y ago)0191MITPHP

Since Nov 8Pushed 1y ago1 watchersCompare

[ Source](https://github.com/CH17/bluelog)[ Packagist](https://packagist.org/packages/ch17/blue-log)[ RSS](/packages/ch17-blue-log/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (9)Used By (0)

BlueLog
=======

[](#bluelog)

#### \[ Super simple DB logger, that works! \]

[](#-super-simple-db-logger-that-works-)

BlueLog is a simple logging package for Laravel that allows you to log messages with context and extra information into both files and a database. It supports logging levels and channels, with precise timestamps down to milliseconds for better debugging and monitoring.

Features
--------

[](#features)

- Log messages with various levels (debug, info, warning, error etc.)
- Log to both files and a database
- Store context and extra information with logs
- Use millisecond precision for timestamps
- Configurable log levels
- Provide pre-defined Service and Facade
- Store logged in user information as created\_by
- Supports custom channels
- Super simple plug and play to use

Installation
------------

[](#installation)

1. **Require the package via Composer:**

    ```
    composer require ch17/blue-log
    ```
2. **Publish the configuration file and migration:**

    ```
    php artisan vendor:publish --tag=blue-log-migrations
    php artisan vendor:publish --tag=blue-log-config
    ```
3. **Run the migrations:**

    ```
    php artisan migrate
    ```

Configuration
-------------

[](#configuration)

BlueLog's configuration file is located at `config/bluelog.php`. You can customize the default log level and other settings in this file.

```
    // Setup default log Channel
    'default_log_channel' => 'Default',

    // Setup default log Level
    // info, debug, error, warning
    'default_log_level' => 'debug',

    // False if authenticated user information should not be stored
    'store_logged_by' => true,

    // add fields want to store for login user as created_by
    'logged_by_fields' => [
        'id',
        'email',
    ],
```

Usage
-----

[](#usage)

To use BlueLog, you can either call the logging methods directly on the `BlueLog` facade or inject the `BlueLogger` class into your services.

### Logging Methods

[](#logging-methods)

BlueLog provides methods for each logging level:

```
use Ch17\BlueLog\Facades\BlueLog as Log;

   Log::debug('default', 'This is a debug message', ['context' => 'value'], ['extra' => 'value']);
   Log::info('default', 'This is an info message', ['context' => 'value'], ['extra' => 'value']);
   Log::warning('default', 'This is a warning message', ['context' => 'value'], ['extra' => 'value']);
   Log::error('default', 'This is an error message', ['context' => 'value'], ['extra' => 'value']);
```

Or if its not enough of your style

```
use Ch17\BlueLog\Facades\BlueLog as Log;

   Log::error([
    'message' => 'a new error message'
   ]);

    Log::warning([
      'channel' => 'user.create',
      'message' => 'a new warning message'
   ]);
```

With the service:

```
use Ch17\BlueLog\Services\BlueLogger as logger;

   protected $logger;

    public function __construct(BlueLogger $logger)
    {
        $this->logger = $logger;
    }
```

Or

```
use Ch17\BlueLog\Services\BlueLogger as logger;

   $logger = new BlueLogger();
```

```
$this->logger->debug('default', 'This is a debug message', ['context' => 'value'], ['extra' => 'value']);
$this->logger->info('default', 'This is an info message', ['context' => 'value'], ['extra' => 'value']);
$this->logger->warning('default', 'This is a warning message', ['context' => 'value'], ['extra' => 'value']);
$logger->info('USER-DELETE', 'User deleted successfully!', ['deletedUser' => json_encode([])], ['extra' => 'value']);
```

Or

```
    $logger->error([
    'message' => 'a new error message'
   ]);

    $logger->warning([
      'channel' => 'user.create',
      'message' => 'a new warning message',
      'context' => ['deletedUser' => json_encode($createdUser)]
   ]);
```

License
-------

[](#license)

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~0 days

Total

8

Last Release

553d ago

Major Versions

v1.0.6 → v2.0.02024-11-10

### Community

Maintainers

![](https://www.gravatar.com/avatar/d6cc6811308e1e65b451cd702f011a416b4d903d38b81b74bc0754b3bd70ed9b?d=identicon)[ch17](/maintainers/ch17)

---

Top Contributors

[![CH17](https://avatars.githubusercontent.com/u/39479222?v=4)](https://github.com/CH17 "CH17 (1 commits)")

### Embed Badge

![Health badge](/badges/ch17-blue-log/health.svg)

```
[![Health](https://phpackages.com/badges/ch17-blue-log/health.svg)](https://phpackages.com/packages/ch17-blue-log)
```

###  Alternatives

[psr/log

Common interface for logging libraries

10.4k1.2B9.2k](/packages/psr-log)[itsgoingd/clockwork

php dev tools in your browser

5.9k27.6M94](/packages/itsgoingd-clockwork)[graylog2/gelf-php

A php implementation to send log-messages to a GELF compatible backend like Graylog2.

41838.2M138](/packages/graylog2-gelf-php)[bugsnag/bugsnag-psr-logger

Official Bugsnag PHP PSR Logger.

32132.5M2](/packages/bugsnag-bugsnag-psr-logger)[consolidation/log

Improved Psr-3 / Psr\\Log logger based on Symfony Console components.

15462.2M7](/packages/consolidation-log)[datadog/php-datadogstatsd

An extremely simple PHP datadogstatsd client

19124.6M15](/packages/datadog-php-datadogstatsd)

PHPackages © 2026

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