Unitech / Unitech/pm2

Cannot stop PM2 from creating pm2.log

Open
#2,921 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

S: Open for PR SYS : Log SYS: Daemon T: Enhancement
Dominant language
JavaScript
Stars
43.3k
Forks
2.7k
PR merge metrics
No merged PRs in 30d

Description

I have to run a process with PM2 on a device with very limited disk space, so I need to disable all logging otherwise the device will run out of space after several days.

I'm using:

"out_file": "/dev/null",
"error_file": "/dev/null"

It stops PM2 from creating logs for the process. However, PM2 still creates another log file in .pm2/pm2.log

The size of pm2.log can grow up to 9Mb, which is large for the device. But it seems that there is no way to stop PM2 from creating pm2.log.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with out_file and error_file set to /dev/null, then trace where PM2 creates .pm2/pm2.log. Check how PM2's logging configuration handles its own process log; done means users can disable that log and the behavior is covered by an appropriate test.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
cli, devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.