Skip to content

cannot disable cloud code logs #2855

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

Closed
benishak opened this issue Oct 11, 2016 · 9 comments
Closed

cannot disable cloud code logs #2855

benishak opened this issue Oct 11, 2016 · 9 comments

Comments

@benishak
Copy link
Contributor

Env

Parse Server 2.2.22

Problem

I want to disable these logs

info: afterSave triggered for .... 

I try this

loggerAdapter: {
        module: "parse-server/lib/Adapters/Logger/WinstonLoggerAdapter",
        options: {
            level: config.DEBUG ? "info" : "error"
        }
    },

and try also this

console.info = function(){}

but these logs still appear in the console pm2 logs

@acinader
Copy link
Contributor

hi @benishak

The key is logLevel not level

I'll look at where to add this in the documentation. I'm going to close this, but re-open if it doesn't solve for you.

@acinader
Copy link
Contributor

and now that I've looked into it a little more, here's a better answer:

Winston is expecting logLevel, but parse-server uses just level. Confusing :(.

So if you want to use the default logger, which you are, and you just want to adjust the log level, you can do it by simply setting the level key in your config and not even bothering with the loggerAdapter key.

@benishak
Copy link
Contributor Author

this doesn't work I tried

level :

and

loggerAdapter: {
        options: {
            level: config.DEBUG ? "info" : "error"
        }
    },

actually I got an error when not defining the module

@acinader
Copy link
Contributor

acinader commented Oct 12, 2016

@benishak if you use

loggerAdapter: {
        module: "parse-server/lib/Adapters/Logger/WinstonLoggerAdapter",
        options: {
            logLevel: config.DEBUG ? "info" : "error"
        }
    },

note that it is logLevel not level

Also if you replace your whole loggerAdapter: { },... with just logLevel: "error",

it should also work. I have tested both.

My response to you yesterday was incorrect in that i told you that the top level key was level not logLevel sorry for sending you down the wrong path.

@camdagr8
Copy link

Thanks for this.. it was driving me mad seeing the data for each cloud function when I wanted to see it for one particular function.

@QB3L
Copy link
Contributor

QB3L commented May 30, 2017

@acinader this is a pretty old issue but the logLevel at the top level of the config is good and important enough information to put on the front page

@flovilmart
Copy link
Contributor

You can pass it in the constructor: https://github.com/parse-community/parse-server/blob/master/src/ParseServer.js#L103

@QB3L
Copy link
Contributor

QB3L commented May 30, 2017

I meant putting it on the README. Sorry for the ambiguity.

@flovilmart
Copy link
Contributor

There's nothing that prevents you from doing it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants