PHPackages                             jmhc/laravel-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. jmhc/laravel-log

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

jmhc/laravel-log
================

Laravel log.

v8.0.1(5y ago)0342MITPHPPHP ^7.3

Since Nov 13Pushed 5y ago1 watchersCompare

[ Source](https://github.com/jumihc-company/laravel-log)[ Packagist](https://packagist.org/packages/jmhc/laravel-log)[ Docs](http://jumihc.com/)[ RSS](/packages/jmhc-laravel-log/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (1)Versions (4)Used By (2)

介绍
--

[](#介绍)

> 环境变量值参考：[env](docs/ENV.md)

安装配置
----

[](#安装配置)

使用以下命令安装：

```
$ composer require jmhc/laravel-log

```

快速使用
----

[](#快速使用)

- 配置环境变量
- `JMHC_LOG_DEBUG=false` 时 `debug` 级别日志不写入(默认为 `fasle`)
- 方法介绍:
    - `dir(string $dir)` 设置日志保存路径,相对于 `storage/logs`
    - `name(string $dir)` 设置日志名称(默认为 `laravel.log`)
    - `withDateToDir(bool $isBefore = true, string $format = 'Ymd')` 给路径添加日期
    - `withDateToName(bool $isBefore = true, string $format = 'Ymd')` 给名称添加日期
    - `withRequestInfo(bool $with = true)` 日志添加请求消息
    - `withMessageLineBreak(bool $with = true)` 日志添加消息换行
    - `throwable(Throwable $e, array $context = [])` 记录异常日志
- 书写业务代码

**业务代码：**

```
use Jmhc\Log\Log;

// 添加各个级别日志
// emergency、alert、 critical、 error、 warning、 notice、 info 和 debug
Log::info('This is info log');

// 添加指定路径
// app/storage/logs/d/laravel.log
Log::dir('d')
->info('This is info log');
// app/storage/logs/20200101/d/laravel.log
Log::dir('d')
->withDateToDir()
->info('This is info log');

// 添加指定名称路径
// app/storage/logs/d/i.log
Log::dir('d')
->name('i')
->info('This is info log');
// app/storage/logs/d/20200101-i.log
Log::dir('d')
->name('i')
->withDateToName()
->info('This is info log');
```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity51

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

Total

3

Last Release

1993d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2263baf3d3c09bc52fb734b0b5ad1e9b17905738b4d0029a328b789c79092ee7?d=identicon)[jmhc](/maintainers/jmhc)

---

Top Contributors

[![linshaowl](https://avatars.githubusercontent.com/u/19506950?v=4)](https://github.com/linshaowl "linshaowl (3 commits)")

---

Tags

loglaraveljmhc

### Embed Badge

![Health badge](/badges/jmhc-laravel-log/health.svg)

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

###  Alternatives

[ytake/laravel-fluent-logger

fluent logger for laravel and lumen

63541.6k1](/packages/ytake-laravel-fluent-logger)[kitloong/laravel-app-logger

Laravel log for your application

101.2M8](/packages/kitloong-laravel-app-logger)[moesif/moesif-laravel

Moesif Collection/Data Ingestion Middleware for Laravel

1065.8k](/packages/moesif-moesif-laravel)[melihovv/laravel-log-viewer

A Laravel log viewer

1231.5k1](/packages/melihovv-laravel-log-viewer)

PHPackages © 2026

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