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

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

calguy1000/logger
=================

A powerful application logging, and log querying tool.

16PHP

Since Aug 17Pushed 9y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

logger
======

[](#logger)

A simple logging utility with rotation, concurrency, repeat counting and search support.

This library provides the ability for your application to log debug messages, info messages, warnings and errors to a text file. The library supports rotation, counting sequentially repeated messages, writing to the same file from multiple processes, and querying the files. It is suitable for applications that need various amounts of debugging, logging or auditing capabilities.

Features
========

[](#features)

- Provides a simple, extensible mechanism for allowing an application to perform logging.
- Provides a logging interface
- FileLogger class Can count identical sequental messages
- Can track separate (or combined) keys. Known as a "section" and an "item"
- AutoRotateFileLogger supports log rotation based on file size (kilobytes) or age (hours) and maximum number of files.
- Uses exclusive locking to lock filed for writing
- Supports simple querying of saved log files

Simple logging to a file
========================

[](#simple-logging-to-a-file)

```
require '../vendor/autoload.php'
use calguy1000\logger\FileLogger as FileLogger;
$logger = new FileLogger('logfile.txt');
$logger->debug('A debug message');
$logger->info('An information message');
$logger->warn('A warning message');
$logger->error('A fatal error');

```

Using the auto-rotate logger
============================

[](#using-the-auto-rotate-logger)

```
require '../vendor/autoload.php'
use calguy1000\logger\AutoRotateFileLogger as AutoRotateFileLogger;
$logger = new AutoRotateFileLogger('logfile.txt',24,2000,30);
$logger->debug('A debug message');
$logger->info('An information message');
$logger->warn('A warning message');
$logger->error('A fatal error');

```

Querying the logs
=================

[](#querying-the-logs)

```
require '../vendor/autoload.php'
use calguy1000\logger\Logger as Logger;
$parms = [ 'filename'=>'logfile.txt','limit'=>50,'msg'=>'*fatal*` ];
$query = new Logger\query($parms);
$rs = $query->execute();
foreach( $rs as $key => $item ) {
   print_r($item);
}

```

Limitations
===========

[](#limitations)

- Each log string can be a maximum of 512 bytes
- Log files can be a maximum of 50mb in size
- Log files can be a maximum of 60 days old.

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 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/9f0b168aa14ffaf3a93f7affbe2b14a581d81b6b141872ed4b9f79bb7a4a01b8?d=identicon)[calguy1000](/maintainers/calguy1000)

---

Top Contributors

[![calguy1000](https://avatars.githubusercontent.com/u/32819?v=4)](https://github.com/calguy1000 "calguy1000 (14 commits)")

### Embed Badge

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

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

###  Alternatives

[psr/log

Common interface for logging libraries

10.4k1.2B9.1k](/packages/psr-log)[itsgoingd/clockwork

php dev tools in your browser

5.9k27.6M94](/packages/itsgoingd-clockwork)[graylog2/gelf-php

A php implementation to send log-messages to a GELF compatible backend like Graylog2.

41838.2M137](/packages/graylog2-gelf-php)[bugsnag/bugsnag-psr-logger

Official Bugsnag PHP PSR Logger.

32132.5M2](/packages/bugsnag-bugsnag-psr-logger)[consolidation/log

Improved Psr-3 / Psr\\Log logger based on Symfony Console components.

15462.2M7](/packages/consolidation-log)[datadog/php-datadogstatsd

An extremely simple PHP datadogstatsd client

19124.6M15](/packages/datadog-php-datadogstatsd)

PHPackages © 2026

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