我正在创建一个 logMessage 对象。
logMessage = function (msg, severity, vendorId, userName, actionPerformed, priority, traceId, dataSent) {
this.message = msg;
this.severity = severity;
this.vendorId = vendorId;
this.userName = userName;
this.actionPerformed = actionPerformed;
this.priority = priority;
this.traceId = traceId;
this.dataSent = dataSent;
};
var msg = new logMessage(err, "High", "none", qry.username, "Error on login call: /req/login", "high", "", qry);
Utility.writeToLoggly(msg);
err ,qry
是 json 对象;如何将 msg 对象转换为 json 对象?我将msg
对象发送到loggly
日志管理。如果我可以将格式正确的 json 对象发送到loggly
.