Skip to content

Commit

Permalink
Merge pull request #67 from phillip-kruger/main
Browse files Browse the repository at this point in the history
Make history configurable
  • Loading branch information
phillip-kruger authored Mar 26, 2021
2 parents bd8c265 + d84c06f commit 88c1fce
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ public class LoggingManagerConfig {
@ConfigItem(defaultValue = "true")
boolean alwaysInclude;

/**
* The number of history log entries to remember.
*/
@ConfigItem(defaultValue = "50")
public int historySize;

/**
* UI configuration
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ void includeUiAndWebsocket(

if (launchMode.getLaunchMode().isDevOrTest()) {
// The static resources
// TODO: Make this public in core
Path tempPath = WebJarUtil.createResourcesDirectory(userApplication, artifact);

Path indexHtml = Paths.get(tempPath.toString(), INDEX_HTML);
Expand Down Expand Up @@ -192,9 +191,10 @@ void includeUiAndWebsocket(
@BuildStep
@Record(ExecutionTime.STATIC_INIT)
public HistoryHandlerBuildItem hander(BuildProducer<LogHandlerBuildItem> logHandlerBuildItemBuildProducer,
LogStreamRecorder recorder) {
// Should be made configurable:
RuntimeValue<Optional<HistoryHandler>> handler = recorder.handler(50);
LogStreamRecorder recorder,
LoggingManagerConfig loggingManagerConfig) {

RuntimeValue<Optional<HistoryHandler>> handler = recorder.handler(loggingManagerConfig.historySize);
logHandlerBuildItemBuildProducer.produce(new LogHandlerBuildItem((RuntimeValue) handler));
return new HistoryHandlerBuildItem(handler);
}
Expand Down

0 comments on commit 88c1fce

Please sign in to comment.