Defining a category with no explicit list of appenders, should use the root logger, not all appenders

Description

When you define a category in logbox and you don't specify the appenders you want it to use, it uses all appenders. however, it makes more sense to use the appenders defined for the root logger since that is the behavior of logbox for implicit logging categories.

This is even more of an issue when using the following syntax for declaring a category

because in that case, it's literally impossible to specify the appenders you want. This causes undesirable and unexpected behaviors in a setup like so where there are appenders defined for very special purposes that are not assigned to the root logger on purpose, but only assigned to explicit loggers to use.

In the example above, you'd expect ONLY the specialLogger to ever send log messages to the specialAppender, but surprise! The coldbox.system logger category is NOT created with the appenders from the root logger. Instead it's created with every single appender and there's no way to change this while also using the "implicit" info syntax.

My suggested fix is that the category() method in the logboxConfig class no longer defaults the appenders argument to * but instead defaults to an empty string, and when it's empty, simply copies the appenders from the root logger. That way custom logging categories with no explicit appenders inherit from the root logger as expected.

Activity

Show:
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Priority

Sentry

Created October 12, 2020 at 9:48 PM
Updated October 12, 2020 at 9:48 PM