Skip to content

Get 'Cannot read property 'category' of undefined' error  #8

@MikeRouten

Description

@MikeRouten

When trying to configure using the new log4js configuration format

log4js.configure({
    appenders: {
      out: { type: 'stdout' },
      app: { type: 'log4js-node-mongodb', connectionString: config.db_log_url }
    },
    categories: {
      default: { appenders: [ 'out', 'app' ], level: 'debug' }
    }
  });

the following error is raised:

C:\....\node_modules\log4js-node-mongodb\lib\index.js:100
                    category: loggingEvent.logger.category
                                                 ^

TypeError: Cannot read property 'category' of undefined
    at insert (C:\....\node_modules\log4js-node-mongodb\lib\index.js:100:50)
    at Immediate.<anonymous> (C:\....\node_modules\log4js-node-mongodb\lib\index.js:139:17)
    at runCallback (timers.js:672:20)
    at tryOnImmediate (timers.js:645:5)
    at processImmediate [as _immediateCallback] (timers.js:617:5)


Using log4js v2.3.3
and log4js-node-mongodb v2.2.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions