-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Disable logging in cloud-code #2518
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I reproduced the issue on 2.2.17 as follows:
Note that I am double setting warning: both in the config obj and on the command line. I then hit it with our app and it works just fine, but I am getting info logs. I tried to get a unit test to fail on master, but it works. Here's the unit test: I'm going to checkout the behavior on master since the big logging refactor. |
Ok, so after much wrangling and a bug discovered in my own logging adapter, I can configure log level on MASTER. Two ways I can do it:
If i have my testing right, then setting the env var PARSE_SERVER_LOG_LEVEL does not work on master. Though in my admittedly rudimentary understanding of |
@acinader thanks so much for digging into this. I just tried ...
... but I'm still seeing logging from cloud code. Is this what you were referring to above as working? edit: Ah! you did this on master though, I tried on 2.2.17 ... |
@DrBeak1, futzed a little more. this will turn it off in 2.2.17 (some things to note at the bottom...): const express = require('express');
const ParseServer = require('parse-server').ParseServer;
const S3Adapter = require('parse-server-s3-adapter');
const configureLogger = require('parse-server/lib/logger').configureLogger;
const logger = require('parse-server').logger;
// Note that I am not using the same port as you!!!
const port = 9091;
const parseServerOptions = {
appId: 'xxx',
masterKey: 'xxx',
databaseURI: 'xxx',
serverURL: 'http://localhost:9091/parse',
port: port,
cloud: './cloud/main.js',
fileKey: 'xxxx',
filesAdapter: new S3Adapter({
bucket: 'xxx',
bucketPrefix: 'xxx/',
directAccess: true,
baseUrl: 'https://xxx',
globalCacheControl: 'public, max-age=31536000',
})
};
const app = express();
const api = new ParseServer(parseServerOptions);
configureLogger({ level: 'warn' });
app.use('/parse', api);
app.listen(port, () => {
logger.info('info');
logger.warn('warn');
logger.warn('listening on ' + port);
});
module.exports = app;
And finally, if this answers your question, close the issue? |
Thanks again, @acinader -- I'll give this a shot tonight and report back. |
@acinader I can confirm that your last suggestion does in fact work. Thank you, sir! |
I just updated to 2.2.17; OMG - how do i disable logging in cloud code? Sorry if this has been answered somewhere else, I looked around and couldn't find anything.
I've tried changing the logLevel at app start:
... but that doesn't seem to impact cloud code
Thanks in advance.
The text was updated successfully, but these errors were encountered: