clebertsuconic commented on code in PR #4177:
URL: https://github.com/apache/activemq-artemis/pull/4177#discussion_r946892201


##########
artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Create.java:
##########
@@ -826,7 +830,16 @@ public Object run(ActionContext context) throws Exception {
          writeEtc(ETC_ARTEMIS_PROFILE, etcFolder, filters, true);
       }
 
-      writeEtc(ETC_LOGGING_PROPERTIES, etcFolder, null, false);
+      if (loggerProperties == null) {
+         writeEtc(ETC_LOGGING_PROPERTIES, etcFolder, null, false);
+      } else {
+         context.out.println("applying custom logger.properties from " + 
loggerProperties);
+         JBossLoggingConfiguration loggingConfig = 
JBossLoggingConfiguration.createDefaultArtemisLoggingProperties();
+         loggingConfig.updateFrom(new File(loggerProperties));
+         try (PrintWriter writer = new PrintWriter(new File(etcFolder, 
ETC_LOGGING_PROPERTIES))) {
+            loggingConfig.save(writer);

Review Comment:
   this is extremely fragile... you are mixing a set of properties from the 
user with existing properties in Jboss Logging...
   
   
   there's no way to limit what the users can do here....
   
   
   I would rather have the user providing the whole logging file instead...
   
   but then the whole operation on the CLI gets moot anyways.. as you could 
just write to the logging.properties yourself.
   
   
   Besides... we are about to remove Jboss Logging in favor of SLF4J. This PR 
is a big no for me.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to