diff --git service/src/resources/hive-webapps/hiveserver2/hiveserver2.jsp service/src/resources/hive-webapps/hiveserver2/hiveserver2.jsp index 5d82029779..c238369ea9 100644 --- service/src/resources/hive-webapps/hiveserver2/hiveserver2.jsp +++ service/src/resources/hive-webapps/hiveserver2/hiveserver2.jsp @@ -79,6 +79,7 @@ String remoteUser = request.getRemoteUser();
  • Hive Configuration
  • Stack Trace
  • Llap Daemons
  • +
  • Configure logging
  • diff --git service/src/resources/hive-webapps/hiveserver2/llap.html service/src/resources/hive-webapps/hiveserver2/llap.html index e1424b82cc..62ac1b09e4 100644 --- service/src/resources/hive-webapps/hiveserver2/llap.html +++ service/src/resources/hive-webapps/hiveserver2/llap.html @@ -37,6 +37,7 @@
  • Hive Configuration
  • Stack Trace
  • Llap Daemons
  • +
  • Configure logging
  • diff --git service/src/resources/hive-webapps/hiveserver2/logconf.jsp service/src/resources/hive-webapps/hiveserver2/logconf.jsp new file mode 100644 index 0000000000..a5747c00e4 --- /dev/null +++ service/src/resources/hive-webapps/hiveserver2/logconf.jsp @@ -0,0 +1,140 @@ +<%-- +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +--%> +<%@ page contentType="text/html;charset=UTF-8" + import="org.apache.hadoop.conf.Configuration" + import="org.apache.hadoop.hive.conf.HiveConf" + import="org.apache.hadoop.hive.conf.HiveConf.ConfVars" + import="org.apache.hive.common.util.HiveVersionInfo" + import="org.apache.hive.http.HttpServer" + import="org.apache.hive.service.cli.operation.Operation" + import="org.apache.hive.service.cli.operation.SQLOperation" + import="org.apache.hadoop.hive.ql.QueryInfo" + import="org.apache.hive.service.cli.session.SessionManager" + import="org.apache.hive.service.cli.session.HiveSession" + import="javax.servlet.ServletContext" + import="java.util.Collection" + import="java.util.Date" + import="java.util.List" + import="jodd.util.HtmlEncoder" +%> + +<% + ServletContext ctx = getServletContext(); + Configuration conf = (Configuration)ctx.getAttribute("hive.conf"); + long startcode = conf.getLong("startcode", System.currentTimeMillis()); + SessionManager sessionManager = + (SessionManager)ctx.getAttribute("hive.sm"); + String remoteUser = request.getRemoteUser(); +%> + + + + + + + HiveServer2 + + + + + + + + + + + + + + + + + +
    +
    + +
    +
    + +
    + + + + + + + + + + +
    Logger nameLog level
    +
    + +

    Set new logging rules

    + +
    +
    + +
    +
    + +
    + + +
    + +
    +
    + + + \ No newline at end of file diff --git service/src/resources/hive-webapps/static/js/logconf.js service/src/resources/hive-webapps/static/js/logconf.js new file mode 100644 index 0000000000..a95b29ac4a --- /dev/null +++ service/src/resources/hive-webapps/static/js/logconf.js @@ -0,0 +1,40 @@ +$(document).ready(function () { + + // init the table with the current loggers + loadLoggers(); + + // set up event handler for submitting the form + $("#log-level-submit").click(function(e) { + setLoggersWithLevel(e); + }); +}); + +function setLoggersWithLevel(e) { + console.log("handler called"); + var loggerName = $("#logger-name").val(); + var logLevel = $("#log-level").val(); + var data = JSON.stringify( { "loggers" : [ { "logger" : loggerName, "level" : logLevel } ] } ); + + $.post('conflog', data, function() { + loadLoggers(); + }); +} + +function loadLoggers() { + // clear the current content + $("#current-logs").html(""); + + // load and render the new + $.getJSON('conflog', function (data) { + var loggers = data.loggers; + + $.each(loggers, function(i, logger) { + var logger_information = "\n" + + " " + logger.logger + "\n" + + " " + logger.level + "\n" + + " "; + $("#current-logs").append(logger_information); + }); + + }); +}