diff --git a/hbase-http/src/main/java/org/apache/hadoop/hbase/http/log/LogLevel.java b/hbase-http/src/main/java/org/apache/hadoop/hbase/http/log/LogLevel.java index 2f623137d56..aa223f3762d 100644 --- a/hbase-http/src/main/java/org/apache/hadoop/hbase/http/log/LogLevel.java +++ b/hbase-http/src/main/java/org/apache/hadoop/hbase/http/log/LogLevel.java @@ -105,13 +105,17 @@ public final class LogLevel { response)) { return; } + response.setContentType("text/html"); + String requestedURL = "header.jsp?pageTitle=Log Level"; + request.getRequestDispatcher(requestedURL).include(request, response); + PrintWriter out = response.getWriter(); + out.println(FORMS); - PrintWriter out = ServletUtil.initHTML(response, "Log Level"); String logName = ServletUtil.getParameter(request, "log"); String level = ServletUtil.getParameter(request, "level"); if (logName != null) { - out.println("

Results

"); + out.println("

Results:

"); out.println(MARKER + "Submitted Log Name: " + logName + "
"); @@ -132,28 +136,42 @@ public final class LogLevel { out.println("Sorry, " + log.getClass() + " not supported.
"); } } - - out.println(FORMS); - out.println(ServletUtil.HTML_TAIL); + out.println(""); + request.getRequestDispatcher("footer.jsp").include(request, response); + out.close(); } - static final String FORMS = "\n

Get / Set

" - + "\n
Log: " - + "" - + "
" - + "\n
Log: " - + "Level: " - + "" - + "
"; + static final String FORMS = "
\n" + + "
\n" + "\n" + "
\n" + "Actions:" + "

" + + "

\n" + "\n" + "\n" + + "\n" + "\n" + "\n" + "\n" + "\n" + + "\n" + "\n" + "\n" + "\n" + + "\n" + "\n" + "\n" + + "\n" + "
\n" + + "\n" + "\n" + + "\n" + "" + + "Get the current log level for the specified log name." + "
\n" + + "\n" + "\n" + + "\n" + + "\n" + "" + + "Set the specified log level for the specified log name." + "
\n" + "
\n" + "

\n" + "
\n"; private static void process(org.apache.log4j.Logger log, String level, PrintWriter out) throws IOException { if (level != null) { if (!level.equals(org.apache.log4j.Level.toLevel(level).toString())) { - out.println(MARKER + "Bad level : " + level + "
"); + out.println(MARKER + "
" + "Bad level : " + level + + "
" + "
"); } else { log.setLevel(org.apache.log4j.Level.toLevel(level)); - out.println(MARKER + "Setting Level to " + level + " ...
"); + out.println(MARKER + "
" + "Setting Level to " + level + + " ...
" + "
"); } } out.println(MARKER