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

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

toeswade/log
============

Small group of classes to build upon. Logs timestamps in code

v1.0(10y ago)0251MITPHPPHP &gt;=5.4

Since Oct 5Pushed 10y ago1 watchersCompare

[ Source](https://github.com/aa222di/toeswade-log)[ Packagist](https://packagist.org/packages/toeswade/log)[ RSS](/packages/toeswade-log/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (2)Used By (0)

Clog
====

[](#clog)

### - a simple logger class based on [lydia/Clog](https://github.com/mosbth/lydia/blob/master/src/CLog/CLog.php)

[](#--a-simple-logger-class-based-on-lydiaclog)

This class has no dependencies and can easily be implemented in any project. It saves timestamps in memory and renders a table at the end of the page.

Code Example
------------

[](#code-example)

Create the $Clog object in the top of your script

```
$Clog = new Toeswade\Log\Clog();
```

Later use it in the classes you want to log . Note that the logger has to be accessible from your class

```
class Test
{
	private $logger;

	public function __construct( \Toeswade\Log\Clog $Clog) {
		$this->logger = $Clog;
	}

	/*
	 * Some method
	 */
	public function test() {
		$this->logger->stamp(__CLASS__, __METHOD__, 'Method starts');
		// Some code
		$this->logger->stamp(__CLASS__, __METHOD__, 'Method ends');
	}
}
```

When you have logged all the timestamps of interest echo out the log table at the end of your script

```
echo $Clog->renderLog();
```

To see the class in action look at the example that comes with the package, starting in toeswade/log/webroot/index.php

Usage together with [Anax-MVC](https://github.com/mosbth/Anax-MVC)
------------------------------------------------------------------

[](#usage-together-with-anax-mvc)

#### Installation

[](#installation)

To start using toeswade/log together with Anax-MVC start with adding it to your composer.json `"toeswade/log": "dev-master"` and then run `composer update` to install the package.

#### Add the logger to DI and test it

[](#add-the-logger-to-di-and-test-it)

Once you have downloaded that package add the logger to your DI-container

```
        $this->setShared('logger', function () {
            $logger = new \Toeswade\Log\Clog();
            return $logger;
        });
```

Then you can use it to set timestamps where ever you need in your code. For example in src/ThemeEngine/CThemeBasic

```
    public function render()
    {
        $this->di->logger->stamp(__CLASS__, __METHOD__, 'render starts');

        //...

        $this->di->logger->stamp(__CLASS__, __METHOD__, 'render ends');
    }
```

To see your log just echo it at the end of your script

```
// Render the response using theme engine.
$app->theme->render();
echo $app->logger->renderLog();
```

#### Clean out the example code

[](#clean-out-the-example-code)

Note that the code in webroot and src/Test isn't necessary for the package to work.

Motivation
----------

[](#motivation)

This class is part of a task in the course phpmvc at BTH, Sweden.

Tests
-----

[](#tests)

[![Build Status](https://camo.githubusercontent.com/29f502dbe17b9b6f2f209451e26c90cb7f71c8b537f882d9ae192533a0d44288/68747470733a2f2f7472617669732d63692e6f72672f616132323264692f746f6573776164652d6c6f672e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/aa222di/toeswade-log)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/33083b575063c3bf62f46f8e9b51bb38e0178cec6274dd61684b11733fd22b92/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f616132323264692f746f6573776164652d6c6f672f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/aa222di/toeswade-log/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/036588610725a0f31975be7617cff563c0ecc22ddecedf17b4bba3be6dbc1c85/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f616132323264692f746f6573776164652d6c6f672f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/aa222di/toeswade-log/?branch=master)

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity58

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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3925d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4dfd102b8719625363815242d365f574eb553e348e63c80df29b0e9d2e118428?d=identicon)[aa222di](/maintainers/aa222di)

---

Top Contributors

[![aa222di](https://avatars.githubusercontent.com/u/5923887?v=4)](https://github.com/aa222di "aa222di (11 commits)")

---

Tags

loggereducation

### Embed Badge

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

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

###  Alternatives

[analog/analog

Fast, flexible, easy PSR-3-compatible PHP logging package with dozens of handlers.

3511.6M24](/packages/analog-analog)[marvinlabs/laravel-discord-logger

Logging to a discord channel in Laravel

2111.2M2](/packages/marvinlabs-laravel-discord-logger)[justbetter/magento2-sentry

Magento 2 Logger for Sentry

1861.6M3](/packages/justbetter-magento2-sentry)[inpsyde/wonolog

Monolog-based logging package for WordPress.

184637.3k7](/packages/inpsyde-wonolog)[amphp/log

Non-blocking logging for PHP based on Amp, Revolt, and Monolog.

402.9M82](/packages/amphp-log)[apix/log

Minimalist, thin and fast PSR-3 compliant (multi-bucket) logger.

521.1M20](/packages/apix-log)

PHPackages © 2026

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