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

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

mmdm/sim-logger
===============

A simple yet nice logger library

v1.0.2(5y ago)116MITPHPPHP &gt;=7.2

Since Jul 27Pushed 5y ago1 watchersCompare

[ Source](https://github.com/mmdm95/sim-logger)[ Packagist](https://packagist.org/packages/mmdm/sim-logger)[ RSS](/packages/mmdm-sim-logger/feed)WikiDiscussions master Synced 5d ago

READMEChangelogDependenciesVersions (4)Used By (0)

Simplicity Logger
=================

[](#simplicity-logger)

A library to log your activities

Install
-------

[](#install)

**composer**

```
composer require mmdm/sim-logger
```

Or you can simply download zip file from github and extract it, then put file to your project library and use it like other libraries.

Just add line below to autoload files:

```
require_once 'path_to_library/autoloader.php';
```

and you are good to go.

How to use
----------

[](#how-to-use)

```
// to instance a logger object
$logger = new Logger(new FileHandler($directory_to_store_logs));

// now use logger functions, for instance debug method
$logger->debug('this is a debug message');
```

Or instantiate `Logger` with other optional constructor parameters

#### Description

[](#description)

```
$logger = new Logger([$handler[, $format[, $date_format]]]);
```

`$handler` is a type of `IHandler` and an `IHandler` is an interface to extend logger for other kind of handlers and not just file handling.

Also you can set handler after initializing the logger with method `handler(IHandler $handler)`.

To extend `IHandler` you must implement these functions

```
class CustomHandler implements IHandler
{
    /**
     * CunstomHandler constructor.
     */
    public function __construct()
    {
        // do initialize your needed things
    }

    /**
     * @return IHandler
     */
    public function init(): IHandler
    {
        // to whatever need for handler initialization

        return $this;
    }

    /**
     * @param string $message
     * @param array $data
     * @return bool
     */
    public function write(string $message, array $data = []): bool
    {
        // write $message with your log handler
        // $data have all parameters as key => value pairs

        // return true if write was OK or false if it wasn't
    }
}
```

`$format` is to format message that need to be written. Default value is `{level}: {date} - {message}`

`$format_date` is to format date of log. Default value is `Y-m-d H:i:s`.

Available functions
-------------------

[](#available-functions)

There are many functions to log your message. The order of importance of them are:

- EMERGENCY - highest level priority
- ALERT
- CRITICAL
- ERROR
- WARNING
- NOTICE
- INFO
- DEBUG - lowest level priority

```
// log emergency
$logger->emergency($message);

// log alert
$logger->alert($message);

// log critical
$logger->critical($message);

// log error
$logger->error($message);

// log warning
$logger->warning($message);

// log notice
$logger->notice($message);

// log info
$logger->info($message);

// log debug
$logger->debug($message);

// or you can use log function to log any level you want,
// including previous functions
$logger->log($message, LOGGER::DEBUG);
// or
$logger->log($message, 'custom level');
```

If you have additional data to log, then you should use `extraParameters($parameter)` method and modify logger format to show your parameter in log message with `format($format)` method.

```
$logger->extraParameters([
'other_parameter' => $valueOfParameter
])->format('{level} - {other_parameter} - {message}');

// now we can use log methods
$logger->log('a log message', 'custom level');
```

If you need to change date format, then you can use `dateFormat($format)`method

```
$logger->dateFormat('Y/m/d H:i');
```

If you want have a better experience with date, you should enter your timezone through `setTimezone($timezone)` method. Default timezone is environment default timezone.

The timezone will show with date for more information.

exp. 2020-07-25 09:46:19 (America/New\_York)

```
$logger->setTimezone('America/New_York');
```

License
=======

[](#license)

Under MIT license.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

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

Every ~35 days

Total

3

Last Release

2048d ago

### Community

Maintainers

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

---

Top Contributors

[![mmdm95](https://avatars.githubusercontent.com/u/26489185?v=4)](https://github.com/mmdm95 "mmdm95 (18 commits)")

### Embed Badge

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

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

###  Alternatives

[psr/log

Common interface for logging libraries

10.4k1.2B9.2k](/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.2M138](/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)
