log4js-node / log4js-node/log4js-node

Inconsistent behavior of Log4js with PM2

Open
#942 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
5.8k
Forks
752
PR merge metrics
No merged PRs in 30d

Description

Hi all,

I am using log4js v 5.1.0 in PM2 mode with 2 workers and log level as debug. I have noticed that in particular file where log.debug is not used(only log.info) then logs not are getting written. Is that expected or i am missing something?

{
                appenders: {
                    app: {
                        type: 'dateFile',
                        filename: 'log_file.log',
                        pattern: '-yyyy-MM-dd',
                        alwaysIncludePattern: false,
                        maxLogSize: '10000',
                        backups: '10',
                        layout: {
                            type: 'pattern',
                            pattern: '[%d] [%p] [%c] %m'
                        }
                    }
                },
                categories: {
                    default: {
                        appenders: ['app'],
                        level: 'debug'
                    }
                },
                pm2: true,
            }

Contributor guide

No contributing guide indexed for this repository

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 reported behavior with log4js v5.1.0, PM2 in cluster mode with two workers, and the configuration shown in the issue. Compare a file that calls only log.info with one that calls log.debug, and verify whether the dateFile appender writes output. No source files or tests are identified, so the affected entry point still needs to be located.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
backend, observability
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.