fluentd suppose installé (Référence) http://qiita.com/items/c89b53301a540be72744
Installer la bibliothèque
pip install fluent-logger
Modifier la configuration
<source>
type forward
port 24224
</source>
<match fluent.test.**>
type stdout
</match>
Commencez
fluentd -c ./fluent/fluent.conf -vv &
python script
#! /usr/local/bin/python
# -*- coding:utf-8 -*-
from fluent import sender
from fluent import event
# params -> *(tag, host, port)
sender.setup('fluent.test', host='localhost', port=24224)
event.Event('follow', {
'from': 'userA',
'to': 'userB'
})
Quand tu cours
2013-03-20 11:44:07 +0900 fluent.test.follow: {"to":"userB","from":"userA"}
Et sortie
Recommended Posts