Package java.util.logging

Examples of java.util.logging.Level$KnownLevel


    }

    public void testJdk14LoggerWarnWithExceptionEnabled()
        throws Exception
    {
        final Level level = Level.ALL;
        final Level type = Level.WARNING;
        final String message = "Meep!";
        final Throwable throwable = new Throwable();
        final boolean output = true;

        final Jdk14Logger logger = createLogger( level );
View Full Code Here


    }

    public void testJdk14LoggerWarnWithExceptionDisabled()
        throws Exception
    {
        final Level level = Level.OFF;
        final String message = "Meep!";
        final Throwable throwable = new Throwable();

        final Jdk14Logger logger = createLogger( level );
        logger.warn( message, throwable );
View Full Code Here

    }

    public void testJdk14LoggerErrorEnabled()
        throws Exception
    {
        final Level level = Level.ALL;
        final Level type = Level.SEVERE;
        final String message = "Meep!";
        final Throwable throwable = null;
        final boolean output = true;

        final Jdk14Logger logger = createLogger( level );
View Full Code Here

    }

    public void testJdk14LoggerErrorWithExceptionEnabled()
        throws Exception
    {
        final Level level = Level.ALL;
        final Level type = Level.SEVERE;
        final String message = "Meep!";
        final Throwable throwable = new Throwable();
        final boolean output = true;

        final Jdk14Logger logger = createLogger( level );
View Full Code Here

      try{
        int spcIndex=loggingDef.indexOf(' ');
        if(spcIndex<0){
          throw new IllegalArgumentException();
        }
        Level l=Level.parse(loggingDef.substring(0,spcIndex));
        String prefix=loggingDef.substring(l.getName().length()+1).trim();
        if(lowestLevel.intValue()>l.intValue()){
          lowestLevel=l;
        }
        levels.add(l);
        prefixes.add(prefix);
      }
View Full Code Here

         String className = event.getLocationInformation().getClassName();
         String method = event.getLocationInformation().getMethodName();
         String line =  event.getLocationInformation().getLineNumber();
         org.apache.log4j.Level level = event.getLevel();
        
         Level javaLevel = mapLevel(level);
         log.logp(javaLevel, className, method + line, event.getMessage().toString());
      }
      catch (Throwable ex) {
         ex.printStackTrace();
      }
View Full Code Here

      else {
      */
      if ("logging".equals(type)) {
         String value = (values != null && values.length > 0) ? values[0] : "INFO";
         log.info("Changed property '" + key + "' to " + value);
         Level level = Level.parse(value);
         this.glob.changeLogLevel(key, level);
         return value;
      }
      else {
         try {
View Full Code Here

    }
  }

  private void setLog(String value) {
    if (value == null) {
      Level currentLevel = jdkRootLogger.getLevel();
      String levelString = currentLevel.getName();

      for (Map.Entry<String, Level> entry : LOG_LEVELS.entrySet()) {
        if (entry.getValue().equals(currentLevel)) {
          levelString = entry.getKey();
          break;
        }
      }

      writeln("log: " + levelString);
    }
    else {
      Level logLevel = LOG_LEVELS.get(value.toLowerCase());

      if (logLevel != null) {
        jdkRootLogger.setLevel(logLevel);
      }
      else {
View Full Code Here

      //if (Logger.LOG_WARN != level && LogChannel.LOG_ERROR != level)
      //   return;

      if (record == null) return;
      if (this.loggingSet == null) return;
      Level level = record.getLevel();
      String source = record.getSourceClassName()+"."+record.getSourceMethodName();
      String str = record.getMessage();
      String found = (Level.WARNING.equals(level)) ? "logging/warning/" : "logging/severe/";
      String foundEvent = found + "*"; // "logging/warning/*"
      if (!this.loggingSet.contains(foundEvent))
         return;
      // How to extract the Logger name like "core"?

      try {
         if (source == null) source = "";
         String description = (str == null) ? "" : str;

         String summary =
             "[" + new java.sql.Timestamp(record.getMillis()).toString()
           + " " + level.toString()
           + " " + Thread.currentThread().getName()
           + " " + source + "]";

         String eventType = foundEvent;

View Full Code Here

      // "logging/org.xmlBlaster.engine.RequestBroker"
      if (attribute_name.startsWith("logging/"))
         attribute_name = attribute_name.substring(8); // "org.xmlBlaster.engine.RequestBroker"

      try {
         Level level = this.glob.getLogLevel(attribute_name);
         return level.toString();
      }
      catch (XmlBlasterException e) {
         if (attribute_name == null || attribute_name.length() == 0 || "logging/".equals(attribute_name)) return Level.INFO.toString();
         throw(new AttributeNotFoundException("Cannot find '" + attribute_name + "' attribute in " + dClassName));
      }
View Full Code Here

TOP

Related Classes of java.util.logging.Level$KnownLevel

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.