Class LoggingFeature

    • Field Detail

      • DEFAULT_LOGGER_NAME

        public static final String DEFAULT_LOGGER_NAME
        Default logger name to log request and response messages.
      • DEFAULT_LOGGER_LEVEL

        public static final String DEFAULT_LOGGER_LEVEL
        Default logger level which will be used for logging request and response messages.
      • DEFAULT_MAX_ENTITY_SIZE

        public static final int DEFAULT_MAX_ENTITY_SIZE
        Default maximum entity bytes to be logged.
        See Also:
        Constant Field Values
      • DEFAULT_SEPARATOR

        public static final String DEFAULT_SEPARATOR
        Default separator for entity logging.
        See Also:
        Constant Field Values
      • LOGGING_FEATURE_LOGGER_NAME

        public static final String LOGGING_FEATURE_LOGGER_NAME
        Common logger name property.
        See Also:
        Constant Field Values
      • LOGGING_FEATURE_LOGGER_LEVEL

        public static final String LOGGING_FEATURE_LOGGER_LEVEL
        Common logger level property.
        See Also:
        Constant Field Values
      • LOGGING_FEATURE_VERBOSITY

        public static final String LOGGING_FEATURE_VERBOSITY
        Common property for configuring a verbosity of entity.
        See Also:
        Constant Field Values
      • LOGGING_FEATURE_MAX_ENTITY_SIZE

        public static final String LOGGING_FEATURE_MAX_ENTITY_SIZE
        Common property for configuring a maximum number of bytes of entity to be logged.
        See Also:
        Constant Field Values
      • LOGGING_FEATURE_SEPARATOR

        public static final String LOGGING_FEATURE_SEPARATOR
        Common property for configuring logging separator.
        See Also:
        Constant Field Values
      • LOGGING_FEATURE_LOGGER_NAME_SERVER

        public static final String LOGGING_FEATURE_LOGGER_NAME_SERVER
        Server logger name property.
        See Also:
        Constant Field Values
      • LOGGING_FEATURE_LOGGER_LEVEL_SERVER

        public static final String LOGGING_FEATURE_LOGGER_LEVEL_SERVER
        Server logger level property.
        See Also:
        Constant Field Values
      • LOGGING_FEATURE_VERBOSITY_SERVER

        public static final String LOGGING_FEATURE_VERBOSITY_SERVER
        Server property for configuring a verbosity of entity.
        See Also:
        Constant Field Values
      • LOGGING_FEATURE_MAX_ENTITY_SIZE_SERVER

        public static final String LOGGING_FEATURE_MAX_ENTITY_SIZE_SERVER
        Server property for configuring a maximum number of bytes of entity to be logged.
        See Also:
        Constant Field Values
      • LOGGING_FEATURE_SEPARATOR_SERVER

        public static final String LOGGING_FEATURE_SEPARATOR_SERVER
        Server property for configuring separator.
        See Also:
        Constant Field Values
      • LOGGING_FEATURE_LOGGER_NAME_CLIENT

        public static final String LOGGING_FEATURE_LOGGER_NAME_CLIENT
        Client logger name property.
        See Also:
        Constant Field Values
      • LOGGING_FEATURE_LOGGER_LEVEL_CLIENT

        public static final String LOGGING_FEATURE_LOGGER_LEVEL_CLIENT
        Client logger level property.
        See Also:
        Constant Field Values
      • LOGGING_FEATURE_VERBOSITY_CLIENT

        public static final String LOGGING_FEATURE_VERBOSITY_CLIENT
        Client property for configuring a verbosity of entity.
        See Also:
        Constant Field Values
      • LOGGING_FEATURE_MAX_ENTITY_SIZE_CLIENT

        public static final String LOGGING_FEATURE_MAX_ENTITY_SIZE_CLIENT
        Client property for configuring a maximum number of bytes of entity to be logged.
        See Also:
        Constant Field Values
      • LOGGING_FEATURE_SEPARATOR_CLIENT

        public static final String LOGGING_FEATURE_SEPARATOR_CLIENT
        Client property for logging separator.
        See Also:
        Constant Field Values
    • Constructor Detail

      • LoggingFeature

        public LoggingFeature()
        Creates the feature with default values.
      • LoggingFeature

        public LoggingFeature​(Logger logger)
        Creates the feature with custom logger.
        Parameters:
        logger - the logger to log requests and responses.
      • LoggingFeature

        public LoggingFeature​(Logger logger,
                              LoggingFeature.Verbosity verbosity)
        Creates the feature with custom logger and verbosity.
        Parameters:
        logger - the logger to log requests and responses.
        verbosity - verbosity of logged messages. See LoggingFeature.Verbosity.
      • LoggingFeature

        public LoggingFeature​(Logger logger,
                              Integer maxEntitySize)
        Creates the feature with custom logger and maximum number of bytes of entity to log.
        Parameters:
        logger - the logger to log requests and responses.
        maxEntitySize - maximum number of entity bytes to be logged (and buffered) - if the entity is larger, logging filter will print (and buffer in memory) only the specified number of bytes and print "...more..." string at the end. Negative values are interpreted as zero.
      • LoggingFeature

        public LoggingFeature​(Logger logger,
                              Level level,
                              LoggingFeature.Verbosity verbosity,
                              Integer maxEntitySize)
        Creates the feature with custom logger, it's level, message verbosity and maximum number of bytes of entity to log.
        Parameters:
        logger - the logger to log requests and responses.
        level - level on which the messages will be logged.
        verbosity - verbosity of logged messages. See LoggingFeature.Verbosity.
        maxEntitySize - maximum number of entity bytes to be logged (and buffered) - if the entity is larger, logging filter will print (and buffer in memory) only the specified number of bytes and print "...more..." string at the end. Negative values are interpreted as zero.
      • LoggingFeature

        public LoggingFeature​(LoggingFeature.LoggingFeatureBuilder builder)
        Constructor based on logging feature builder. All parameters are passed through a builder instance.
        Parameters:
        builder - instance of a builder with required logging feature parameters
    • Method Detail

      • configure

        public boolean configure​(jakarta.ws.rs.core.FeatureContext context)
        Specified by:
        configure in interface jakarta.ws.rs.core.Feature