Skip to content
bridge to use log4php logger in psr environment and vice versa
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.


Type Name Latest commit message Commit time
Failed to load latest commit information.

PHP Psr And Log4Php Adapter Component

This component provides adapters for using Psr Logger in Log4Php Environment and vice versa.

The main idea is to easy up usage and/or migration of existing Log4Php application with/into Psr loggers.

The build status of the current master branch is tracked by Travis CI: Build Status Latest stable

The scrutinizer status are: code quality | build status

@todo The versioneye status is: Dependency Status

@todo Take a look on


  • Log4Php to Psr Logger Bridge
  • Psr Logger to Log4PhP Bridge


Use a psr-logger in a Log4Php

$adapter = new \Net\Bazzline\Component\PsrAndLog4PhpAdapter\Log4PhpToPsrAdapter('your name');
$adapter->debug('my debug log');

Use a Log4Php in a psr-logger

$adapter = new \Net\Bazzline\Component\PsrAndLog4PhpAdapter\PsrToLog4PhpAdapter($log4PhpInstance);
$adapter->debug('my debug log');



mkdir vendor/net_bazzline/php_component_psr_and_log4php_adapter
cd vendor/net_bazzline/php_component_psr_and_log4php_adapter
git clone .


require: "net_bazzline/component_psr_and_log4php_adapter": "dev-master"


  • throwable are currently ignored in Log4PhpToPsrAdapter::log()
  • context is currently ignored in PsrToLog4PhpAdapter::log()


This software is licenced under GNU LESSER GENERAL PUBLIC LICENSE. The full licence text is shipped within this component package.

Version History

  • upcoming
    • @todo
      • add versioneye dependecy status
      • add link to openhub
      • fixed typos in the readme
      • implement conversion of throwable into something in Log4PhpToPsrAdapter::log()
      • implement conversion of context into something in PsrToLog4PhpAdapter
    • added travis build status
    • added scrutinizer build status
  • 2.0.0
    • added example
    • added version boundary to psr log and log4php
    • covered code with unit tests
    • moved injected logger from protected to private
    • moved to psr-4 autoloading
    • refactored loggers and the way how to inject the logger you want to bridge
    • removed Log4PhpLoggerInterface since this simple complicates stuff
  • 1.0.0
    • Log4Php Logger Interface
    • Log4Php to Psr Logger Bridge
    • Psr Logger to Log4PhP Bridge
You can’t perform that action at this time.