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

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

horde/log
=========

Logging library

v3.0.0beta2(2mo ago)12.3k↑15%816BSD-2-ClausePHPPHP ^8

Since Jan 9Pushed 1mo ago6 watchersCompare

[ Source](https://github.com/horde/Log)[ Packagist](https://packagist.org/packages/horde/log)[ Docs](https://www.horde.org/libraries/Horde_Log)[ RSS](/packages/horde-log/feed)WikiDiscussions FRAMEWORK\_6\_0 Synced 1mo ago

READMEChangelog (2)Dependencies (18)Versions (20)Used By (16)

Horde Log
=========

[](#horde-log)

PSR-3 compatible logging library with legacy API support.

Overview
--------

[](#overview)

Horde Log provides two distinct APIs:

1. **PSR-3 Native Logger** (`src/`, namespace `Horde\Log`)

    - Modern PSR-4 autoloaded implementation
    - Implements `Psr\Log\LoggerInterface` with Horde extensions
    - Structured logging with context arrays
    - Recommended for new code
    - Native systemd journal backend allows filtering on context attributes
2. **Legacy Logger** (`lib/`, class prefix `Horde_Log_`)

    - PSR-0 autoloaded implementation
    - Original Horde logging API (based on Zend\_Log)
    - Maintained for backward compatibility

Both implementations can interoperate:

- `Horde\Log\Handler\LoggerInterfaceHandler` wraps any PSR-3 logger as a Horde classic handler
- Applications can inject PSR-3 loggers while maintaining legacy Horde log infrastructure

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

[](#installation)

```
composer require horde/log
```

Basic Usage
-----------

[](#basic-usage)

### PSR-3 Logger (Recommended)

[](#psr-3-logger-recommended)

```
use Horde\Log\Logger;
use Horde\Log\Handler\StreamHandler;
use Horde\Log\LogLevel;

$logger = new Logger();
$logger->addHandler(new StreamHandler('/var/log/app.log'));

// Structured logging with context
$logger->info('User authenticated', [
    'username' => 'alice',
    'session_id' => 'abc123',
    'success' => true,
]);

$logger->error('Authentication failed', [
    'username' => 'bob',
    'reason' => 'invalid_password',
]);
```

### Legacy Logger

[](#legacy-logger)

```
$logger = new Horde_Log_Logger(
    new Horde_Log_Handler_Stream('/var/log/app.log')
);

$logger->info('User authenticated: alice');
$logger->err('Authentication failed for bob');
```

Handlers
--------

[](#handlers)

HandlerLegacy (lib/)Modern (src/)NotesStream`Horde_Log_Handler_Stream``StreamHandler`Write to files or streamsSyslog`Horde_Log_Handler_Syslog``SyslogHandler`System logger integrationSystemd Journal-`SystemdJournalHandler`**Modern only** - Native systemd journal with structured dataScribe`Horde_Log_Handler_Scribe``ScribeHandler`Apache Scribe loggingFirebug`Horde_Log_Handler_Firebug``FirebugHandler`Browser console logging (deprecated)CLI`Horde_Log_Handler_Cli``CliHandler`Command-line outputNull`Horde_Log_Handler_Null``NullHandler`Discard all logsMock`Horde_Log_Handler_Mock``MockHandler`Testing purposesPSR-3 Adapter-`LoggerInterfaceHandler`**Modern only** - Wrap any PSR-3 loggerFilters
-------

[](#filters)

FilterLegacy (lib/)Modern (src/)NotesMinimum Level`Horde_Log_Filter_Level``MinimumLevelFilter`Log at or above priority (legacy name: Level)Maximum Level-`MaximumLevelFilter`**Modern only** - Log at or below priorityExact Level`Horde_Log_Filter_ExactLevel``ExactLevelFilter`Log only specific priorityMessage`Horde_Log_Filter_Message``MessageFilter`Regex-based message filteringConstraint`Horde_Log_Filter_Constraint``ConstraintFilter`Custom constraint logicSuppress`Horde_Log_Filter_Suppress``SuppressFilter`Suppress duplicate messagesFormatters
----------

[](#formatters)

FormatterLegacy (lib/)Modern (src/)NotesSimple`Horde_Log_Formatter_Simple``SimpleFormatter`Basic text formattingPSR-3-`Psr3Formatter`**Modern only** - PSR-3 standard format with contextXML`Horde_Log_Formatter_Xml``XmlFormatter`XML structured outputCLI`Horde_Log_Formatter_Cli``CliFormatter`Colored terminal outputUpgrading
---------

[](#upgrading)

See [doc/UPGRADING.md](doc/UPGRADING.md) for migration guides from legacy API to PSR-3.

Requirements
------------

[](#requirements)

- PHP 8.0 or later
- PSR-3 Logger Interface

License
-------

[](#license)

BSD-2-Clause

Authors
-------

[](#authors)

- Mike Naberezny
- Chuck Hagenbuch
- Ralf Lang (current maintainer)

###  Health Score

53

—

FairBetter than 97% of packages

Maintenance88

Actively maintained with recent releases

Popularity27

Limited adoption so far

Community35

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 51.9% 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 ~272 days

Recently: every ~318 days

Total

16

Last Release

68d ago

Major Versions

2.3.0 → 3.0.0alpha12021-02-24

PHP version history (5 changes)2.1.1PHP &gt;=5.3.0,&lt;=6.0.0alpha1

2.1.3PHP &gt;=5.3.0,&lt;=8.0.0alpha1

3.0.0alpha1PHP ^7

v3.0.0alpha4PHP ^7.4 || ^8

v3.0.0alpha9PHP ^8

### Community

Maintainers

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

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

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

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

---

Top Contributors

[![yunosh](https://avatars.githubusercontent.com/u/379318?v=4)](https://github.com/yunosh "yunosh (112 commits)")[![ralflang](https://avatars.githubusercontent.com/u/646976?v=4)](https://github.com/ralflang "ralflang (58 commits)")[![slusarz](https://avatars.githubusercontent.com/u/381003?v=4)](https://github.com/slusarz "slusarz (13 commits)")[![midahp](https://avatars.githubusercontent.com/u/19747890?v=4)](https://github.com/midahp "midahp (9 commits)")[![mrubinsk](https://avatars.githubusercontent.com/u/66822?v=4)](https://github.com/mrubinsk "mrubinsk (8 commits)")[![boekhorstb1](https://avatars.githubusercontent.com/u/91957243?v=4)](https://github.com/boekhorstb1 "boekhorstb1 (7 commits)")[![wrobel](https://avatars.githubusercontent.com/u/10232?v=4)](https://github.com/wrobel "wrobel (4 commits)")[![daweeb](https://avatars.githubusercontent.com/u/71753987?v=4)](https://github.com/daweeb "daweeb (2 commits)")[![moritz2111](https://avatars.githubusercontent.com/u/94838693?v=4)](https://github.com/moritz2111 "moritz2111 (1 commits)")[![mnaberez](https://avatars.githubusercontent.com/u/52712?v=4)](https://github.com/mnaberez "mnaberez (1 commits)")[![bklang](https://avatars.githubusercontent.com/u/167131?v=4)](https://github.com/bklang "bklang (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[sentry/sentry

PHP SDK for Sentry (http://sentry.io)

1.9k227.1M273](/packages/sentry-sentry)[rollbar/rollbar

Monitors errors and exceptions and reports them to Rollbar

33723.7M82](/packages/rollbar-rollbar)[illuminate/log

The Illuminate Log package.

6224.3M518](/packages/illuminate-log)[open-telemetry/api

API for OpenTelemetry PHP.

1933.0M214](/packages/open-telemetry-api)[open-telemetry/sdk

SDK for OpenTelemetry PHP.

2322.9M248](/packages/open-telemetry-sdk)[pagemachine/typo3-formlog

Form log for TYPO3

23225.3k6](/packages/pagemachine-typo3-formlog)

PHPackages © 2026

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