You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "zhfeng (via GitHub)" <gi...@apache.org> on 2023/03/22 00:41:01 UTC

[GitHub] [shardingsphere] zhfeng opened a new issue, #24728: Refactor YamlLoggingRuleConfigurationSwapper to add getDefaultLoggingRuleConfiguration

zhfeng opened a new issue, #24728:
URL: https://github.com/apache/shardingsphere/issues/24728

   ## Feature Request
   
   **For English only**, other languages will not be accepted.
   
   Please pay attention on issues you submitted, because we maybe need more details. 
   If no response anymore and we cannot make decision by current information, we will **close it**.
   
   Please answer these questions before submitting your issue. Thanks!
   
   ### Is your feature request related to a problem?
   It is simiar with #24727 and related to logback. I need to re-write `DefaultLoggingRuleConfiguration` in native building.
   
   ### Describe the feature you would like.
   Add `getDefaultLoggingRuleConfiguration` in `YamlLoggingRuleConfigurationSwapper` like
   ```java
   private LoggingRuleConfiguration getDefaultLoggingRuleConfiguration() {
       return new DefaultLoggingRuleConfigurationBuilder().build();
   }
   ```
   and change https://github.com/apache/shardingsphere/blob/dd16be872a0f24d24e147c58041f7f92a34879d9/kernel/logging/core/src/main/java/org/apache/shardingsphere/logging/yaml/swapper/YamlLoggingRuleConfigurationSwapper.java#L45-L47 with
   
   ```java
   if (null == result.getLoggers()) { 
       result = getDefaultLoggingRuleConfiguration();
   }
   ```
   


-- 
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@shardingsphere.apache.org.apache.org

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


[GitHub] [shardingsphere] RaigorJiang commented on issue #24728: Refactor YamlLoggingRuleConfigurationSwapper to add getDefaultLoggingRuleConfiguration

Posted by "RaigorJiang (via GitHub)" <gi...@apache.org>.
RaigorJiang commented on issue #24728:
URL: https://github.com/apache/shardingsphere/issues/24728#issuecomment-1478850018

   @zhfeng OK, thanks for your answer.
   


-- 
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@shardingsphere.apache.org

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


[GitHub] [shardingsphere] RaigorJiang closed issue #24728: Refactor YamlLoggingRuleConfigurationSwapper to add getDefaultLoggingRuleConfiguration

Posted by "RaigorJiang (via GitHub)" <gi...@apache.org>.
RaigorJiang closed issue #24728: Refactor YamlLoggingRuleConfigurationSwapper to add getDefaultLoggingRuleConfiguration 
URL: https://github.com/apache/shardingsphere/issues/24728


-- 
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@shardingsphere.apache.org

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


[GitHub] [shardingsphere] RaigorJiang commented on issue #24728: Refactor YamlLoggingRuleConfigurationSwapper to add getDefaultLoggingRuleConfiguration

Posted by "RaigorJiang (via GitHub)" <gi...@apache.org>.
RaigorJiang commented on issue #24728:
URL: https://github.com/apache/shardingsphere/issues/24728#issuecomment-1478834869

   Hi @zhfeng 
   It seems that it just extracts a call into an independent method. 
   What is the difference between these two ways for native building?


-- 
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@shardingsphere.apache.org

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


[GitHub] [shardingsphere] zhfeng commented on issue #24728: Refactor YamlLoggingRuleConfigurationSwapper to add getDefaultLoggingRuleConfiguration

Posted by "zhfeng (via GitHub)" <gi...@apache.org>.
zhfeng commented on issue #24728:
URL: https://github.com/apache/shardingsphere/issues/24728#issuecomment-1478845304

   @RaigorJiang yeah, I can use `@Substitute` in GraalVM and it could re-write these codes during the native building. Because I need to exclude `ch.qos.logback`, there are some issue with `DefaultLoggingRuleConfigurationBuilder` during the static analysis.
   
   ```java
   @TargetClass(YamlLoggingRuleConfigurationSwapper.class)
   final class YamlLoggingRuleConfigurationSwapperSubstitution {
       @Substitute
       private LoggingRuleConfiguration getDefaultLoggingRuleConfiguration() {
           return new JBossLoggingRuleConfigurationBuilder().build();
       }
   }
   ```
   Then it only impacts the native image.


-- 
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@shardingsphere.apache.org

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