Class Logging

java.lang.Object
com.codename1.backend.log.Logging

public final class Logging extends Object

The logging configuration: per-logger levels and where lines go.

Levels come from logging.level.<name> settings, the keys Spring Boot uses. A logger takes the level of the longest name that is it or a package above it, and logging.level.root (INFO when unset) covers everything else:

logging.level.root=WARN
logging.level.com.example=INFO
logging.level.com.example.push=DEBUG

The server applies its configuration when it starts; setLevel(String, Level) changes one at run time, and every logger sees the change on its next line.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    The prefix of the per-logger level settings.
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    configure(Config config)
    Reads every logging.level.* setting of config, replacing the levels set before.
    static void
    setLevel(String logger, Level level)
    Sets the level of logger and every logger under it; null clears a level set before.
    static void
    Sends every line to sink from now on; null restores standard output.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Method Details

    • configure

      public static void configure(Config config) throws IOException
      Reads every logging.level.* setting of config, replacing the levels set before. Called by the server when it starts.
      Throws:
      IOException - when a setting names no level
    • setLevel

      public static void setLevel(String logger, Level level)
      Sets the level of logger and every logger under it; null clears a level set before. "root" is the level of everything else.
    • setSink

      public static void setSink(LogSink sink)
      Sends every line to sink from now on; null restores standard output.