java.lang.Object
net.i2p.router.web.HelperBase
net.i2p.router.web.helpers.ConfigLoggingHelper

public class ConfigLoggingHelperextends HelperBase
Helper for logging configuration page rendering and form processing.
  • Field Details

    • _mgr

      private LogManager _mgr
      The router's log manager.
    • levels

      private static final String[] levels
      These are translated in the core bundle.
    • CORE_BUNDLE_NAME

      private static final String CORE_BUNDLE_NAME
      Bundle with the core's translated strings.
      See Also:
  • Constructor Details

    • ConfigLoggingHelper

      public ConfigLoggingHelper()
      Create a new helper for logging configuration.
  • Method Details

    • setContextId

      public void setContextId(String contextId)
      Re-fetch the log manager for the new context.
      Overrides:
      setContextId in class HelperBase
      Parameters:
      contextId - beginning few characters of the routerHash, or null to pick the first one we come across.
    • getLogFilePattern

      public String getLogFilePattern()
      Retrieve the current log file pattern.
      Returns:
      the base log filename pattern
    • getRecordPattern

      public String getRecordPattern()
      Retrieve the current log record format pattern.
      Returns:
      the format pattern string
    • getDatePattern

      public String getDatePattern()
      Retrieve the current log date format pattern.
      Returns:
      the date format pattern
    • getMaxFileSize

      public String getMaxFileSize()
      Retrieve the maximum log file size.
      Returns:
      the max file size as a formatted string (e.g. "1.00 MiB")
    • getLogCompress

      public String getLogCompress()
      Whether log compression is enabled.
      Returns:
      the CHECKED constant if compression is enabled, empty string otherwise
    • getLogLevelTable

      public String getLogLevelTable()
      Generate the HTML table for configuring log levels by class/package.
      Returns:
      the HTML string for the log level table
    • getDefaultLogLevelBox

      public String getDefaultLogLevelBox()
      Generate the HTML select box for the default log level.
      Returns:
      the HTML string for the select box
    • getLogLevelBox

      private void getLogLevelBox(StringBuilder buf, String name, String cur, boolean showRemove)
      Appends the select box choosing a logger's level.
      Parameters:
      buf - where the control is appended
      name - the control's name
      cur - the level now in use
      showRemove - whether to offer removing the entry
    • getNewClassBox

      public String getNewClassBox()
      All the classes the log manager knows about, except ones that already have overrides.
      Returns:
      the HTML string for the new class selection box
    • _c

      private String _c(String s)
      Translate a string from the core bundle.
      Parameters:
      s - the translation key
      Returns:
      the translated string