add clientURL to logs from client

This commit is contained in:
Anton Georgiev 2020-06-30 15:18:01 -04:00
parent 0f54dfdcb8
commit 0a399af81f

View File

@ -48,23 +48,36 @@ class ServerLoggerStream extends ServerStream {
class MeteorStream {
write(rec) {
const { fullInfo } = Auth;
const clientURL = window.location.href;
this.rec = rec;
if (fullInfo.meetingId != null) {
if (!this.rec.extraInfo) {
this.rec.extraInfo = {};
}
this.rec.extraInfo.clientURL = clientURL;
Meteor.call(
'logClient',
nameFromLevel[this.rec.level],
this.rec.msg,
this.rec.logCode,
this.rec.extraInfo || {},
this.rec.extraInfo,
fullInfo,
);
} else {
Meteor.call('logClient', nameFromLevel[this.rec.level], this.rec.msg);
Meteor.call(
'logClient',
nameFromLevel[this.rec.level],
this.rec.msg,
{ clientURL },
);
}
}
}
function createStreamForTarget(target, options) {
const TARGET_EXTERNAL = 'external';
const TARGET_CONSOLE = 'console';