Skip to content
This repository

A structured logger for Fluentd (PHP)

bumped up 0.3.7

[fixes]
- fix fclose warnings
- fix coding styles
- close connection after having exception on socket
- add retry_socket options

[misc]
- update vagrant box and use librarian-chef to manage cookbook.
- add stress test script into examples/stress. this usefull for testing
- fix testcases

[deprecated]
- throw away package.xml. we recommend to use composer
latest commit 9ffc0545dd
Shuhei Tanuma chobie authored
Octocat-spinner-32 examples add stress test files April 06, 2013
Octocat-spinner-32 site-cookbooks throw away rbenv recipe. now we use librarian and Cheffile April 03, 2013
Octocat-spinner-32 src handle EAGAIN error April 06, 2013
Octocat-spinner-32 tests reformat codes. this commit only changes coding style. April 04, 2013
Octocat-spinner-32 .gitignore throw away rbenv recipe. now we use librarian and Cheffile April 03, 2013
Octocat-spinner-32 .gitmodules throw away rbenv recipe. now we use librarian and Cheffile April 03, 2013
Octocat-spinner-32 .travis.yml Added notification setting for travis-ci February 27, 2012
Octocat-spinner-32 Cheffile throw away rbenv recipe. now we use librarian and Cheffile April 03, 2013
Octocat-spinner-32 Cheffile.lock throw away rbenv recipe. now we use librarian and Cheffile April 03, 2013
Octocat-spinner-32 LICENSE add license file October 10, 2011
Octocat-spinner-32 README.md bumped up 0.3.7 April 06, 2013
Octocat-spinner-32 Rakefile bumped up to 0.3.2 February 28, 2012
Octocat-spinner-32 Vagrantfile throw away rbenv recipe. now we use librarian and Cheffile April 03, 2013
Octocat-spinner-32 composer.json update authors March 05, 2012
Octocat-spinner-32 phpunit.xml.dist Updated phpunit.xml.dist to output coverage reports February 24, 2012
README.md

Fluent Logger PHP

fluent-logger-php is a PHP library to record events to fluentd from a PHP application.

Build Status

API Document

current version: v0.3.7

Requirements

  • PHP 5.3 or higher
  • fluentd v0.9.20 or higher

Installation

Using Vagrant

Basically, we uses vagrant as a development sandbox.

gem install vagrant --no-ri --no-rdoc
gem install chef --no-ri --no-rdoc
gem install librarian --no-ri --no-rdoc

git clone https://github.com/fluent/fluent-logger-php.git
cd fluent-logger-php
librarian-chef install
vagrant up

# this may take 30 minutes over if you don't have the box.
# this box installed rvm, ruby1.9.3-p392 and fluentd. you can play fluentd and php with this box. enjoy it!
# you can log in to the box with following command `vagrant ssh`

Using Composer

composer.json

{
    "name": "my-project",
    "version": "1.0.0",
    "require": {
        "fluent/logger": "v0.3.7"
    }
}
wget http://getcomposer.org/composer.phar
php -d detect_unicode=0 composer.phar install

copy directory

git clone https://github.com/fluent/fluent-logger-php.git
cp -r src/Fluent <path/to/your_project>

Usage

<?php
// you can choose your own AutoLoader
require_once __DIR__.'/src/Fluent/Autoloader.php';

use Fluent\Logger\FluentLogger;

Fluent\Autoloader::register();

$logger = new FluentLogger("localhost","24224");
$logger->post("debug.test",array("hello"=>"world"));

Todos

  • Stabilize method signatures.
  • Improve performance and reliability.

Restrictions

  • Buffering and re-send support

PHP does not have threads. So, I strongaly recommend you use fluentd as a local fluent proxy.

apache2(mod_php)
fluent-logger-php
                 `-----proxy-fluentd
                                    `------aggregator fluentd

Documentation

fluent-logger-php uses apigen as a document generator. you can install apigen with following commands

pear config-set auto_discover 1
pear install pear.apigen.org/apigen

you can update gh-pages with following command on top directory.

rake fluent:docs
git push origin gh-pages

License

Apache License, Version 2.0

Contributors

  • Daniele Alessandri
  • Hiro Yoshikawa
  • Kazuki Ohta
  • Shuhei Tanuma
  • Sotaro KARASAWA
  • edy
  • kiyoto
  • sasezaki
  • satokoma
Something went wrong with that request. Please try again.