Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

log for python like log4j2

Project Description
# log4p
log for python like java log4j2

use config file [log4p.py], in the application root directory.

----------------------------------
App Example:
from log4p import log
TestLog = log(__name__)
TestLog.debug("Debug Log")
TestLog.info("Info Log")

out put like this:
2015-01-20 16:18:47,692 DEBUG [Thread-3] data.LogInsert (LogInsert.py:172) - Debug Log
2015-01-20 16:18:47,692 DEBUG [Thread-3] data.LogInsert (LogInsert.py:173) - Info Log

----------------------------------
Config Example:

config ={
'monitorInterval' : 10,
'loggers' :{
'LogThread' :{
'level': "DEBUG",
'additivity' : False,
'AppenderRef' : ['A1']
},
'root' :{
#'level' : "CRITICAL",
'level' : "ERROR",
'AppenderRef' : ['output_root']
}
},

'appenders' :{
'output_root' :{
'type' :"file",
'FileName' :"root_error.log",
'backup_count': 5,
'file_size_limit': 1024 * 1024 * 20
'PatternLayout' :"[level:%(levelname)s-file:%(filename)s-lineno:%(lineno)d] %(asctime)s %(message)s"
},
'A1' :{
'type' :"file",
'FileName' :"A2.log",
'PatternLayout' :"[level:%(levelname)s-file:%(filename)s-lineno:%(lineno)d] %(asctime)s %(message)s"
},
'flumeTest' :{
'type': "FLUME",
'host': "192.168.10.120",
'port': 44444,
'headers': {'application': 'Skyline.Analyzer'},
'PatternLayout': "[PID:%(process)d-level:%(levelname)s-file:%(filename)s-lineno:%(lineno)d] %(asctime)s %(message)s"
},
'console' :{
'type' :"console",
'target' :"console",
'PatternLayout' :"[%(levelname)s] %(asctime)s %(message)s"
}
}
}
Release History

Release History

This version
History Node

0.2.17

History Node

0.2.16

History Node

0.2.15

History Node

0.2.14

History Node

0.2.13

History Node

0.2.12

History Node

0.2.11

History Node

0.2.10

History Node

0.2.9

History Node

0.2.8

History Node

0.2.6

History Node

0.2.5

History Node

0.2.0

History Node

0.1.2

History Node

0.1.1

History Node

0.1

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
log4python-0.2.17.zip (10.0 kB) Copy SHA256 Checksum SHA256 Source Dec 14, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting