PHPackages                             johannschopplich/kirbylog - 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. johannschopplich/kirbylog

ActiveKirby-plugin[Logging &amp; Monitoring](/categories/logging)

johannschopplich/kirbylog
=========================

Zero-dependency global `kirbylog()` helper for any content

1.4.7(2y ago)284.3k↑842.9%12MITPHP

Since Aug 23Pushed 1y ago2 watchersCompare

[ Source](https://github.com/johannschopplich/kirbylog)[ Packagist](https://packagist.org/packages/johannschopplich/kirbylog)[ Docs](https://github.com/johannschopplich/kirbylog#readme)[ RSS](/packages/johannschopplich-kirbylog/feed)WikiDiscussions main Synced 3d ago

READMEChangelog (10)Dependencies (4)Versions (23)Used By (2)

[![Kirbylog](./.github/kirbylog.png)](./.github/kirbylog.png)

Kirbylog
========

[](#kirbylog)

The most simple, Kirby-esque way to log content to file.

Most of the time, I just want to log some string or array to a file. That's what this plugin does. The given input:

```
// Anywhere in your code
kirbylog('Something happened');
```

… will produce this example output `site/logs/2023-08-23.log`:

```
[2023-08-23 09:28:04] INFO Something happened

```

Key features
------------

[](#key-features)

- 🪃 Global `kirbylog()` helper usable anywhere
- 💬 Arrays will be converted to JSON
- 🧩 Dependency-free, based solely on Kirby internals
- 🔢 Supports logging levels

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

[](#installation)

### Composer

[](#composer)

```
composer require johannschopplich/kirbylog
```

### Download

[](#download)

Download and copy this repository to `/site/plugins/kirbylog`.

Usage
-----

[](#usage)

This plugin registers a global `kirbylog` function, callable anywhere.

```
kirbylog('Log this to file');
```

### Logging level

[](#logging-level)

Pass the logging level of your choice as the second parameter (upper or lower case is irrelevant). By default, content will be logged with the `INFO` level. This plugin uses logging levels described by [RFC 5424](http://tools.ietf.org/html/rfc5424). Of course, you can tailor them to your needs.

```
kirbylog($response->code(), 'error');
```

Generated log file:

```
[2023-08-23 12:43:56] ERROR 401

```

Options
-------

[](#options)

> All options have to prefixed with `johannschopplich.kirbylog.` in your `config.php`.

OptionDefaultTypeDescription`dir``fn () => kirby()->root('logs')``string` or `function`Root directory for your logs. Note: Wrap `kirby()` calls in a function, because Kirby hasn't initialized in `config.php` yet.`filename``date('Y-m-d') . '.log'``string`Filename to write logged content to.`defaultLevel``info``string`Default logging level to use. Doesn't need to be case sensitive.`levels`[Source reference](https://github.com/johannschopplich/kirbylog/blob/main/index.php#L15)`array`List of logging levels. By default, `kirbylog` supports the logging levels described by [RFC 5424](http://tools.ietf.org/html/rfc5424).Configuration example for your `site/config/config.php` file:

```
return [
    'johannschopplich.kirbylog' => [
        'filename' => 'test.log'
    ]
]
```

Alternatives
------------

[](#alternatives)

- [bnomei/kirby3-monolog](https://github.com/bnomei/kirby3-monolog) – Use Monolog to log data to files, databases, create notifications etc.
- [bvdputte/kirby-log](https://github.com/bvdputte/kirby-log) – Another logger in the Kirby-sphere, wrapping the [KLogger](https://github.com/katzgrau/KLogger) library.

License
-------

[](#license)

[MIT](./LICENSE) License © 2022-PRESENT [Johann Schopplich](https://github.com/johannschopplich)

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance33

Infrequent updates — may be unmaintained

Popularity32

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity61

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

Recently: every ~80 days

Total

22

Last Release

962d ago

### Community

Maintainers

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

---

Top Contributors

[![johannschopplich](https://avatars.githubusercontent.com/u/27850750?v=4)](https://github.com/johannschopplich "johannschopplich (63 commits)")

---

Tags

kirby-cmskirby-pluginkirby4kirby5logloggerkirbygetkirby

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/johannschopplich-kirbylog/health.svg)

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

###  Alternatives

[getkirby/cms

The Kirby core

1.5k584.8k476](/packages/getkirby-cms)[analog/analog

Fast, flexible, easy PSR-3-compatible PHP logging package with dozens of handlers.

3511.6M24](/packages/analog-analog)[theorchard/monolog-cascade

Monolog extension to configure multiple loggers in the blink of an eye and access them from anywhere

1482.2M9](/packages/theorchard-monolog-cascade)[inpsyde/wonolog

Monolog-based logging package for WordPress.

184637.3k7](/packages/inpsyde-wonolog)[amphp/log

Non-blocking logging for PHP based on Amp, Revolt, and Monolog.

402.9M82](/packages/amphp-log)[apix/log

Minimalist, thin and fast PSR-3 compliant (multi-bucket) logger.

521.1M21](/packages/apix-log)

PHPackages © 2026

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