You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "leleplus (via GitHub)" <gi...@apache.org> on 2023/04/27 04:26:15 UTC

[I] Add support for PackagePatternSelector in log4j2 (logging-log4j2)

leleplus opened a new issue, #1450:
URL: https://github.com/apache/logging-log4j2/issues/1450

   I would like to propose a new feature for log4j2 called "PackagePatternSelector", which is similar to "LevelPatternSelector" but selects the pattern based on the package name of the logger.
   
   Currently, log4j2 provides "LevelPatternSelector" to select a pattern based on the log level. However, in my use case, I need to differentiate log output based on the package name of the logger. I believe this is a common requirement for many developers.
   
   With the addition of "PackagePatternSelector", users will be able to define different patterns for different packages. For example, we could define a specific pattern for a package named "com.example.package1" and another pattern for "com.example.package2".
   
   I believe this feature would greatly enhance the flexibility of log4j2 and make it more useful for a wider range of use cases.
   
   Thank you for considering my proposal.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Add support for PackagePatternSelector in log4j2 (logging-log4j2)

Posted by "rgoers (via GitHub)" <gi...@apache.org>.
rgoers commented on issue #1450:
URL: https://github.com/apache/logging-log4j2/issues/1450#issuecomment-1556285327

   Actually, I am open to this idea but I would rather see it created as a GitHub PR instead of an issue. That said, if you are unable to create the component I understand. I do find the name proposed here to be confusing though. Both the Logger and the Class contain a package name. Also, there is no guarantee that the Logger name will always be a package name. While the package could be applied to the class name, location information isn't always included in LogEvents.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Add support for PackagePatternSelector in log4j2 (logging-log4j2)

Posted by "vy (via GitHub)" <gi...@apache.org>.
vy closed issue #1450: Add support for PackagePatternSelector in log4j2
URL: https://github.com/apache/logging-log4j2/issues/1450


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Add support for PackagePatternSelector in log4j2 (logging-log4j2)

Posted by "vy (via GitHub)" <gi...@apache.org>.
vy commented on issue #1450:
URL: https://github.com/apache/logging-log4j2/issues/1450#issuecomment-1554646485

   Hello @leleplus, I think it will be ideal to move this discussion to the `dev@` mailing list, since this is not really an _issue_ in technical sense. Hence, I will take the incentive to close this ticket.
   
   For the records, you should be able to achieve what you want using `ScriptAppenderSelector`.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org