8000 Only rotates logs for one process of a cluster · Issue #194 · keymetrics/pm2-logrotate · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Only rotates logs for one process of a cluster #194

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

Open
MorayM opened this issue Jan 18, 2025 · 1 comment
Open

Only rotates logs for one process of a cluster #194

MorayM opened this issue Jan 18, 2025 · 1 comment

Comments

@MorayM
Copy link
MorayM commented Jan 18, 2025

I have cluster running 3 instances of a process using the following ecosystem file:

module.exports = {
  apps: [{
    name: 'api.my_product.com',
    script: './dist/src/index.js',
    instances: 3,
    exec_mode: 'cluster',
    autorestart: true,
    watch: false,
    max_memory_restart: '2G',
    env: {
      NODE_ENV: 'production',
    },
  }],
};

Which writes logs to the default location ~/.pm2/logs.

I've installed pm2-logrotate with the default settings, however it only rotates the logs for the first process in the cluster. The other two processes continue writing to the same files. How do I configure it to rotate log files for all the processes?

@MorayM
Copy link
Author
MorayM commented Jan 24, 2025

After a little more research it looks like this issue is only affecting one of my 3 app servers. They all have identical module_conf.json files. Is there any configuration stored elsewhere that may be responsible?

{
    "module-db-v2": {
        "pm2-logrotate": {}
    },
    "pm2-logrotate": {
        "max_size": "10M",
        "retain": "30",
        "compress": false,
        "dateFormat": "YYYY-MM-DD_HH-mm-ss",
        "workerInterval": "30",
        "rotateInterval": "0 0 * * *",
        "rotateModule": true
    }
}

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

1 participant
0