Opened 8 years ago
Closed 8 years ago
#2 closed task (fixed)
add log info to web
| Reported by: | zhangjr | Owned by: | somebody |
|---|---|---|---|
| Priority: | major | Milestone: | |
| Version: | Keywords: | ||
| Cc: | Blocked By: | ||
| Blocking: | Parent ID: | ||
| Parent Tickets: | Estimated Number of Hours: | 0.0 | |
| Add Hours to Ticket: | 0 | Billable?: | yes |
| Total Hours: | 0 |
Description
logInfo=[{'time':'2018-01-16 10:22:38,823', 'level':DEBUG,'message':'pilot, ready'}]
Subtickets
Child Tickets
Change History (2)
comment:1 Changed 8 years ago by zhangjr
comment:2 Changed 8 years ago by zhangjr
- Resolution set to fixed
- Status changed from new to closed
Note: See
TracTickets for help on using
tickets.

import logging
logInfo=[]
class logHandler(logging.Handler):
from logging.handlers import RotatingFileHandler?
logger = logging.getLogger('GPPDcockpit')
hdlr = RotatingFileHandler?(os.getcwd() + '/GPPDcockpit.log', maxBytes=10
formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s')
hdlr.setFormatter(formatter)
logger.addHandler(hdlr)
webHandler=logHandler()
logger.addHandler(webHandler)
logger.setLevel(logging.DEBUG)