Questions tagged [pm2-logrotate]

PM2 module to automatically rotate logs of processes managed by PM2.

For more information:

28 questions
15
votes
2 answers

How to disable/stop a pm2 module?

Is it possible to stop or disable a pm2 module ? I did install the pm2-logrotate module but recently the community found an issue which is affecting our services and we need to stop or disable the module in top priority. The module is continuously…
7
votes
2 answers

How to rotate log files while running server with pm2?

We are using node module pm2 to run the server and capturing application logs. But as the traffic is very huge, huge data is getting stored in single file which are around more than 100Gb. Is there any possibility that we change the file every 1…
Jax
  • 139
  • 2
  • 12
7
votes
2 answers

PM2 Logrotate keeps generating new logs

I have following settings set for PM2 Logrotate: rotateInterval= * * 23 * * * max_size= 100MB I want to rotate the logs every 23 hours and/or keep max 100MB log files. But for some odd reason, the PM2 Logrotate keeps rotating / creating new log…
Almir
  • 167
  • 1
  • 2
  • 6
6
votes
1 answer

Pm2 logs with huge size using pm2-logrotate

I'm having troubles with pm2. I'm using a module called pm2-logrotate but the logs have a huge gize like 1.7G and don't respect my configuration which is == pm2-logrotate == ┌────────────────┬───────────────┐ │ key │ value …
Cátia Matos
  • 820
  • 1
  • 8
  • 26
3
votes
3 answers

PM2 error occurred => exited with code [1] via signal [SIGINT]

Nodejs was running on PM2 for a long time. And there is a corn which clears PM2 logs everyday 0 0 * * * find /home/user/.pm2/logs* -mtime +2 -exec rm -rf {} \; Below error occurred for 1000 times and then pm2 stopped working and then when I…
aRvi
  • 2,203
  • 1
  • 14
  • 30
2
votes
1 answer

Logrotate of /var/log/messages files

How can I set log rotate to, /var/log/messages files, all the files with the name "messages", rotate every 4 days (to keep last 4 files), not to generate any error messages?? /var/log/messsages-* { dateext maxage 3 rotate 4 missingok nocompress } Is…
2
votes
1 answer

Setup PM2 LogRotate using Ecosystem JS File

I am currently using a PM2 ecosystem file ecosystem.config.js to start multiple Node.js apps using PM2. module.exports = { "apps": [ { "name": "foo", "script": "./foo.js", }, { "name": "bar", "script":…
Nyxynyx
  • 61,411
  • 155
  • 482
  • 830
2
votes
1 answer

pm2 change dotenv/config path

pm2 start --node-args="-r dotenv/config" node_modules/react-scripts/bin/react-scripts.js --name app -- start dotenv_config_path=.env.$NODE_ENV this script works i want this one to work as well: pm2 start ecosystem.json --env env_development where…
2
votes
0 answers

PM2 logrotation different configuration for different apps running

I was wondering if there is a way to set different logrotation configs for different pm2 apps running. Like I am running 4 different node applications using pm2 but all of them are taking the same logrotation configs I set using pm2-logrotate…
iAmRoot
  • 107
  • 1
  • 10
1
vote
1 answer

how to save log data using log-rotate after deploy react app by npm build & pm2 serve?

I made the react app by cra in typescript. I tried to deploy by pm2, so I set the shell script like this. startup.sh #!/bin/bash npm install # Install pm2 globally npm install -g pm2 pm2 install pm2-logrotate pm2 set pm2-logrotate:rotateInterval 50…
juls
  • 65
  • 5
1
vote
0 answers

How to do pm2 log formatting?

Hi I have implemented pm2.Now I am getting timestamp in each line. //Current log 2021-05-04T00:34:49: { MongoError: server instance pool was destroyed 2021-05-04T00:34:49: at Function.MongoError.create…
Rahul Kumar
  • 65
  • 3
  • 11
1
vote
1 answer

PM2-Logrotate fill up all disk space

Few days ago, my webapp stopped work, i checked on the server and it was stopped in pm2 and didn't want restart. I figured that the disk was full (25Gb) so i took an upgrade to 80Gb and installed logrotate but today, 2 days after, the disk is full…
Christophe
  • 145
  • 1
  • 1
  • 12
1
vote
3 answers

pm2-logrotate install on offline linux machine

I want to install pm2-logrotate on linux machine where the machine is not having internet connectivity https://www.npmjs.com/package/pm2-logrotate
1
vote
1 answer

How to able/start a pm2 module without restarting my pc or reinstall this module?

If I killed the pm2 module, just like pm2-logrotate, how do I start this module without restarting my pc or reinstall this module.
SuperMario
  • 33
  • 4
1
vote
0 answers

PM2 Logrotate - install error

I am trying to install pm2 logrotate on ubuntu server. I run the command pm2 install pm2-logrotate I get the following error [PM2][Module][ERROR] Unknown module Any ideas on what could be wrong?
Aneesh
  • 579
  • 2
  • 5
  • 21
1
2