|
@@ -1,5 +1,6 @@
|
|
|
#!/usr/bin/env python3
|
|
|
# encoding:utf-8
|
|
|
+import traceback
|
|
|
|
|
|
from flask import request, render_template_string
|
|
|
import json
|
|
@@ -193,8 +194,11 @@ def num_generate():
|
|
|
|
|
|
@app.route('/open/agent/sdkAnalytics', methods=['POST'])
|
|
|
def track_event():
|
|
|
- data = request.get_json()
|
|
|
- # 存入日志文件
|
|
|
- app.logger.info(json.dumps(data))
|
|
|
-
|
|
|
+ try:
|
|
|
+ data = request.get_json()
|
|
|
+ # 存入日志文件
|
|
|
+ app.logger.info(json.dumps(data))
|
|
|
+ except Exception as e:
|
|
|
+ traceback.print_exc()
|
|
|
+ app.logger.error('track_event:exception', e)
|
|
|
return success_response('ok')
|