Changeset 2879 for WAeUP_SysConf/logging/trunk/usr/local/lib
- Timestamp:
- 8 Dec 2007, 00:05:14 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SysConf/logging/trunk/usr/local/lib/zevents.py
r2838 r2879 90 90 } 91 91 92 # If msg_text is too long, append it to traceback... 93 if len(val['msg_text']) > 1024: 94 val['traceback'] = val['msg_text'] + " " + val['traceback'] 95 val['msg_text'] = val['msg_text'][:1024] 96 97 # Shorten overlong fields... 98 for name,maxlen in [('loglevel',32), ('msg_src',1024), ('msg_text', 1024), 99 ('err_type', 32), ('err_msg', 1024)]: 100 val[name]=val[name][:maxlen] 101 92 102 if mode == "COPY": 93 103 print "%07d\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s" % ( 94 val['id'], val['date'], val['time'], val[' loglevel'],95 val['msg_ src'], val['msg_text'], val['err_type'], val['err_msg'],96 val[' traceback']104 val['id'], val['date'], val['time'], val['msg_src'], 105 val['msg_text'], val['err_type'], val['err_msg'], val['traceback'], 106 val['loglevel'] 97 107 ) 98 108 else: 99 print "INSERT INTO \"ZEVENTS\" (\"ID\",\"DATE \",\"TIME\",\"LOGLEVEL\",\"MSG_SRC\",\"MSG_TEXT\",\"ERR_TYPE\",\"ERR_MSG\",\"TRACEBACK\") VALUES ('%07d','%s','%s','%s','%s','%s','%s','%s','%s');" % (100 val['id'], val['date'], val['time'], val[' loglevel'],101 val['msg_ src'], val['msg_text'], val['err_type'], val['err_msg'],102 val[' traceback']109 print "INSERT INTO \"ZEVENTS\" (\"ID\",\"DATESTR\",\"TIMESTR\",\"MSG_SRC\",\"MSG\",\"ERR_TYPE\",\"ERR_MSG\",\"TRACEBACK\",\"LOGLEVEL\") VALUES ('%07d','%s','%s','%s','%s','%s','%s','%s');" % ( 110 val['id'], val['date'], val['time'], val['msg_src'], 111 val['msg_text'], val['err_type'], val['err_msg'], val['traceback'], 112 val['loglevel'] 103 113 ) 104 114 return
Note: See TracChangeset for help on using the changeset viewer.