PHPackages                             mdabagh/generatelog - 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. mdabagh/generatelog

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

mdabagh/generatelog
===================

generate log

v1.0.2(3y ago)11121[1 issues](https://github.com/mdabagh/generateLog/issues)PHP

Since May 2Pushed 3y ago2 watchersCompare

[ Source](https://github.com/mdabagh/generateLog)[ Packagist](https://packagist.org/packages/mdabagh/generatelog)[ RSS](/packages/mdabagh-generatelog/feed)WikiDiscussions main Synced yesterday

READMEChangelog (3)DependenciesVersions (4)Used By (0)

GenerateLog
===========

[](#generatelog)

With the GenerateLog package, you can easily and accurately store your program logs in both database and storage. This package provides the ability to customize log information, such as adding IP addresses, user information, and executed file information to your logs.

Additionally, you can easily set your log level in the env file. For example, you can temporarily disable info logs and later reactivate them as needed.

The GenerateLog package offers customizable features, ease of use, and the ability to manage program logs with precision and high quality.

Features
--------

[](#features)

- Customize log information: With Laravel Custom Logger, you can log additional information such as IP address, user information, and file execution information. You can easily customize the information that is logged to meet your specific needs.
- Fine-grained control: This package provides fine-grained control over logging levels. You can choose to log only the most important messages, or log everything for detailed debugging.
- Dual storage: You can choose to store your logs in both the database and storage simultaneously. This allows you to have a backup of your logs in case one storage location fails.

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

[](#installation)

To install the package, simply run the following command:

```
composer require mdabagh/generatelog

```

Usage
-----

[](#usage)

To use the package, you need to include the `GLogFactory` class in your code:

```
use Mdabagh\GenerateLog\GLogFactory;

```

Then, you can call the `make` method to generate a log file:

```
GLogFactory::create($type, $message, $data, $exception, $request, $response);

```

The `make` method takes six parameters:

- `$type`: The type of the log message (info, warning, debug, or error).
- `$message`: The message to log.
- `$data`: Additional data to include in the log file.
- `$exception`: The exception object (if any).
- `$request`: The HTTP request object (if any).
- `$response`: The HTTP response object (if any).

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

[](#configuration)

To configure GenerateLog, you can set the following environment variables in the `.env` file of your Laravel application:

### GLOG\_STATE\_ACTIVE

[](#glog_state_active)

This variable specifies whether to use the database (`db`), the file system (`storage`), or both (`dbAndStorage`) to store log files. By default, it is set to `storage`.

When `GLOG_STATE_ACTIVE` is set to `storage`, GenerateLog uses Laravel's built-in logging functionality to generate log files. The `config/logging.php` file in your Laravel application specifies the location and format of the log files.

By default, Laravel stores log files in the `storage/logs` directory. You can change this location by modifying the `path` option in the `config/logging.php` file. For example, to store log files in a subdirectory called `logs` under the `storage/app` directory, you can change the `path` option as follows:

```
'path' => storage_path('app/logs/laravel.log'),
```

You can also change the format of the log files by modifying the `channels` option in the `config/logging.php` file. For example, to log messages in JSON format, you can add a new channel as follows:

```
'json' => [
    'driver' => 'single',
    'path' => storage_path('logs/laravel.json'),
    'level' => 'debug',
],
```

Then, you can set `GLOG_STATE_ACTIVE` to `storage` in your `.env` file to enable logging to the file system:

```
GLOG_STATE_ACTIVE=storage

```

If you want to use the database to store log files, you can set `GLOG_STATE_ACTIVE` to `db`. In this case, you also need to run the `Logging` migration to create the necessary database table:

```
php artisan migrate

```

### GLOG\_TYPE\_INFO\_ACTIVE, GLOG\_TYPE\_WARNING\_ACTIVE, GLOG\_TYPE\_DEBUG\_ACTIVE, GLOG\_TYPE\_ERROR\_ACTIVE

[](#glog_type_info_active-glog_type_warning_active-glog_type_debug_active-glog_type_error_active)

These variables specify whether to log messages of a particular type (`info`, `warning`, `debug`, or `error`). By default, all types are set to `true`.

Example usage:

```
GLOG_TYPE_INFO_ACTIVE=false
GLOG_TYPE_WARNING_ACTIVE=true
GLOG_TYPE_DEBUG_ACTIVE=true
GLOG_TYPE_ERROR_ACTIVE=true

```

Note that if you change the value of any of these environment variables, you may need to restart your application for the changes to take effect.

References
----------

[](#references)

- Laravel documentation on [Logging](https://laravel.com/docs/8.x/logging)
- Laravel documentation on [Configuration](https://laravel.com/docs/8.x/configuration)

License
-------

[](#license)

GenerateLog is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity47

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 ~2 days

Total

3

Last Release

1153d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/932753eed947c75860c93dd8224e54b6d7c9a69c54b852a29d6c7cd4966485fd?d=identicon)[mdabbagh-ir](/maintainers/mdabbagh-ir)

---

Top Contributors

[![mdabagh](https://avatars.githubusercontent.com/u/45653004?v=4)](https://github.com/mdabagh "mdabagh (20 commits)")

---

Tags

laravellaravel-package

### Embed Badge

![Health badge](/badges/mdabagh-generatelog/health.svg)

```
[![Health](https://phpackages.com/badges/mdabagh-generatelog/health.svg)](https://phpackages.com/packages/mdabagh-generatelog)
```

###  Alternatives

[psr/log

Common interface for logging libraries

10.4k1.2B11.5k](/packages/psr-log)[open-telemetry/api

API for OpenTelemetry PHP.

1941.5M276](/packages/open-telemetry-api)[open-telemetry/sdk

SDK for OpenTelemetry PHP.

2328.5M343](/packages/open-telemetry-sdk)

PHPackages © 2026

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