Skip to content

Instantly share code, notes, and snippets.

@wnoguchi
Forked from ihabunek/gist:3957832
Created December 7, 2013 06:50
Show Gist options
  • Save wnoguchi/7838085 to your computer and use it in GitHub Desktop.
Save wnoguchi/7838085 to your computer and use it in GitHub Desktop.

Install Apache log4php using Composer

First, install Composer if you don't yet have it:

php -r "eval('?>'.file_get_contents('https://getcomposer.org/installer'));"

Create a composer.json file with the following content:

{
    "require": {
        "apache/log4php": "2.3.0"
    }
}

Run the Composer install procedure:

php composer.phar install

This will install Apache log4php in vendor/apache/log4php.

To use log4php simply include vendor/autoload.php in your script.

require 'vendor/autoload.php';
$log = Logger::getLogger("foo");
$log->info("Yay! Works!");

Enjoy!

Links:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment