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

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

struktal/struktal-logger
========================

PHP library to write log messages to a file

1.0.2(9mo ago)01.6k↑261.5%1MITPHPPHP &gt;=8.2.0CI passing

Since Aug 20Pushed 9mo agoCompare

[ Source](https://github.com/Struktal/struktal-logger)[ Packagist](https://packagist.org/packages/struktal/struktal-logger)[ RSS](/packages/struktal-struktal-logger/feed)WikiDiscussions main Synced yesterday

READMEChangelog (3)DependenciesVersions (4)Used By (1)

Struktal-Logger
===============

[](#struktal-logger)

This is a PHP library to write log messages to a file

Installation
------------

[](#installation)

To install this library, include it in your project using Composer:

```
composer require struktal/struktal-logger
```

Usage
-----

[](#usage)

Before you can use this library, you need to customize a few parameters. You can do this in the startup of your application:

```
\struktal\Logger\Logger::setLogDirectory("/path/to/logs/");
\struktal\Logger\Logger::setMinLogLevel(\struktal\Logger\LogLevel::TRACE);
```

You can also set custom, additional log handlers if you want to log to a database or send error logs via email:

```
\struktal\Logger\Logger::addCustomLogHandler(
    \struktal\Logger\LogLevel::ERROR,
    function(string $formattedMessage, string $serializedMessage, mixed $originalMessage) {
        // Custom log handler logic here
    }
);
```

Then, in your code, you can instantiate the logger by using

```
$logger = new \struktal\Logger\Logger("custom-tag");
```

and use it to log messages with different log levels:

```
$logger->trace("This is a trace message");
$logger->debug("This is a debug message");
$logger->info("This is an info message");
$logger->warn("This is a warning message");
$logger->error("This is an error message");
$logger->fatal("This is a fatal message");
```

License
-------

[](#license)

This software is licensed under the MIT license. See the [LICENSE](LICENSE) file for more information.

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance56

Moderate activity, may be stable

Popularity20

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity51

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 ~14 days

Total

3

Last Release

289d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/49905418?v=4)[Jens Ostertag](/maintainers/JensOstertag)[@JensOstertag](https://github.com/JensOstertag)

---

Top Contributors

[![JensOstertag](https://avatars.githubusercontent.com/u/49905418?v=4)](https://github.com/JensOstertag "JensOstertag (3 commits)")

---

Tags

logging

### Embed Badge

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

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

###  Alternatives

[monolog/monolog

Sends your logs to files, sockets, inboxes, databases and various web services

21.4k1.0B8.2k](/packages/monolog-monolog)[symfony/monolog-bundle

Symfony MonologBundle

2.9k262.9M1.8k](/packages/symfony-monolog-bundle)[itsgoingd/clockwork

php dev tools in your browser

5.9k29.7M117](/packages/itsgoingd-clockwork)[sentry/sentry

PHP SDK for Sentry (http://sentry.io)

1.9k247.1M334](/packages/sentry-sentry)[sentry/sentry-laravel

Laravel SDK for Sentry (https://sentry.io)

1.3k127.1M203](/packages/sentry-sentry-laravel)[sentry/sentry-symfony

Symfony integration for Sentry (http://getsentry.com)

74666.1M95](/packages/sentry-sentry-symfony)

PHPackages © 2026

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