You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by GitBox <gi...@apache.org> on 2022/01/21 00:30:30 UTC

[GitHub] [logging-log4j2] ppkarwasz opened a new pull request #708: Log4j 1.2 bridge throws `ClassCastException` when using `SimpleLayout` and others

ppkarwasz opened a new pull request #708:
URL: https://github.com/apache/logging-log4j2/pull/708


   Since not all Log4j 1.x component builders extend `AbstractBuilder`, `BuilderManager#createBuilder` throws a `ClassCastException` when instantiating some of them.
   
   For example using a `SimpleLayout` in `log4j.properties` file fails.
   
   This PR fixes some test from #706 .


-- 
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 #708: Log4j 1.2 bridge throws `ClassCastException` when using `SimpleLayout` and others

Posted by GitBox <gi...@apache.org>.
ppkarwasz commented on pull request #708:
URL: https://github.com/apache/logging-log4j2/pull/708#issuecomment-1018002002


   @garydgregory,
   I rebase the PR and added some licenses to the XML config files.


-- 
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] garydgregory closed pull request #708: Log4j 1.2 bridge throws `ClassCastException` when using `SimpleLayout` and others

Posted by GitBox <gi...@apache.org>.
garydgregory closed pull request #708:
URL: https://github.com/apache/logging-log4j2/pull/708


   


-- 
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] garydgregory commented on pull request #708: Log4j 1.2 bridge throws `ClassCastException` when using `SimpleLayout` and others

Posted by GitBox <gi...@apache.org>.
garydgregory commented on pull request #708:
URL: https://github.com/apache/logging-log4j2/pull/708#issuecomment-1018018231


   @ppkarwasz 
   Thank you for your work on this PR! 👍 :-) I brought in this PR directly as a diff with these changes:
   - Add the Apache license header to XML test fixtures.
   - Remove unused imports.
   - Add missing spaces in Java source.
   - Remove some whitespace.
   


-- 
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] garydgregory commented on pull request #708: Fixes `ClassCastException` when using `SimpleLayout` in a Log4j 1.x configuration

Posted by GitBox <gi...@apache.org>.
garydgregory commented on pull request #708:
URL: https://github.com/apache/logging-log4j2/pull/708#issuecomment-1014529504


   "Since not all Log4j 1.x component builders extend AbstractBuilder, BuilderManager#createBuilder throws a ClassCastException when instantiating some of them."
   
   @rgoers Your thoughts: Is this an omission or by design? Should all builders extend or do we indeed need to introduce this interface?
   


-- 
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] garydgregory commented on pull request #708: Log4j 1.2 bridge throws `ClassCastException` when using `SimpleLayout` and others

Posted by GitBox <gi...@apache.org>.
garydgregory commented on pull request #708:
URL: https://github.com/apache/logging-log4j2/pull/708#issuecomment-1018048671


   @ppkarwasz 
   Oops, I messed up by closing this PR, so sorry, would you mind rebasing on `release-2.x`?


-- 
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 #708: Log4j 1.2 bridge throws `ClassCastException` when using `SimpleLayout` and others

Posted by GitBox <gi...@apache.org>.
ppkarwasz commented on pull request #708:
URL: https://github.com/apache/logging-log4j2/pull/708#issuecomment-1018045983


   @garydgregory, I don't see these changes on the `release-2.x` branch. The main point of this PR is to exchange the lower bound `AbstractBuilder` in the signature:
   
   `private <T extends AbstractBuilder> T createBuilder(PluginType<?> plugin, String prefix, Properties props)`
   
   with something all builders extend. Introducing a `Builder` interface from which `LayoutBuilder` and company inherit seemed like an elegant solution, although removing the lower bound altogether should also work.


-- 
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 #708: Log4j 1.2 bridge throws `ClassCastException` when using `SimpleLayout` and others

Posted by GitBox <gi...@apache.org>.
ppkarwasz commented on pull request #708:
URL: https://github.com/apache/logging-log4j2/pull/708#issuecomment-1018420349


   @garydgregory,
   
   I rebased the PR and added a failsafe to `BuilderManager#createBuilder`: if a builder does not implement any of the `*Builder` interfaces a warning is logged instead of a `ClassCastException`.


-- 
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 edited a comment on pull request #708: Log4j 1.2 bridge throws `ClassCastException` when using `SimpleLayout` and others

Posted by GitBox <gi...@apache.org>.
ppkarwasz edited a comment on pull request #708:
URL: https://github.com/apache/logging-log4j2/pull/708#issuecomment-1018002002


   @garydgregory,
   I rebased the PR and added some licenses to the XML config files.


-- 
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] garydgregory commented on pull request #708: Log4j 1.2 bridge throws `ClassCastException` when using `SimpleLayout` and others

Posted by GitBox <gi...@apache.org>.
garydgregory commented on pull request #708:
URL: https://github.com/apache/logging-log4j2/pull/708#issuecomment-1017985988


   @ppkarwasz 
   Please rebase on git branch `release-2.x`.


-- 
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] garydgregory merged pull request #708: Log4j 1.2 bridge throws `ClassCastException` when using `SimpleLayout` and others

Posted by GitBox <gi...@apache.org>.
garydgregory merged pull request #708:
URL: https://github.com/apache/logging-log4j2/pull/708


   


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