Mercurial > ~darius > hgwebdir.cgi > ZigBee
comparison zbmux.tac @ 22:c26eaa20b70d
Keep 10 5MB log files.
author | Daniel O'Connor <darius@dons.net.au> |
---|---|
date | Tue, 16 Apr 2013 08:14:56 +0930 |
parents | 7a2ce1c1f176 |
children | 08535b12504f |
comparison
equal
deleted
inserted
replaced
21:857bef563f52 | 22:c26eaa20b70d |
---|---|
108 self.logger = logging.getLogger('Zigbee-%d' % (zbid)) | 108 self.logger = logging.getLogger('Zigbee-%d' % (zbid)) |
109 self.logger.setLevel(logging.DEBUG) | 109 self.logger.setLevel(logging.DEBUG) |
110 | 110 |
111 # Add the log message handler to the logger | 111 # Add the log message handler to the logger |
112 handler = logging.handlers.RotatingFileHandler( | 112 handler = logging.handlers.RotatingFileHandler( |
113 lognamebase % (zbid), maxBytes = 1 * 1024 * 1024, backupCount = 5) | 113 lognamebase % (zbid), maxBytes = 5 * 1024 * 1024, backupCount = 10) |
114 | 114 |
115 self.logger.addHandler(handler) | 115 self.logger.addHandler(handler) |
116 | 116 |
117 def message(self, zbid, message): | 117 def message(self, zbid, message): |
118 """Called when we get a message, check it's for us - if it is log it and write to our clients""" | 118 """Called when we get a message, check it's for us - if it is log it and write to our clients""" |