Skip to content

Commit

Permalink
COMMANDBOX-1455
Browse files Browse the repository at this point in the history
  • Loading branch information
bdw429s committed Apr 8, 2022
1 parent 8cded72 commit dd300c1
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion gradle/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.7.2-03cc4ff8e3fb271a339af4efbdefab751db87dc9-70d36e81a8b364649708b309d1741b798c6a36b1
4.7.3-8cded729fa5fd97ad7d29c14702230eade9da17c-70d36e81a8b364649708b309d1741b798c6a36b1
6 changes: 1 addition & 5 deletions src/main/java/runwar/logging/LoggerFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ public static void configureUrlRewriteLoggers(boolean isTrace, Configuration log
urlrewriteLoggers.forEach(logger -> {
log4jConfig.addLogger(logger.getName(), logger);
});

if (isTrace) {
RunwarLogger.CONF_LOG.infof("Enabling URL rewrite log level: %s", "TRACE");
urlrewriteLoggers.forEach(logger -> {
Expand All @@ -253,10 +253,6 @@ public static void configureUrlRewriteLoggers(boolean isTrace, Configuration log
});
}


System.out.println("serverOptions.urlRewriteLog() ");
System.out.println(serverOptions.urlRewriteLog());

if (serverOptions.urlRewriteLog() != null) {
rewriteLogAppender = RollingFileAppender.newBuilder()
.setName("URLRewriteFileLogger")
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/runwar/options/CommandLineHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,12 @@ private static Options getOptions() {
.hasArg().withArgName("true|false")
.create(Keys.AUTOCREATECONTEXTSVDIRS));

options.addOption(OptionBuilder
.withLongOpt("log-pattern")
.withDescription("Log4j formatter pattern for log messages")
.hasArg().withArgName("[%-5p] %c: %m%n")
.create(Keys.LOGPATTERN));

options.addOption(new Option("h", Keys.HELP, false, "print this message"));
options.addOption(new Option("v", "version", false, "print runwar version and undertow version"));

Expand Down Expand Up @@ -692,6 +698,10 @@ public static ServerOptions parseLogArguments(String[] args, ServerOptions serve
serverOptions.logLevel(line.getOptionValue("level"));
}

if (hasOptionValue(line, Keys.LOGPATTERN)) {
serverOptions.logPattern(line.getOptionValue(Keys.LOGPATTERN));
}

if (line.hasOption(Keys.WAR)) {
String warPath = line.getOptionValue(Keys.WAR);
serverOptions.warFile(getFile(warPath));
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/runwar/options/ServerOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public static final class Keys {
final static String AUTOCREATECONTEXTSSECRET="autoCreateContextsSecret";
final static String AUTOCREATECONTEXTSMAX="autoCreateContextsMax";
final static String AUTOCREATECONTEXTSVDIRS="autoCreateContextsVDirs";

final static String LOGPATTERN="logPattern";

}

Expand Down

0 comments on commit dd300c1

Please sign in to comment.