PHPackages                             thoth-pharaoh/logger - 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. thoth-pharaoh/logger

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

thoth-pharaoh/logger
====================

Log紀錄-收集器

v2.0.3(2y ago)0136MITPHPPHP ^8.0

Since Sep 30Pushed 2y ago1 watchersCompare

[ Source](https://github.com/castion2293/logger)[ Packagist](https://packagist.org/packages/thoth-pharaoh/logger)[ RSS](/packages/thoth-pharaoh-logger/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (22)Used By (0)

LOG紀錄-收集器
=========

[](#log紀錄-收集器)

可以歸類成不同資料夾，並以日期及小時做分類

```
logs
├── api
│   └── 2021-04-19
│       └── 14.log
└── crontab
    └── 2021-04-16
        └── 13.log

```

然後搭配 ap2hpoutre/laravel-log-viewer 套件，可以顯示Log視窗

版本匹配
----

[](#版本匹配)

Laravelpackage8.X1.X9.X2.X安裝
--

[](#安裝)

你可以使用 composer 做安裝

```
composer require thoth-pharaoh/logger
```

匯出 Config

```
php artisan vendor:publish --tag=logger-config --force
```

註冊 logs/{folder} 路由

RouteServiceProvider

```
 public function boot()
 {
   $this->routes(function () {
      Logger::routes();

      ....
    });
 }
```

至路由 `http://domain/logs/{folder}` 即可看到Log畫面

> folder為Log資料夾名稱 可以至 config/logger.php 中 log\_folders 欄位添加

使用方法
----

[](#使用方法)

### 使用 Facade:

[](#使用-facade)

先引入門面

```
use Pharaoh\Logger\Facades\Logger;
```

建立Log:

```
Logger::debug($folder, $message);
Logger::info($folder, $message);
Logger::notice($folder, $message);
Logger::warning($folder, $message);
Logger::error($folder, $message);
Logger::critical($folder, $message);
Logger::alert($folder, $message);
Logger::emergency($folder, $message);
```

參數說明類型範例$folderLog資料夾stringapi$messageLog訊息array\['error' =&gt; 'somethings went wrong'\]清除Log:

```
Logger::destroy($folder, $destroyDate);
```

參數說明類型範例$folderLog資料夾stringapi$destroyDate此日期以前的紀錄做清除string2021-03-01(意指 2021-02-28以前的紀錄做清除)也可以使用 Artisan Command 方便放到 Schedule 裡做定期清除任務

```
php artisan destroy:logs {--destroy_days=}
```

參數說明類型範例--destroy\_days保留幾天內的Log紀錄int30> destroy\_days 不給就是以 config.logger.php 中 destroy\_days 欄位為主

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity68

Established project with proven stability

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

Recently: every ~200 days

Total

21

Last Release

1019d ago

Major Versions

v1.2.0 → v2.0.02022-02-16

PHP version history (3 changes)v1.0.1PHP &gt;=7.3

v1.0.2PHP ^8.0

v1.1.8PHP ^7.3|^8.0

### Community

Maintainers

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

---

Top Contributors

[![castion2293](https://avatars.githubusercontent.com/u/20082281?v=4)](https://github.com/castion2293 "castion2293 (42 commits)")

### Embed Badge

![Health badge](/badges/thoth-pharaoh-logger/health.svg)

```
[![Health](https://phpackages.com/badges/thoth-pharaoh-logger/health.svg)](https://phpackages.com/packages/thoth-pharaoh-logger)
```

###  Alternatives

[spatie/laravel-health

Monitor the health of a Laravel application

85810.0M83](/packages/spatie-laravel-health)[beyondcode/laravel-server-timing

Add Server-Timing header information from within your Laravel apps.

5712.0M1](/packages/beyondcode-laravel-server-timing)[rollbar/rollbar-laravel

Rollbar error monitoring integration for Laravel projects

14110.4M7](/packages/rollbar-rollbar-laravel)[yadahan/laravel-authentication-log

Laravel Authentication Log provides authentication logger and notification for Laravel.

416632.8k5](/packages/yadahan-laravel-authentication-log)[kitloong/laravel-app-logger

Laravel log for your application

101.2M8](/packages/kitloong-laravel-app-logger)[label84/laravel-auth-log

Log user authentication actions in Laravel.

3654.0k](/packages/label84-laravel-auth-log)

PHPackages © 2026

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