Skip to content

Commit d17ad83

Browse files
committed
Review startup warning, info and config logging
The startup, and especially the shutdown, are very chatty. Take advantage of CONFIG log levels, some configuration still logged as INFO Cut back on shutdown messages, many message intended for developers, about destory() and threads, are reduced to fine logging level
1 parent 879578f commit d17ad83

File tree

11 files changed

+25
-42
lines changed

11 files changed

+25
-42
lines changed

geowebcache/core/src/main/java/org/geowebcache/GeoWebCacheDispatcher.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ public void setServletPrefix(String servletPrefix) {
146146
this.servletPrefix = servletPrefix;
147147
}
148148

149-
LOG.info("Invoked setServletPrefix(" + servletPrefix + ")");
149+
LOG.config("Invoked setServletPrefix(" + servletPrefix + ")");
150150
}
151151
/**
152152
* GeoServer and other solutions that embedded this dispatcher will prepend a path, this is used
@@ -348,7 +348,7 @@ private boolean isClientStreamAbortedException(Throwable t) {
348348
* destroy="destroy">...</bean>
349349
*/
350350
public void destroy() {
351-
LOG.info("GeoWebCacheDispatcher.destroy() was invoked, shutting down.");
351+
LOG.fine("GeoWebCacheDispatcher.destroy() was invoked, shutting down.");
352352
}
353353

354354
/**

geowebcache/core/src/main/java/org/geowebcache/config/XMLConfiguration.java

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
import java.net.MalformedURLException;
2727
import java.net.URL;
2828
import java.util.ArrayList;
29-
import java.util.Arrays;
3029
import java.util.Collection;
3130
import java.util.Collections;
3231
import java.util.HashMap;
@@ -759,15 +758,9 @@ private static Node checkAndTransform(Document doc) throws ConfigurationExceptio
759758
validate(rootNode);
760759
log.config("TileLayerConfiguration file validated fine.");
761760
} catch (SAXException e) {
762-
String msg = "*** GWC configuration validation error: " + e.getMessage();
763-
char[] c = new char[4 + msg.length()];
764-
Arrays.fill(c, '*');
765-
String warndecoration = new String(c).substring(0, 80);
766-
log.warning(warndecoration);
767-
log.warning(msg);
761+
log.warning("GWC configuration validation error: " + e.getMessage());
768762
log.warning(
769-
"*** Will try to use configuration anyway. Please check the order of declared elements against the schema.");
770-
log.warning(warndecoration);
763+
"Will try to use configuration anyway. Please check the order of declared elements against the schema.");
771764
} catch (IOException e) {
772765
throw new RuntimeException(e.getMessage(), e);
773766
}

geowebcache/core/src/main/java/org/geowebcache/storage/BlobStoreAggregator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ private int initialize(BlobStoreConfiguration config) {
203203
int blobStoreCount = config.getBlobStoreCount();
204204

205205
if (blobStoreCount <= 0) {
206-
log.info(
206+
log.config(
207207
"BlobStoreConfiguration "
208208
+ config.getIdentifier()
209209
+ " contained no blob store infos.");

geowebcache/core/src/main/java/org/geowebcache/storage/DefaultStorageBroker.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public boolean put(TileObject tileObj) throws StorageException {
8787
}
8888

8989
public void destroy() {
90-
log.info("Destroying StorageBroker");
90+
log.fine("Destroying StorageBroker");
9191
}
9292

9393
public String getLayerMetadata(final String layerName, final String key) {

geowebcache/core/src/main/java/org/geowebcache/storage/DefaultStorageFinder.java

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,9 @@ private void determineDefaultPrefix() {
130130
if (tmpDir != null) {
131131
File temp = new File(tmpDir, "geowebcache");
132132
logMsg =
133-
"Reverting to java.io.tmpdir "
134-
+ this.defaultPrefix
135-
+ " for storage. "
133+
"Reverting to java.io.tmpdir '"
134+
+ temp.getAbsolutePath()
135+
+ "' for storage. "
136136
+ "Please set "
137137
+ GWC_CACHE_DIR
138138
+ ".";
@@ -159,15 +159,6 @@ private void determineDefaultPrefix() {
159159

160160
logMsg = msgPrefix + ", using it as the default prefix.";
161161
}
162-
163-
String warnStr = "*** " + logMsg + " ***";
164-
StringBuilder stars = new StringBuilder();
165-
for (int i = 0; i < warnStr.length(); i++) {
166-
stars.append("*");
167-
}
168-
169-
log.info(stars.toString());
170-
log.info(warnStr);
171-
log.info(stars.toString());
162+
log.config(logMsg);
172163
}
173164
}

geowebcache/diskquota/core/src/main/java/org/geowebcache/diskquota/DiskQuotaMonitor.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ public void shutDown(final int timeOutSecs) throws InterruptedException {
277277
Assert.isTrue(diskQuotaEnabled, "shutDown called but DiskQuotaMonitor is disabled!");
278278
Assert.isTrue(timeOutSecs > 0, "timeOut for shutdown must be > 0: " + timeOutSecs);
279279
try {
280-
log.info("Disk quota monitor shutting down...");
280+
log.fine("Disk quota monitor shutting down...");
281281
if (this.cacheInfoBuilder != null) {
282282
this.cacheInfoBuilder.shutDown();
283283
}
@@ -286,10 +286,10 @@ public void shutDown(final int timeOutSecs) throws InterruptedException {
286286
this.cleanUpExecutorService.shutdownNow();
287287
}
288288

289-
log.info("Shutting down quota usage monitor...");
289+
log.fine("Shutting down quota usage monitor...");
290290
quotaUsageMonitor.shutDownNow();
291291

292-
log.info("Shutting down quota statistics gathering monitor...");
292+
log.fine("Shutting down quota statistics gathering monitor...");
293293
usageStatsMonitor.shutDownNow();
294294

295295
quotaUsageMonitor.awaitTermination(timeOutSecs * 1000, TimeUnit.MILLISECONDS);

geowebcache/diskquota/core/src/main/java/org/geowebcache/diskquota/QueuedQuotaUpdatesConsumer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ public Long call() {
201201
*/
202202
checkAggregatedTimeouts();
203203
} catch (InterruptedException e) {
204-
log.info("Shutting down quota update background task due to InterruptedException");
204+
log.fine("Shutting down quota update background task due to InterruptedException");
205205
Thread.currentThread().interrupt();
206206
break;
207207
// it doesn't matter

geowebcache/diskquota/core/src/main/java/org/geowebcache/diskquota/QueuedUsageStatsConsumer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public Long call() {
128128
performAggregatedUpdate(requestedTile);
129129
}
130130
} catch (InterruptedException e) {
131-
log.info("Shutting down quota update background task due to interrupted exception");
131+
log.fine("Shutting down quota update background task due to interrupted exception");
132132
Thread.currentThread().interrupt();
133133
break;
134134
// it doesn't matter

geowebcache/diskquota/core/src/main/java/org/geowebcache/diskquota/QuotaUpdatesMonitor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public void startUp() {
7676

7777
@Override
7878
protected void shutDown(final boolean cancel) {
79-
log.info("Shutting down quota usage monitor...");
79+
log.fine("Shutting down quota usage monitor...");
8080
try {
8181
storageBroker.removeBlobStoreListener(quotaDiffsProducer);
8282
} catch (RuntimeException e) {

geowebcache/georss/src/main/java/org/geowebcache/georss/GeoRSSPoller.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,19 +66,18 @@ public GeoRSSPoller(final TileBreeder seeder, final int startUpDelaySecs) {
6666

6767
schedulingPollExecutorService.submit(
6868
() -> {
69-
LOGGER.info("Initializing GeoRSS poller in a background job...");
70-
7169
findEnabledPolls();
7270

7371
if (pollCount() > 0) {
72+
LOGGER.fine("Initializing GeoRSS poller in a background job...");
7473

7574
final TimeUnit seconds = TimeUnit.SECONDS;
7675
for (PollDef poll : scheduledPolls) {
7776
GeoRSSPollTask command = new GeoRSSPollTask(poll, seeder);
7877
GeoRSSFeedDefinition pollDef = poll.getPollDef();
7978
long period = pollDef.getPollInterval();
8079

81-
LOGGER.info(
80+
LOGGER.config(
8281
"Scheduling layer "
8382
+ poll.getLayer().getName()
8483
+ " to poll the GeoRSS feed "
@@ -91,14 +90,14 @@ public GeoRSSPoller(final TileBreeder seeder, final int startUpDelaySecs) {
9190

9291
scheduledTasks.add(command);
9392
}
94-
LOGGER.info(
93+
LOGGER.fine(
9594
"Will wait "
9695
+ startUpDelaySecs
9796
+ " seconds before launching the "
9897
+ pollCount()
9998
+ " GeoRSS polls found");
10099
} else {
101-
LOGGER.info("No enabled GeoRSS feeds found, poller will not run.");
100+
LOGGER.fine("No enabled GeoRSS feeds found, poller will not run.");
102101
}
103102
});
104103
}
@@ -157,7 +156,7 @@ public int pollCount() {
157156

158157
/** Destroy method for Spring */
159158
public void destroy() {
160-
LOGGER.info("destroy() invoked");
159+
LOGGER.fine("destroy() invoked");
161160
if (schedulingPollExecutorService != null) {
162161
schedulingPollExecutorService.shutdown();
163162
}

0 commit comments

Comments
 (0)