Skip to content

Commit

Permalink
Improve logging (Unidata#472)
Browse files Browse the repository at this point in the history
* Make sure edal-java style loading code logs errors

* Add extra info to log
  • Loading branch information
tdrwenski authored and WeatherGod committed Apr 18, 2024
1 parent 4fc5ea9 commit 7b57857
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions tds/src/main/java/thredds/server/config/TdsConfigMapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ static void load(WmsConfigBean wmsConfig, TdsContext tdsContext) {
getValueFromThreddsConfigOrDefault(WMS_PALETTE_LOCATION_DIR, defaultPaletteLocation);
wmsConfig.setPaletteLocationDir(paletteLocation);
try {
startupLog.info("Loading custom WMS palette files from " + paletteLocation);
ColourPalette.addPaletteDirectory(new File(paletteLocation));
} catch (FileNotFoundException e) {
// If there is an error adding a custom palette, it is logged in the server startup log by edal-java.
Expand All @@ -226,6 +227,7 @@ static void load(WmsConfigBean wmsConfig, TdsContext tdsContext) {
final String stylesLocation = getValueFromThreddsConfigOrDefault(WMS_STYLES_LOCATION_DIR, defaultStylesLocation);
wmsConfig.setStylesLocationDir(stylesLocation);
try {
startupLog.info("Loading custom WMS style files from " + stylesLocation);
SldTemplateStyleCatalogue.getStyleCatalogue().addStylesInDirectory(new File(stylesLocation));
} catch (FileNotFoundException e) {
if (!stylesLocation.equals(defaultStylesLocation)) {
Expand Down
4 changes: 2 additions & 2 deletions tds/src/main/webapp/WEB-INF/classes/log4j2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,8 @@
<appender-ref ref="threddsServlet"/>
</logger>

<!-- log issues related to loading custom color palettes -->
<logger name="uk.ac.rdg.resc.edal.graphics.utils.ColourPalette" level="warn" additivity="false">
<!-- log issues related to loading custom color palettes and styles -->
<logger name="uk.ac.rdg.resc.edal.graphics.utils" level="warn" additivity="false">
<appender-ref ref="serverStartup"/>
</logger>

Expand Down

0 comments on commit 7b57857

Please sign in to comment.