Created
August 16, 2010 13:40
-
-
Save ryszard/526953 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- a/setjam/__init__.py | |
+++ b/setjam/__init__.py | |
@@ -26,6 +26,7 @@ logging.handlers.SysLogHandler.priority_map['START'] = 'notice' | |
# access - impossible in ini file without deep magic) | |
logger = logging.getLogger("setjam") | |
root_logger = logging.getLogger('') | |
+timer_logger = logging.getLogger('setjam.classification.timer') | |
default_formatter = root_logger.handlers[0].formatter | |
def _setting(name, default): | |
@@ -55,6 +56,15 @@ else: | |
file_handler.setFormatter(default_formatter) | |
root_logger.addHandler(file_handler) | |
+ timer_handler = logging.handlers.ConcurrentRotatingFileHandler( | |
+ "./setjam.classification.timer.log", | |
+ supress_abs_warn=True, # suppress warning about using absolute path | |
+ maxBytes=0) | |
+ timer_handler.setFormatter(default_formatter) | |
+ timer_logger.addHandler(timer_handler) | |
+ timer_handler.setLevel(logging.DEBUG) | |
+ | |
+ | |
if getattr(settings, 'SYSLOG_LOCATION', None): | |
# Figure out descriptive syslog tag. | |
if sys.argv[1] == 'runreceiver': |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment