Skip to content

Observatory logs filling and making our mongodb slow #36

Description

@kaushik1979

Can you tell me how can I control the logs generated in our production environment so that observatory does not drive our site dead-slow? What is the most optimized way of saving the logs in observatory?

I have the following code to control the log level in production but it does not help. It is still logging all the logs. What am I doing wrong here?

qlog = Observatory.getToolbox();

if(SITE_URL.search() != -1 || SITE_URL.search(**) != -1) {
console.log("Setting the log level to WARN for ***
" + SITE_URL);
var settings = {
maxSeverity: "WARN",
printToConsole: false, // whether to also log to console
logUser: true, // log the user information?
logHttp: true, // log http requests automagically?
logDDP: false, // log DDP requests automagically?
};
Observatory.setSettings(settings);
} else {
console.log("Setting the log level to INFO for localhost " + SITE_URL);
var settings = {
maxSeverity: "INFO",
printToConsole: true, // whether to also log to console
logUser: true, // log the user information?
logHttp: true, // log http requests automagically?
logDDP: false, // log DDP requests automagically?
};
Observatory.setSettings(settings);
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions