You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "adwsingh (via GitHub)" <gi...@apache.org> on 2023/02/16 09:25:57 UTC

[GitHub] [logging-log4j2] adwsingh opened a new pull request, #1276: Improving error messages in PathCondition

adwsingh opened a new pull request, #1276:
URL: https://github.com/apache/logging-log4j2/pull/1276

   Improving error messages in PathCondition for #1231 
   


-- 
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: [PR] Improving error messages in PathCondition (logging-log4j2)

Posted by "vy (via GitHub)" <gi...@apache.org>.
vy commented on PR #1276:
URL: https://github.com/apache/logging-log4j2/pull/1276#issuecomment-1448961708

   @adwsingh, we have renamed `release-2.x` and `master` branches to `2.x` and `main`, respectively. As an unexpected outcome, all PRs targeting those branches are closed. Would you mind re-creating your PR against these new branches, please?


-- 
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: [PR] Improving error messages in PathCondition (logging-log4j2)

Posted by "adwsingh (via GitHub)" <gi...@apache.org>.
adwsingh commented on PR #1276:
URL: https://github.com/apache/logging-log4j2/pull/1276#issuecomment-1448817102

   @vy is this closed unintentionally?  Same for https://github.com/apache/logging-log4j2/pull/1278 ?


-- 
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: [PR] Improving error messages in PathCondition (logging-log4j2)

Posted by "vy (via GitHub)" <gi...@apache.org>.
vy closed pull request #1276: Improving error messages in PathCondition
URL: https://github.com/apache/logging-log4j2/pull/1276


-- 
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


[GitHub] [logging-log4j2] ppkarwasz commented on pull request #1276: Improving error messages in PathCondition

Posted by "ppkarwasz (via GitHub)" <gi...@apache.org>.
ppkarwasz commented on PR #1276:
URL: https://github.com/apache/logging-log4j2/pull/1276#issuecomment-1432946158

   @adwsingh,
   
   In #1231 I was thinking about something slightly different. There are two ways to instantiate a Log4j2 component like `IfLastModified`:
   
    * you can call `IfLastModified#createAgeCondition` in your code. We don't recommend such a programmatic approach, so if you pass `null` as `age` parameter, IMHO you deserve the NPE with a standard message,
    * you can declare it in your configuration. In such a case the component is instantiated by [`PluginBuilder`](https://logging.apache.org/log4j/2.x/log4j-core/apidocs/org/apache/logging/log4j/core/config/plugins/util/PluginBuilder.html) that validates all constraints and logs the validation errors appropriately.
    
   I think that the path conditions just lack an appropriate [`@Required`](https://logging.apache.org/log4j/2.x/log4j-core/apidocs/org/apache/logging/log4j/core/config/plugins/validation/constraints/Required.html) annotation on those parameters that are required.
   
   We also have some complex constraints that are not supported by `PluginBuilder`: e.g. `IfFileName` requires a glob **or** a regex. To deal with this case `IfFileName#createNameCondition` should check if exactly one of `glob` and `regex` is `null`. If this is not the case the method should log an error (`StatusLogger`) and return `null`.


-- 
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