Skip to content

Commit 0288eee

Browse files
author
Vladimir Kotal
authored
report more information during webapp startup (#2143)
approaches #2142
1 parent 736ab12 commit 0288eee

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/org/opensolaris/opengrok/configuration/Configuration.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1358,6 +1358,7 @@ public void encodeObject(OutputStream out) {
13581358
}
13591359

13601360
public static Configuration read(File file) throws IOException {
1361+
LOGGER.log(Level.INFO, "Reading configuration from {0}", file.getCanonicalPath());
13611362
try (FileInputStream in = new FileInputStream(file)) {
13621363
return decodeObject(in);
13631364
}

src/org/opensolaris/opengrok/web/WebappListener.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*/
1919

2020
/*
21-
* Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
21+
* Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
2222
*/
2323
package org.opensolaris.opengrok.web;
2424

@@ -37,6 +37,7 @@
3737
import javax.servlet.ServletRequestEvent;
3838
import javax.servlet.ServletRequestListener;
3939
import org.json.simple.parser.ParseException;
40+
import org.opensolaris.opengrok.Info;
4041
import org.opensolaris.opengrok.authorization.AuthorizationFramework;
4142
import org.opensolaris.opengrok.configuration.RuntimeEnvironment;
4243
import org.opensolaris.opengrok.logger.LoggerFactory;
@@ -64,6 +65,9 @@ public void contextInitialized(final ServletContextEvent servletContextEvent) {
6465
ServletContext context = servletContextEvent.getServletContext();
6566
RuntimeEnvironment env = RuntimeEnvironment.getInstance();
6667

68+
LOGGER.log(Level.INFO, "Starting webapp with version {0} ({1})",
69+
new Object[]{ Info.getVersion(), Info.getRevision()});
70+
6771
String config = context.getInitParameter("CONFIGURATION");
6872
if (config == null) {
6973
LOGGER.severe("CONFIGURATION section missing in web.xml");
@@ -91,10 +95,10 @@ public void contextInitialized(final ServletContextEvent servletContextEvent) {
9195
try {
9296
SocketAddress addr = new InetSocketAddress(InetAddress.getByName(cfg[0]), Integer.parseInt(cfg[1]));
9397
if (!RuntimeEnvironment.getInstance().startConfigurationListenerThread(addr)) {
94-
LOGGER.log(Level.SEVERE, "OpenGrok: Failed to start configuration listener thread");
98+
LOGGER.log(Level.SEVERE, "Failed to start configuration listener thread");
9599
}
96100
} catch (NumberFormatException | UnknownHostException ex) {
97-
LOGGER.log(Level.SEVERE, "OpenGrok: Failed to start configuration listener thread:", ex);
101+
LOGGER.log(Level.SEVERE, "Failed to start configuration listener thread:", ex);
98102
}
99103
} else {
100104
LOGGER.log(Level.SEVERE, "Incorrect format for the configuration address: ");

0 commit comments

Comments
 (0)