Unitech / Unitech/pm2

PM2 ecosystem config logs not working on windows

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

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
43.3k
Forks
2.7k
PR merge metrics
No merged PRs in 30d

Description

What's going wrong?

Setting out_file and error_file doesn't have any effect on windows, while it works on linux (Ubuntu 20)

How could we reproduce this issue?

Create such a config file ecosystem.config.js

const {join} = require("path");

const logsFolder = join(__dirname, "dist", "logs");

module.exports = {
    apps: [
        {
            name: "my-awesome-server",
            script: "npm --start", // build and start server
            out_file: join(logsFolder, "/out.log"),
            error_file: join(logsFolder, "error.log"),
            cron_restart: "0 0 * * *",
            env: {
                PORT: 3000,
                HTTPS_PORT: 5000,
                NODE_ENV: "development",
                DB_HOST: ["localhost", "82.223.83.177"][1]
            },
            env_production: {
                PORT: 3000,
                HTTPS_PORT: 5000,
                NODE_ENV: "production",
                DB_HOST: "localhost"
            }
        }
    ]
};

Supporting information

Using PM2 v 5.2.2 on Windows 11

$ pm2 report

Not pasting this because it only showed stuff like start app, or process killed...nothing relevant at all...

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 with the supplied ecosystem.config.js and reproduce the behavior on Windows 11 using PM2 v5.2.2, comparing out_file and error_file with the working Ubuntu case. Use pm2 report and the process output to narrow down why the configured log paths are ignored; done means both configured files receive the expected output and errors on Windows.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nodejs
Domain
cli, observability, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 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.