Skip to content

Observatory logs filling and making our mongodb slow #36

@kaushik1979

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);
}

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