PHPackages                             vkr/custom-logger-bundle - 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. vkr/custom-logger-bundle

ActiveSymfony-bundle[Logging &amp; Monitoring](/categories/logging)

vkr/custom-logger-bundle
========================

A bundle for logging to non-default files in Symfony2/3

1.3.0(9y ago)02812MITPHPPHP &gt;=5.6

Since Jul 16Pushed 9y ago1 watchersCompare

[ Source](https://github.com/wladislavk/CustomLoggerBundle)[ Packagist](https://packagist.org/packages/vkr/custom-logger-bundle)[ Docs](https://github.com/wladislavk/CustomLoggerBundle)[ RSS](/packages/vkr-custom-logger-bundle/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (3)Versions (7)Used By (2)

About
=====

[](#about)

This bundle is a small syntactical wrapper on top of Monolog that allows to easily switch between several log files. It does not have any dependencies except for Monolog and Symfony and there is nothing to do at installation.

Usage
=====

[](#usage)

This is how the bundle is meant to be used. From your controller:

```
$logger = $this->get('vkr_custom_logger.logger');
$logger->setLogger('my_log');
$logger->addInfo('hello world');

```

The 'hello world' message with Monolog's info and timestamp will be printed to the file at `/app/logs/my_log.log` (`/var/logs/my_log.log` for Symfony3). If this file does not exist, a `FileNotFoundException` will be thrown.

If you are initializing the service manually, you will need to specify the location of your `app/` directory without a trailing slash:

```
$logger = new VKR\CustomLoggerBundle\Services\CustomLogger('/my/app/dir');

```

One more small feature is that you can get the path to the currently used log file - for some reason original Monolog does not allow you to do it.

```
$logger->setLogger('my_log');
$loggerHandlers = $logger->getHandlers();
$primaryHandler = $loggerHandlers[0];
$filename = $primaryHandler->getUrl();

```

If the file has insufficient permissions, this bundle will not give you any exceptions, but Monolog will - when you try to do something like `$logger->addInfo()`.

API
===

[](#api)

*void CustomLogger::\_\_construct(string $rootDir)*

Sets path to the `app/` directory.

*Monolog\\Logger CustomLogger::setLogger(string $logName, string $extension = 'log', string $logDir = null)*

The first argument is a name of the log file without path and extension. If the third argument is not given, the directory will default to `/app/logs` for Symfony2, and `/var/logs`for Symfony3.

*string CustomLogger::getLogfile(string $logName = null)*

Displays full path to the log file - in case you forget where it should be. Providing the optional argument is deprecated.

*string StreamHandler::getLogDir()*

Displays full path to the directory with log files. Should be called only after `setLogger()`.

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity62

Established project with proven stability

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

Recently: every ~67 days

Total

6

Last Release

3290d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/79f5fa971e7fda7a6180c1bdfca4f819a43b7681ec4e04c66b184a082fb5a20f?d=identicon)[wladislavk](/maintainers/wladislavk)

---

Top Contributors

[![wladislavk](https://avatars.githubusercontent.com/u/11371476?v=4)](https://github.com/wladislavk "wladislavk (5 commits)")

---

Tags

Symfony2logsmonologsymfony3

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/vkr-custom-logger-bundle/health.svg)

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

###  Alternatives

[xiidea/easy-audit

A Symfony Bundle To Log Selective Events. It is easy to configure and easy to customize for your need

91179.0k](/packages/xiidea-easy-audit)[macpaw/sentry-monolog-adapter

Sentry monolog logging bundle

25232.9k](/packages/macpaw-sentry-monolog-adapter)[evolution7/bugsnag-bundle

Bugsnag error reporting integration for Symfony2

19126.5k1](/packages/evolution7-bugsnag-bundle)[shalvah/monolog-pusher

Monolog handler for sending logs to Pusher

1223.5k](/packages/shalvah-monolog-pusher)

PHPackages © 2026

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