Skip to content

Commit 6a7434c

Browse files
authored
Merge pull request #88 from Backendless/BKNDLSS-32284_Apply_LogLevels_in_the_JSCodeRunner_from_the_context
Apply LogLevels in the JSCodeRunner from the context
2 parents ad3bc4c + 8ee85d7 commit 6a7434c

File tree

3 files changed

+25
-10
lines changed

3 files changed

+25
-10
lines changed

lib/server-code/runners/tasks/executor.js

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,22 @@ function initClientSdk(task, opts) {
103103

104104
Object.assign(Backendless.Config, opts.backendless.public)
105105

106-
Backendless.initApp(task.applicationId, task.initAppData.apiKey || task.initAppData.secretKey)
106+
const loggers = task.loggers || []
107+
108+
const logLevels = loggers.reduce((map, logConfig) => {
109+
map[logConfig.name] = logConfig.level.toLowerCase()
110+
111+
return map
112+
}, {})
113+
114+
Backendless.initApp({
115+
appId : task.applicationId,
116+
apiKey : task.initAppData.apiKey || task.initAppData.secretKey,
117+
logging: {
118+
loadLevels: false,
119+
levels : logLevels
120+
}
121+
})
107122

108123
if (opts.backendless.forwardableHeaders) {
109124
applyTransferringHeaders(task, opts.backendless.forwardableHeaders)

package-lock.json

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"backendless"
3636
],
3737
"dependencies": {
38-
"backendless": "^6.7.0",
38+
"backendless": "^7.0.0",
3939
"backendless-js-services-core": "^0.0.19",
4040
"commander": "^8.3.0",
4141
"glob": "^7.2.0",

0 commit comments

Comments
 (0)