Skip to content

subcategories #193

@kampde

Description

@kampde

Is it possible to have subcategories?

if I use this config.json:

{
  "appenders": [
    {
      "category": "main",
      // rest of the configuration for this appender
    },
    {
      "category": "main.child",
      // rest of the configuration for this appender
    }
  ]
}

And have the following code:

var log4js = require('log4js');
var mainLogger = log4js.getLogger('main');
var childLogger = log4js.getLogger('main.child');
var ignoredLogger = log4js.getLogger('main.ignored');

mainLogger.warn("This message is processed according to 'main' category appender");
childLogger.warn("This message is processed according to 'main.child' category appender");
ignoredLogger.warn("This message is ignored");

I would expect that the ignoredLogger message would be processed by the 'main' logger, as 'main.ignored' category is a subcategory of 'main' and there is no specific configuration for 'main.ignored'.

Is there some way to accomplish this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions