diff --git a/app.js b/app.js index 82516530814..e2a99f21cbc 100644 --- a/app.js +++ b/app.js @@ -451,7 +451,7 @@ var projectSetter = function (req, res, next) { if (projectid) { if (!mongoose.Types.ObjectId.isValid(projectid)) { - winston.warn(`Invalid ObjectId: ${projectid}`); + //winston.warn(`Invalid ObjectId: ${projectid}`); return res.status(400).send({ error: "Invalid project id: " + projectid }); } @@ -462,11 +462,11 @@ var projectSetter = function (req, res, next) { } q.exec(function(err, project){ if (err) { - winston.warn("Problem getting project with id: " + projectid + " req.originalUrl: " + req.originalUrl); + //winston.warn("Problem getting project with id: " + projectid + " req.originalUrl: " + req.originalUrl); } winston.debug("projectSetter project:" + project); if (!project) { - winston.warn("ProjectSetter project not found with id: " + projectid); + //winston.warn("ProjectSetter project not found with id: " + projectid); //next(); return res.status(400).send({ error: "Project not found with id: " + projectid }) } else { diff --git a/models/analyticResult.js b/models/analyticResult.js index 078a239a007..affdc19d4b9 100644 --- a/models/analyticResult.js +++ b/models/analyticResult.js @@ -18,7 +18,7 @@ var analyticResult= mongoose.model('analyticResult', AnalyticResultSchema); if (process.env.MONGOOSE_SYNCINDEX) { analyticResult.syncIndexes(); - winston.info("analyticResult syncIndexes") + winston.verbose("analyticResult syncIndexes") } diff --git a/models/channel.js b/models/channel.js index f0840f24516..3b3de964840 100644 --- a/models/channel.js +++ b/models/channel.js @@ -14,7 +14,7 @@ var channel = mongoose.model('channel', ChannelSchema);; if (process.env.MONGOOSE_SYNCINDEX) { channel.syncIndexes(); - winston.info("channel syncIndexes") + winston.verbose("channel syncIndexes") } diff --git a/models/department.js b/models/department.js index a61eb4f7112..6c6621754cc 100644 --- a/models/department.js +++ b/models/department.js @@ -89,7 +89,7 @@ var department = mongoose.model('department', DepartmentSchema); if (process.env.MONGOOSE_SYNCINDEX) { department.syncIndexes(); - winston.info("department syncIndexes") + winston.verbose("department syncIndexes") } diff --git a/models/faq.js b/models/faq.js index e2fc9ba188d..efd53eb4579 100644 --- a/models/faq.js +++ b/models/faq.js @@ -189,7 +189,7 @@ faq.on('index', function (error) { if (process.env.MONGOOSE_SYNCINDEX) { faq.syncIndexes(); - winston.info("faq syncIndexes") + winston.verbose("faq syncIndexes") } diff --git a/models/faq_kb.js b/models/faq_kb.js index 0cce03397db..c0b81b44d37 100644 --- a/models/faq_kb.js +++ b/models/faq_kb.js @@ -182,7 +182,7 @@ var faq_kb = mongoose.model('faq_kb', Faq_kbSchema); if (process.env.MONGOOSE_SYNCINDEX) { faq_kb.syncIndexes(); - winston.info("faq_kb syncIndexes") + winston.verbose("faq_kb syncIndexes") } function generateSlug(name) { diff --git a/models/lead.js b/models/lead.js index d01b035f7f6..91dd106e554 100644 --- a/models/lead.js +++ b/models/lead.js @@ -111,7 +111,7 @@ LeadSchema.index({status: 1, id_project: 1, createdAt: -1}); if (process.env.MONGOOSE_SYNCINDEX) { lead.syncIndexes(); - winston.info("lead syncIndexes") + winston.verbose("lead syncIndexes") } module.exports = lead; diff --git a/models/message.js b/models/message.js index d920499e26f..2fef9eaf306 100644 --- a/models/message.js +++ b/models/message.js @@ -111,7 +111,7 @@ var message = mongoose.model('message', MessageSchema); if (process.env.MONGOOSE_SYNCINDEX) { message.syncIndexes(); - winston.info("message syncIndexes") + winston.verbose("message syncIndexes") } module.exports = message; diff --git a/models/pending-invitation.js b/models/pending-invitation.js index 926a2de1c7e..5f1feda2d67 100644 --- a/models/pending-invitation.js +++ b/models/pending-invitation.js @@ -36,7 +36,7 @@ var pending= mongoose.model('pending-invitation', PendingInvitation); if (process.env.MONGOOSE_SYNCINDEX) { pending.syncIndexes(); - winston.info("pending syncIndexes") + winston.verbose("pending syncIndexes") } module.exports = pending; diff --git a/models/profile.js b/models/profile.js index 94ea01c2e57..eb2587de9c7 100644 --- a/models/profile.js +++ b/models/profile.js @@ -58,7 +58,7 @@ var profile =mongoose.model('profile', ProfileSchema); if (process.env.MONGOOSE_SYNCINDEX) { profile.syncIndexes(); - winston.info("profile syncIndexes") + winston.verbose("profile syncIndexes") } diff --git a/models/property.js b/models/property.js index f612833d427..3a2ea014a63 100644 --- a/models/property.js +++ b/models/property.js @@ -43,7 +43,7 @@ var property = mongoose.model('property', PropertySchema); if (process.env.MONGOOSE_SYNCINDEX) { property.syncIndexes(); - winston.info("property syncIndexes") + winston.verbose("property syncIndexes") } module.exports = property; diff --git a/models/request.js b/models/request.js index 88725e1e435..b3b5ca745a4 100644 --- a/models/request.js +++ b/models/request.js @@ -522,7 +522,7 @@ RequestSchema.index({ id_project: 1, preflight: 1, smartAssignment: 1, "snapshot var request = mongoose.model('request', RequestSchema); if (process.env.MONGOOSE_SYNCINDEX) { request.syncIndexes(); - winston.info("message syncIndexes") + winston.verbose("message syncIndexes") } diff --git a/models/requester.js b/models/requester.js index 0544992e5f7..4bd2bb009b5 100644 --- a/models/requester.js +++ b/models/requester.js @@ -18,7 +18,7 @@ var requester = mongoose.model('requester', RequesterSchema); if (process.env.MONGOOSE_SYNCINDEX) { requester.syncIndexes(); - winston.info("requester syncIndexes") + winston.verbose("requester syncIndexes") } module.exports = requester; diff --git a/models/segment.js b/models/segment.js index ac60801b39b..d68a633cd41 100644 --- a/models/segment.js +++ b/models/segment.js @@ -61,7 +61,7 @@ var segment = mongoose.model('segment', SegmentSchema); if (process.env.MONGOOSE_SYNCINDEX) { segment.syncIndexes(); - winston.info("segment syncIndexes") + winston.verbose("segment syncIndexes") } module.exports = segment; diff --git a/models/setting.js b/models/setting.js index b1b23767430..00dc3bb8285 100644 --- a/models/setting.js +++ b/models/setting.js @@ -37,7 +37,7 @@ var setting = mongoose.model('Setting', SettingSchema); if (process.env.MONGOOSE_SYNCINDEX) { setting.syncIndexes(); - winston.info("setting syncIndexes") + winston.verbose("setting syncIndexes") } diff --git a/models/subscription.js b/models/subscription.js index bdebb8575e8..ae2efa44d59 100644 --- a/models/subscription.js +++ b/models/subscription.js @@ -49,7 +49,7 @@ var subscription = mongoose.model('subscription', SubscriptionSchema); if (process.env.MONGOOSE_SYNCINDEX) { subscription.syncIndexes(); - winston.info("subscription syncIndexes") + winston.verbose("subscription syncIndexes") } module.exports = subscription; diff --git a/models/user.js b/models/user.js index 835c2f3a917..294f500349c 100644 --- a/models/user.js +++ b/models/user.js @@ -133,7 +133,7 @@ var UserModel = mongoose.model('user', UserSchema); if (process.env.MONGOOSE_SYNCINDEX) { UserModel.syncIndexes(); - winston.info("UserModel syncIndexes") + winston.verbose("UserModel syncIndexes") } module.exports = UserModel; diff --git a/routes/auth.js b/routes/auth.js index 4d4895808e2..486179b276e 100644 --- a/routes/auth.js +++ b/routes/auth.js @@ -854,7 +854,7 @@ router.get( "/keycloak/callback", passport.authenticate("keycloak"), function(req, res) { - winston.info("'/keycloak/callback: "); + winston.verbose("'/keycloak/callback: "); // Successful authentication, redirect home. res.redirect('/'); } diff --git a/routes/auth_newjwt.js b/routes/auth_newjwt.js index cccf8b1d578..2ab7e5f2e62 100644 --- a/routes/auth_newjwt.js +++ b/routes/auth_newjwt.js @@ -135,7 +135,7 @@ function (req, res) { authEvent.emit("projectuser.create", savedProject_user); - winston.info('project user created ', savedProject_user.toObject()); + winston.verbose('project user created ', savedProject_user.toObject()); // JWT_HERE @@ -215,14 +215,14 @@ router.post('/signinWithCustomToken', [ authEvent.emit("projectuser.create", savedProject_user); - winston.info('project user created ', savedProject_user.toObject()); + winston.verbose('project user created ', savedProject_user.toObject()); return res.json({ success: true, token: req.headers["authorization"], user: req.user }); }); }else { - winston.info('project user already exists '); + winston.verbose('project user already exists '); return res.json({ success: true, token: req.headers["authorization"], user: req.user }); } diff --git a/routes/campaigns.js b/routes/campaigns.js index 67b4782c502..95e24550e93 100644 --- a/routes/campaigns.js +++ b/routes/campaigns.js @@ -15,7 +15,7 @@ var Segment2MongoConverter = require("../utils/segment2mongoConverter"); var JobManager = require("jobs-worker-queued"); var JOB_RABBITURI = process.env.JOB_RABBITURI; -winston.info("JobWorkerQueued uri: " + JOB_RABBITURI); +winston.verbose("JobWorkerQueued uri: " + JOB_RABBITURI); var jobManager = new JobManager(JOB_RABBITURI, { @@ -44,7 +44,7 @@ router.post('/', function (req, res) { req.body.text, req.body.departmentid, req.body.sourcePage, req.body.language, req.body.userAgent, null, req.user._id, req.body.attributes, req.body.subject, true, req.body.channel).then(function (savedRequest) { - winston.info("savedRequest", savedRequest); + winston.debug("savedRequest", savedRequest); // create(sender, senderFullname, recipient, text, id_project, createdBy, status, attributes, type, metadata, language, channel_type) { return messageService.create(req.body.sender || req.user._id, req.body.senderFullname || req.user.fullName, savedRequest.request_id, req.body.text, diff --git a/routes/kb.js b/routes/kb.js index ecf99038176..b83628d414e 100644 --- a/routes/kb.js +++ b/routes/kb.js @@ -1445,7 +1445,7 @@ async function scheduleScrape(resources) { winston.error("Scheduling error: ", err); error_code = 400; } else { - winston.info("Scheduling result: ", result); + winston.verbose("Scheduling result: ", result); } await updateStatus(r.id, error_code); }); diff --git a/routes/request.js b/routes/request.js index dde28382da9..682f2e8228e 100644 --- a/routes/request.js +++ b/routes/request.js @@ -2362,7 +2362,7 @@ async function scheduleTags(id_project, tags) { if (err) { winston.error("Scheduling error: ", err); } else { - winston.info("Scheduling result: ", result); + winston.verbose("Scheduling result: ", result); } }) }) diff --git a/services/chatbotService.js b/services/chatbotService.js index 8487c777cd1..a67dc1906af 100644 --- a/services/chatbotService.js +++ b/services/chatbotService.js @@ -62,7 +62,7 @@ class ChatbotService { }, method: 'GET' }).then((resbody) => { - winston.info("(CHATBOT SERVICE) forking public chatbot " + resbody.data.name); + winston.debug("(CHATBOT SERVICE) forking public chatbot " + resbody.data.name); let chatbot = resbody.data; return chatbot }).catch((err) => { diff --git a/services/openaiService.js b/services/openaiService.js index ab1b2283009..1bcc8884d91 100644 --- a/services/openaiService.js +++ b/services/openaiService.js @@ -165,8 +165,8 @@ class OpenaiService { } getContentChunks(namespace_id, content_id, engine) { - winston.info("[OPENAI SERVICE] kb endpoint: " + kb_endpoint_train); - winston.info(kb_endpoint_train + "/id/" + content_id + "/namespace/" + namespace_id) + winston.debug("[OPENAI SERVICE] kb endpoint: " + kb_endpoint_train); + return new Promise((resolve, reject) => { let payload = { engine: engine };