pm2 Configuration File

Open
#5,179 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
25/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript, nodejs
Domain
devops

Research direction

Start with ecosystem.config.js and app.js, especially the cwd setting and log4js file appender using the relative filename bot.log. Reproduce the PM2 launch with the supplied paths and check which working directory log4js uses. Done means the log file is created in the telegramBot directory rather than the server directory.

Written by the indexing model from the issue text.

Description

Hi,

I want to manage multiple projects with pm2, but I am having the problem I have given below.

Sample;

  • my project directory : C:\Users\username\Desktop\telegramBot
  • my pm2 project directory : C:\Users\username\Desktop\server

my pm2 project directory -> ecosystem.config.js content

module.exports = { apps : [{ name : "telegram", script : "C:/Users/username/Desktop/telegramBot/app.js", cwd:"C:/Users/username/Desktop/telegramBot/" }] }

app.js content;

log4js.configure({ appenders: { console: {type: 'console'}, file: {type: 'file', filename: 'bot.log'},

My question is;

It needs to open the bot.log folder in my project directory, but it opens it into my server file. I want it to open in my TelegramBot directory.

Not: I know this will happen when I change app.js in telegramBot.

res

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

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.

More from Unitech/pm2

All issues in Unitech/pm2

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.