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

ActiveLibrary

sadist/logger
=============

A simple yet powerful logging library in PHP which is PSR-3 Compliant.

00PHP

Since Aug 20Pushed 3y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

SadistLogger
============

[](#sadistlogger)

Simple yet powerful PSR-3 compliant logger for PHP that is very minimal to use. The best part about being PSR-3 compliant is that, you can replace this library with existing PSR-3 Compliant library like Monolog() in its place when your project surpasses the needs fulfilled by this library.

Features
--------

[](#features)

- Simplicity
- PSR-3 Compliant
- Multiple Log Levels
- Custom Log messages
- Custom Contextual data

Setup
-----

[](#setup)

Add the library to your `composer.json` file in your project:

```
{
    "require": {
        "sadist/logger": "*"
    }
}
```

Use [composer](https://www.getcomposer.org) to install this library:

```
$ composer install
```

Composer will install SadistLogger inside your vendor folder. Then you can add the following to your php files to use the library with Autoloading.

```
require_once "vendor/autoload.php"
```

Alternatively, use composer on the command line to require and install SadistLogger:

```
$ composer require "sadist/logger:*"

```

### Minimum Requirements:

[](#minimum-requirements)

- PHP 8.0

Usage
-----

[](#usage)

```
$logfile = "/path/to/logfile.log"
$logLevel = "warning";
$logger = new \Sadist\Logger\SadistLogger($logfile, $loglevel);

$logger->error("Failed to upload data to the server!");

```

There are following log levels:

- None `$logger->log('none', $message, $context);`
- Debug `$logger->debug($message, $context);`
- Info `$logger->info($message, $context);`
- Notice `$logger->notice($message, $context);`
- Warning `$logger->notice($message, $context);`
- Error `$logger->error($message, $context);`
- Critical `$logger->critical($message, $context);`
- Alert `$logger->alert($message, $context);`
- Emergency `$logger->emergency($message, $context);`

Note
----

[](#note)

`$context` is optional parameter.

LogLevel of `none` will enable all other logs in the system.

###  Health Score

14

—

LowBetter than 2% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity25

Early-stage or recently created project

 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/acf98b7186353c7e37addcdd02c435f0f7ef1447456214556950630479ebb5e8?d=identicon)[prunepal333](/maintainers/prunepal333)

---

Top Contributors

[![prunepal333](https://avatars.githubusercontent.com/u/59438412?v=4)](https://github.com/prunepal333 "prunepal333 (2 commits)")

### Embed Badge

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

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

PHPackages © 2026

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