Skip to content
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

ParseServer maxLogFiles not yet effective ? #8827

Open
4 tasks
zurmokeeper opened this issue Nov 29, 2023 · 1 comment
Open
4 tasks

ParseServer maxLogFiles not yet effective ? #8827

zurmokeeper opened this issue Nov 29, 2023 · 1 comment
Labels
type:bug Impaired feature or lacking behavior that is likely assumed

Comments

@zurmokeeper
Copy link

zurmokeeper commented Nov 29, 2023

New Issue Checklist

Issue Description

var api = new ParseServer({
    // logLevel:"error",
    databaseURI: database.uri,
    cloud: server.cloud,
    appId: server.appId,
    masterKey: server.masterKey,
    serverURL: Config.server.serverURL,
    directAccess: false,
    maxLogFiles: 5
});

maxLogFiles not yet effective ????

I specified the maximum number of log files as 5, but the number of generated files still exceeds 5, I read the configuration of winston, it is necessary to use with maxsize, in the exceeding of maxsize will automatically delete the log files before 5. But I read the source code of winston and parse-server configurations, and this maxLogFiles configuration is not correct to be used in winston in the end.

parse-server source code: 

const consoleFormat = options.json ? format.json() : format.simple();
const consoleOptions = Object.assign(
  {
    colorize: true,
    name: 'console',
    silent,
    format: format.combine(format.splat(), consoleFormat),
  },
  options
);

transports.push(new winston.transports.Console(consoleOptions));    // maxLogFiles ->maxFiles  This configuration winston is not for here.
}

logger.configure({
   transports,
});
winston  example: 

const logger = winston.createLogger();
logger.configure({
        level: 'verbose',
        transports: [
            new winston.transports.File({
                filename: path.join(__dirname, 'info.log'),
                // level: 'info',
                // maxsize: 1024,
                maxFiles: 2           //  It should be in the` File `configuration, not the` Console `configuration.
            })
        ]      
})

Steps to reproduce

Actual Outcome

Expected Outcome

Environment

Server

  • Parse Server version: v6.3.1
  • Operating system: windows

Database

  • System (MongoDB or Postgres): MongoDB
  • Database version: 5.0

Logs

Copy link

parse-github-assistant bot commented Nov 29, 2023

Thanks for opening this issue!

  • 🚀 You can help us to fix this issue faster by opening a pull request with a failing test. See our Contribution Guide for how to make a pull request, or read our New Contributor's Guide if this is your first time contributing.

@mtrezza mtrezza added the type:bug Impaired feature or lacking behavior that is likely assumed label Nov 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Impaired feature or lacking behavior that is likely assumed
Projects
None yet
Development

No branches or pull requests

2 participants