I tried to call the logging mechanism from within the hello.js script that is provided in Files. Hitting the URL properly responds with “Hello World!” but my log file doesn’t update.
Logging does seem to work from my iOS app, though.
Here is my code:
exports.run = function ( request, response )
{
var logger = Backendless.Logging.getLogger("com.mbaas.Logger")
logger.info("Hello, world!");
response.send( "Hello, world!" );
};
As soon as I hit “Save” on a JS file, even if I had no made any changes, the i/o error appears. I diff-ed an example file, setquantity.js before saving with a version after, they are identical, but one no longer works and returns 500s. Tried both POST and GET.
Hi Gal,
thank you for reporting, we have already fixed running js files and have a fix for logging, but it’s not in production yet and we will notify you very soon when it’s ready.
For now I can suggest you a workaround.
Upload the latest backendless.js (take it from here: https://github.com/Backendless/JS-SDK ) to ‘node_modules’ folder. Then in your logger file put in the top next rows:
var Backendless = require('backendless');
var APPLICATION_ID = 'your_app_id';
var SECRET_KEY = 'your_secret_key';
var VERSION = 'your_version';
Backendless.initApp(APPLICATION_ID, SECRET_KEY, VERSION);
And then run it again as you did it before.
Hope it helps.
Let me know if everything is ok.
Any idea for other solutions? without the logs or a debugger I’m coding blind here (the JS code hosting). I have an external log set up, which failing silently as well… can’t debug that either