Skip to content

Commit

Permalink
[conf] enable to override directly .handlers and .level with environm…
Browse files Browse the repository at this point in the history
…ent variables
  • Loading branch information
rmannibucau committed Feb 11, 2024
1 parent 1b8ab65 commit bd667d1
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,12 @@ public synchronized void readConfiguration() throws IOException, SecurityExcepti
return;
}
}

final var level = getProperty(".level");
final var handlers = getProperty(".handlers");
readConfiguration(new ByteArrayInputStream(("" +
".level=INFO\n" +
".handlers=io.yupiik.logging.jul.handler.AsyncHandler\n" +
".level=" + (level == null || level.isBlank() ? "INFO" : level) + "\n" +
".handlers=" + (handlers == null || handlers.isBlank() ? "io.yupiik.logging.jul.handler.AsyncHandler" : handlers) + "\n" +
"").getBytes(StandardCharsets.UTF_8)));
}

Expand Down

0 comments on commit bd667d1

Please # to comment.