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

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

gokhankurtulus/logger
=====================

A simple PHP library for logging.

1.0.0(2y ago)057MITPHPPHP ^8.0 || ^8.1 || ^8.2

Since Jan 2Pushed 2y ago1 watchersCompare

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

READMEChangelog (1)DependenciesVersions (2)Used By (0)

Logger
======

[](#logger)

[![License: MIT](https://camo.githubusercontent.com/08cef40a9105b6526ca22088bc514fbfdbc9aac1ddbf8d4e6c750e3a88a44dca/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d626c75652e737667)](LICENSE)[![PHP Version](https://camo.githubusercontent.com/d4b5fa4adf514144779a7864904c5e15236c0e798635240c7f6ce9a455657b80/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e302532422d626c75652e737667)](https://camo.githubusercontent.com/d4b5fa4adf514144779a7864904c5e15236c0e798635240c7f6ce9a455657b80/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e302532422d626c75652e737667)[![Release](https://camo.githubusercontent.com/2216ba485a6e4419130969da81680928b94f07e2ab845f6756ba8806956d93d8/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f676f6b68616e6b757274756c75732f6c6f676765722e737667)](https://camo.githubusercontent.com/2216ba485a6e4419130969da81680928b94f07e2ab845f6756ba8806956d93d8/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f676f6b68616e6b757274756c75732f6c6f676765722e737667)

A simple PHP library for logging.

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

[](#installation)

You can install the library using Composer. Run the following command:

```
composer require gokhankurtulus/logger
```

Usage
-----

[](#usage)

- [Inheritance](#inheritance)
- [Securing the Logs](#securing-the-logs)

```
use Logger\Logger;

Logger::setFolderPath(__DIR__ . DIRECTORY_SEPARATOR . 'Logs');
Logger::setFileName('app.log');
Logger::iniSet(true, false, E_ALL);

Logger::log('this is app log message', 'this is log title');
```

Logs/app.log output:

```
[01-01-2024 15:00:00 - Europe/Istanbul] - this is log title
this is log message
```

Inheritance
-----------

[](#inheritance)

You can inherit from Logger class if you want to categorize your logs. You must override the `$folderPath` and `$fileName` parameters for conflicts.

```
class PDOLogger extends \Logger\Logger
{
    protected static string $folderPath = "";
    protected static string $fileName = "";
}
```

```
use Logger\Logger;

Logger::setFolderPath(__DIR__ . DIRECTORY_SEPARATOR . 'Logs');
Logger::setFileName('app.log');

// for log_errors, display_errors, error_reporting and
// error_log will be Logger::getFolderPath() . DIRECTORY_SEPARATOR . Logger::getFileName()
Logger::iniSet(true, false, E_ALL);

// You can give specific path for classes,
// by default it will be Logger's folder path
PDOLogger::setFolderPath(__DIR__ . DIRECTORY_SEPARATOR . 'DBLogs');
PDOLogger::setFileName('pdo.log');

Logger::log('this is app log message', 'this is log title');
PDOLogger::log('this is pdo log message');
```

Logs/app.log output:

```
[01-01-2024 15:00:00 - Europe/Istanbul] - this is log title
this is app log message
```

DBLogs/pdo.log output:

```
[01-01-2024 15:00:00 - Europe/Istanbul] -
this is pdo log message
```

Public Methods

```
Logger::log();
Logger::iniSet();
Logger::setFolderPath();
Logger::getFolderPath();
Logger::setFileName();
Logger::getFileName();
```

### Securing the Logs

[](#securing-the-logs)

Log files may contain sensitive information such as database, credentials or other confidential data. It is important to secure the files and restrict access to prevent unauthorized exposure of this information. The security of your logs is your responsibility. However, please attention to the following steps;

- Place the log folder outside the public web directory or in directory that is not directly accessible by the web server.
- Set file permissions to ensure that only authorized users or processes can read the log files.
- Add the log folder to your project's `.gitignore` file. This ensures that the file is not included in version control systems, preventing accidental exposure of sensitive information in your code repository.

License
-------

[](#license)

Logger is open-source software released under the [MIT License](LICENSE). Feel free to modify and use it in your projects.

Contributions
-------------

[](#contributions)

Contributions to Logger are welcome! If you find any issues or have suggestions for improvements, please create an issue or submit a pull request on the [GitHub repository](https://github.com/gokhankurtulus/logger).

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

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

913d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/43145716?v=4)[Gökhan Kurtuluş](/maintainers/gokhankurtulus)[@gokhankurtulus](https://github.com/gokhankurtulus)

---

Top Contributors

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

---

Tags

logloggerloggingloglogginglogger

### Embed Badge

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

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

###  Alternatives

[analog/analog

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

3511.6M24](/packages/analog-analog)[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)[logtail/monolog-logtail

Logtail handler for Monolog

243.6M3](/packages/logtail-monolog-logtail)[dakatsuka/monolog-fluent-handler

Fluentd Handler for Monolog

11480.9k](/packages/dakatsuka-monolog-fluent-handler)

PHPackages © 2026

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