PHPackages                             drupol/drupal7\_psr3\_watchdog - 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. drupol/drupal7\_psr3\_watchdog

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

drupol/drupal7\_psr3\_watchdog
==============================

A PSR3 logger using Drupal 7 watchdog.

1.1.1(6y ago)222.6k1EUPL-1.1PHPPHP &gt;= 5.6

Since Nov 8Pushed 6y ago1 watchersCompare

[ Source](https://github.com/drupol/drupal7_psr3_watchdog)[ Packagist](https://packagist.org/packages/drupol/drupal7_psr3_watchdog)[ Docs](http://github.com/drupol/drupal7_psr3_watchdog)[ RSS](/packages/drupol-drupal7-psr3-watchdog/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (7)Versions (7)Used By (1)

[![Build Status](https://camo.githubusercontent.com/0bea3aadefe65b53a3c0f8f76d58b90c284cf55a43d0bbd84a2159494010018c/68747470733a2f2f7777772e7472617669732d63692e6f72672f647275706f6c2f64727570616c375f707372335f7761746368646f672e7376673f6272616e63683d6d6173746572)](https://www.travis-ci.org/drupol/drupal7_psr3_watchdog)

A PSR-3 compatible logger
=========================

[](#a-psr-3-compatible-logger)

A very basic [PSR-3](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md) compatible logger using Drupal 7 [`watchdog()` function](https://api.drupal.org/api/drupal/includes%21bootstrap.inc/function/watchdog/7.x).

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

[](#installation)

```
composer require drupol/drupal_psr3_watchdog
```

Basic usage
-----------

[](#basic-usage)

```
function HOOK_init() {
  // Make sure to load the autoload.php, there are multiple way to do that.
  // include_once '/path/to/vendor/autoload.php';

  $logger = new \drupol\drupal7_psr3_watchdog\Logger\WatchdogLogger('Custom');

  $logger->alert('This is an alert message.');
  $logger->critical('This is a critical message.');
  $logger->debug('This is a debug message.');
  $logger->emergency('This is an emergency message.');
  $logger->error('This is an error message.');
  $logger->info('This is an info message.');
  $logger->notice('This is a notice message.');
  $logger->warning('This is a warning message.');
  }
```

Monolog integration
-------------------

[](#monolog-integration)

This library provides a custom handler for [Monolog](https://github.com/Seldaek/monolog).

Usage with Monolog
------------------

[](#usage-with-monolog)

```
  // Make sure to load the autoload.php, there are multiple way to do that.
  // include_once '/path/to/vendor/autoload.php';

  // Create the logger
  $logger = new \Monolog\Logger('Custom');

  // Now add the handler
  $logger->pushHandler(new \drupol\drupal7_psr3_watchdog\Handler\Drupal7Watchdog());

  $logger->alert('This is an alert message.');
  $logger->critical('This is a critical message.');
  $logger->debug('This is a debug message.');
  $logger->emergency('This is an emergency message.');
  $logger->error('This is an error message.');
  $logger->info('This is an info message.');
  $logger->notice('This is a notice message.');
  $logger->warning('This is a warning message.');
  }
```

You can also use variable replacements by adding the specific placeholders:

```
  $logger->alert('This is an {type} message.', array('type' => 'ALERT'));
```

[Drupal's watchdog function](https://api.drupal.org/api/drupal/includes%21bootstrap.inc/function/watchdog/7.x) also have a 'link' parameter that you can use:

```
  $logger->warning('This is a {type} message.', array('type' => 'WARNING', 'link' => 'Github'));
```

Tests
-----

[](#tests)

Test and coverage are provided by [PHPSpec](http://www.phpspec.net/).

To run the tests:

```
composer grumphp

```

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community9

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

Recently: every ~158 days

Total

6

Last Release

2466d ago

Major Versions

0.0.2 → 1.0.02017-11-17

PHP version history (2 changes)0.0.1PHP ^5.6 || ^7.0 || ^7.1

1.1.1PHP &gt;= 5.6

### Community

Maintainers

![](https://www.gravatar.com/avatar/3a5b33672e6fed2f03fee680279b6bddb884ca494237764e8c4dbb2c77e8bf05?d=identicon)[drupol](/maintainers/drupol)

---

Top Contributors

[![drupol](https://avatars.githubusercontent.com/u/252042?v=4)](https://github.com/drupol "drupol (8 commits)")

---

Tags

logpsr-3loggingdrupalwatchdog

### Embed Badge

![Health badge](/badges/drupol-drupal7-psr3-watchdog/health.svg)

```
[![Health](https://phpackages.com/badges/drupol-drupal7-psr3-watchdog/health.svg)](https://phpackages.com/packages/drupol-drupal7-psr3-watchdog)
```

###  Alternatives

[monolog/monolog

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

21.4k964.9M7.0k](/packages/monolog-monolog)[analog/analog

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

3451.5M24](/packages/analog-analog)[inpsyde/wonolog

Monolog-based logging package for WordPress.

183617.9k7](/packages/inpsyde-wonolog)[apix/log

Minimalist, thin and fast PSR-3 compliant (multi-bucket) logger.

511.0M18](/packages/apix-log)[elastic/ecs-logging

Format and enrich your log files in the elastic common schema

21907.5k1](/packages/elastic-ecs-logging)[markrogoyski/simplelog-php

Powerful PSR-3 logging. So easy, it's simple.

2818.1k4](/packages/markrogoyski-simplelog-php)

PHPackages © 2026

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