Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
A

analog

> 数据库
Open source

PHP logging library that is highly extendable and simple to use.

344 stars0 likes1 views
WebsiteGitHub

About

PHP logging library that is highly extendable and simple to use.

Analog - Minimal PHP logging library

A minimal PHP logging package based on the idea of using closures for configurability and extensibility. It functions as a static class, but you can completely control the writing of log messages through a closure function (aka anonymous functions), or use the Analog\Logger wrapper that implements the PSR-3 specification.

Installation

Install the latest version with:

bash
$ composer require analog/analog

Usage

Basic Usage

php
handler (Variable::init ($log));

$logger->alert ('Things are really happening right now!');

// With context
$logger->debug ('Testing {0}:{1}', [__FILE__, __LINE__]);

var_dump ($log);

Usage with a custom handler

php
mydb->log->insert ($info);
});

// Log an alert
Analog::log ('The sky is falling!', Analog::ALERT);

// Log some debug info
Analog::log ('Debugging info', Analog::DEBUG);

Usage without composer

Analog uses a simple autoloader internally, so if you don't have access to composer you can clone this repository and include it like this:

php
 What about Analog, the logfile analyzer? Well, since it hasn't been updated
> since 2004, I think it's safe to call a single-file PHP logging class the
> same thing without it being considered stepping on toes :)

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

PHPamonamon2analogapprise

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category数据库
PricingOpen source

> Related tools

P
PostgreSQL
功能强大的开源关系型数据库
R
Redis
内存数据结构存储,常用作缓存与队列
M
MySQL
广泛使用的开源关系型数据库