Polish "Add path to DiskSpaceHealthIndicator's details and log message"

See gh-31998
This commit is contained in:
Andy Wilkinson 2022-09-05 12:58:01 +01:00
parent 36f9230f01
commit 25e6c533d9
2 changed files with 5 additions and 5 deletions

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2012-2020 the original author or authors. * Copyright 2012-2022 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -63,9 +63,9 @@ public class DiskSpaceHealthIndicator extends AbstractHealthIndicator {
builder.up(); builder.up();
} }
else { else {
logger.warn( logger.warn(LogMessage.format(
LogMessage.format("Free disk space below threshold. Available: %d bytes (path: %s, threshold: %s)", "Free disk space at path '%s' below threshold. Available: %d bytes (threshold: %s)",
diskFreeInBytes, this.path.getAbsolutePath(), this.threshold)); this.path.getAbsolutePath(), diskFreeInBytes, this.threshold));
builder.down(); builder.down();
} }
builder.withDetail("total", this.path.getTotalSpace()).withDetail("free", diskFreeInBytes) builder.withDetail("total", this.path.getTotalSpace()).withDetail("free", diskFreeInBytes)

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2012-2020 the original author or authors. * Copyright 2012-2022 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.