Package org.eclipse.orion.server.logs.objects

Examples of org.eclipse.orion.server.logs.objects.LoggerResource


      String putlevel = toPut.getString(LogConstants.KEY_LOGGER_LEVEL);
      Level level = Level.toLevel(putlevel, logger.getLevel());
      logger.setLevel(level);

      LoggerResource loggerResource = new LoggerResource();
      loggerResource.setBaseLocation(baseLocation);
      loggerResource.setName(logger.getName());
      loggerResource.setLevel(logger.getLevel());
      loggerResource.setEffectiveLevel(logger.getEffectiveLevel());

      JSONObject result = loggerResource.toJSON();
      OrionServlet.writeJSONResponse(request, response, result);
      response.setHeader(ProtocolConstants.HEADER_LOCATION,
          result.getString(ProtocolConstants.KEY_LOCATION));
      return true;
View Full Code Here


        String msg = NLS.bind("Logger not found: {0}", loggerName);
        return new ServerStatus(IStatus.ERROR,
            HttpServletResponse.SC_NOT_FOUND, msg, null);
      }

      LoggerResource loggerResource = new LoggerResource();

      loggerResource.setBaseLocation(baseLocation);
      loggerResource.setName(logger.getName());
      loggerResource.setLevel(logger.getLevel());
      loggerResource.setEffectiveLevel(logger.getEffectiveLevel());

      return new ServerStatus(Status.OK_STATUS,
          HttpServletResponse.SC_OK, loggerResource.toJSON());
    } catch (Exception e) {
      String msg = NLS
          .bind("An error occured when looking for logger: {0}",
              loggerName);
      return new ServerStatus(IStatus.ERROR,
View Full Code Here

      List<Logger> loggers = logService.getLoggers();

      JSONObject loggersJSON = new JSONObject();
      loggersJSON.put(ProtocolConstants.KEY_CHILDREN, new JSONArray());
      for (Logger logger : loggers) {
        LoggerResource loggerResource = new LoggerResource();

        loggerResource.setBaseLocation(baseLocation);
        loggerResource.setName(logger.getName());
        loggerResource.setLevel(logger.getLevel());
        loggerResource.setEffectiveLevel(logger.getEffectiveLevel());

        loggersJSON.append(ProtocolConstants.KEY_CHILDREN,
            loggerResource.toJSON());
      }

      return new ServerStatus(Status.OK_STATUS,
          HttpServletResponse.SC_OK, loggersJSON);
View Full Code Here

TOP

Related Classes of org.eclipse.orion.server.logs.objects.LoggerResource

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.