PHPackages                             noccylabs/log-hoc - 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. noccylabs/log-hoc

ActiveLibrary

noccylabs/log-hoc
=================

Ad-hoc task-oriented logger

03PHP

Since Apr 6Pushed 6y ago1 watchersCompare

[ Source](https://github.com/noccy80/php-log-hoc)[ Packagist](https://packagist.org/packages/noccylabs/log-hoc)[ RSS](/packages/noccylabs-log-hoc/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

LogHoc: An ad-hoc logger
========================

[](#loghoc-an-ad-hoc-logger)

This is an ad-hoc logger that implements the PSR `LoggerInterface`and shoves its output into an easily accessible buffer. Use it to collect information on different processes in a system without cluttering the application log.

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

[](#installation)

Install using composer:

```
$ composer require noccylabs/log-hoc

```

Using
-----

[](#using)

The logger implements `Psr\LoggerInterface` so you can use it like any other logger:

```
$log = new LogBuffer();
$log->info("Things are going well");
$log->debug("You should know this tho: {message}", [ 'message'=>"xyzzy" ]);
$log->warning("Uh-oh");
$log->error("Something went wrong");

```

You can also dump variables to it, as long as they can be serialized to json:

```
$log = new LogBuffer();
$log->dump($customerOrder);
$log->dump($result);

```

Marking will drop a marker in the log, representing a split point, start or stop of a process etc.

```
$log = new LogBuffer();
$log->mark("Starting order processing");

```

To see what has been logged, you can either string-cast it, or use the `getBuffer()`or `getBufferArray()` methods to fetch the contents.

```
$log = new LogBuffer();
$orderProcessor->process($order, $log);

$order->setProcessingLog($log->getBuffer());

```

You can customize the format slightly:

```
$log = new LogBuffer();
$log->setFormat("%levelpad% %timestamp% // %message%");

```

You can use `%time%`, `%message%`, `%level%`, `%levelpad%` and `%context%` placeholders in the format specifier:

```
%time%      "19:37:44"
%message%   "This is a log message"
%level%     "info"
%levelpad%  "      info" (right-aligned to 10 chars)
%context%   "{"foo":"bar"}"

```

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity33

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/8d64de61943112cad68fd83b1068d157d6c96890d23959855f6a1ea42bcdcce3?d=identicon)[noccy80](/maintainers/noccy80)

---

Top Contributors

[![noccy80](https://avatars.githubusercontent.com/u/1434055?v=4)](https://github.com/noccy80 "noccy80 (2 commits)")

### Embed Badge

![Health badge](/badges/noccylabs-log-hoc/health.svg)

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

PHPackages © 2026

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