Download the PHP package horde/log without Composer
On this page you can find all versions of the php package horde/log. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Package log
Short Description Logging library
License BSD-2-Clause
Homepage https://www.horde.org/libraries/Horde_Log
Informations about the package log
Horde Log
PSR-3 compatible logging library with legacy API support.
Overview
Horde Log provides two distinct APIs:
-
PSR-3 Native Logger (
src/, namespaceHorde\Log)- Modern PSR-4 autoloaded implementation
- Implements
Psr\Log\LoggerInterfacewith Horde extensions - Structured logging with context arrays
- Recommended for new code
- Native systemd journal backend allows filtering on context attributes
- Legacy Logger (
lib/, class prefixHorde_Log_)- PSR-0 autoloaded implementation
- Original Horde logging API (based on Zend_Log)
- Maintained for backward compatibility
Both implementations can interoperate:
Horde\Log\Handler\LoggerInterfaceHandlerwraps any PSR-3 logger as a Horde classic handler- Applications can inject PSR-3 loggers while maintaining legacy Horde log infrastructure
Installation
Basic Usage
PSR-3 Logger (Recommended)
Legacy Logger
Handlers
| Handler | Legacy (lib/) | Modern (src/) | Notes |
|---|---|---|---|
| Stream | Horde_Log_Handler_Stream |
StreamHandler |
Write to files or streams |
| Syslog | Horde_Log_Handler_Syslog |
SyslogHandler |
System logger integration |
| Systemd Journal | - | SystemdJournalHandler |
Modern only - Native systemd journal with structured data |
| Scribe | Horde_Log_Handler_Scribe |
ScribeHandler |
Apache Scribe logging |
| Firebug | Horde_Log_Handler_Firebug |
FirebugHandler |
Browser console logging (deprecated) |
| CLI | Horde_Log_Handler_Cli |
CliHandler |
Command-line output |
| Null | Horde_Log_Handler_Null |
NullHandler |
Discard all logs |
| Mock | Horde_Log_Handler_Mock |
MockHandler |
Testing purposes |
| PSR-3 Adapter | - | LoggerInterfaceHandler |
Modern only - Wrap any PSR-3 logger |
Filters
| Filter | Legacy (lib/) | Modern (src/) | Notes |
|---|---|---|---|
| Minimum Level | Horde_Log_Filter_Level |
MinimumLevelFilter |
Log at or above priority (legacy name: Level) |
| Maximum Level | - | MaximumLevelFilter |
Modern only - Log at or below priority |
| Exact Level | Horde_Log_Filter_ExactLevel |
ExactLevelFilter |
Log only specific priority |
| Message | Horde_Log_Filter_Message |
MessageFilter |
Regex-based message filtering |
| Constraint | Horde_Log_Filter_Constraint |
ConstraintFilter |
Custom constraint logic |
| Suppress | Horde_Log_Filter_Suppress |
SuppressFilter |
Suppress duplicate messages |
Formatters
| Formatter | Legacy (lib/) | Modern (src/) | Notes |
|---|---|---|---|
| Simple | Horde_Log_Formatter_Simple |
SimpleFormatter |
Template-based text formatting |
| PSR-3 | - | Psr3Formatter |
Modern only - PSR-3 {placeholder} interpolation |
| JSON Context | - | JsonContextFormatter |
Modern only - Append JSON-encoded context to message |
| Journald | - | JournaldContextFormatter |
Modern only - Systemd journal KEY=value fields |
| XML | Horde_Log_Formatter_Xml |
XmlFormatter |
XML structured output |
| CLI | Horde_Log_Formatter_Cli |
CliFormatter |
Colored terminal output |
Timestamps
Each LogMessage carries a DateTimeImmutable record timestamp, accessible via
$message->timestamp(). Formatters use this typed property directly:
SimpleFormatterrenders%timestamp%as ISO 8601.XmlFormatterwrites the<timestamp>element from the record timestamp.JournaldContextFormatterexcludes timestamp from fields (journal adds its own).
To control the record timestamp, pass a DateTimeInterface in context:
Non-DateTimeInterface values (integers, strings) in context['timestamp'] are
treated as opaque user data and do not affect the record time.
Upgrading
See doc/UPGRADING.md for migration guides from legacy API to PSR-3.
Requirements
- PHP 8.0 or later
- PSR-3 Logger Interface
License
BSD-2-Clause
Authors
- Mike Naberezny
- Chuck Hagenbuch
- Ralf Lang (current maintainer)
All versions of log with dependencies
psr/log Version ^3
horde/constraint Version ^3 || dev-FRAMEWORK_6_0
horde/exception Version ^3 || dev-FRAMEWORK_6_0
horde/util Version ^3 || dev-FRAMEWORK_6_0