Top Description Inners Fields Constructors Methods
org.apache.tomcat.util.log

public Class UserDataHelper

extends Object
Class Inheritance
Imports
org.apache.juli.logging.Log

This helper class assists with the logging associated with invalid input data. A developer may want all instances of invalid input data logged to assist with debugging whereas in production it is likely to be desirable not to log anything for invalid data. The following settings may be used: By default, INFO_THEN_DEBUG is used with a suppression time of 24 hours.

Note

This class is not completely thread-safe. When using INFO_THEN_DEBUG it is possible that several INFO messages will be logged before dropping to DEBUG.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static enum
public static enum
UserDataHelper.Mode

Log mode for the next log message.

Field Summary

Modifier and TypeField and Description
private final UserDataHelper.Config
private volatile long
private final Log
private final long

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public UserDataHelper.Mode

Returns:

Log mode, or null
getNextMode
()

Returns log mode for the next log message, or null if the message should not be logged.

private boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

configback to summary
private final UserDataHelper.Config config
lastInfoTimeback to summary
private volatile long lastInfoTime
logback to summary
private final Log log
suppressionTimeback to summary
private final long suppressionTime

Constructor Detail

UserDataHelperback to summary
public UserDataHelper(Log log)

Method Detail

getNextModeback to summary
public UserDataHelper.Mode getNextMode()

Returns log mode for the next log message, or null if the message should not be logged.

If INFO_THEN_DEBUG configuration option is enabled, this method might change internal state of this object.

Returns:UserDataHelper.Mode

Log mode, or null

logAtInfoback to summary
private boolean logAtInfo()
org.apache.tomcat.util.log back to summary

private final Enum UserDataHelper.Config

extends Enum<UserDataHelper.Config>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final UserDataHelper.Config
public static final UserDataHelper.Config
public static final UserDataHelper.Config
public static final UserDataHelper.Config

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static UserDataHelper.Config
public static UserDataHelper.Config[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

DEBUG_ALLback to summary
public static final UserDataHelper.Config DEBUG_ALL
INFO_ALLback to summary
public static final UserDataHelper.Config INFO_ALL
INFO_THEN_DEBUGback to summary
public static final UserDataHelper.Config INFO_THEN_DEBUG
NONEback to summary
public static final UserDataHelper.Config NONE

Constructor Detail

Configback to summary
private Config()

Method Detail

valueOfback to summary
public static UserDataHelper.Config valueOf(String name)
valuesback to summary
public static UserDataHelper.Config[] values()
org.apache.tomcat.util.log back to summary

public final Enum UserDataHelper.Mode

extends Enum<UserDataHelper.Mode>
Class Inheritance

Log mode for the next log message.

Field Summary

Modifier and TypeField and Description
public static final UserDataHelper.Mode
public static final UserDataHelper.Mode
public static final UserDataHelper.Mode

Constructor Summary

AccessConstructor and Description
private
Mode()

Method Summary

Modifier and TypeMethod and Description
public static UserDataHelper.Mode
public static UserDataHelper.Mode[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

DEBUGback to summary
public static final UserDataHelper.Mode DEBUG
INFOback to summary
public static final UserDataHelper.Mode INFO
INFO_THEN_DEBUGback to summary
public static final UserDataHelper.Mode INFO_THEN_DEBUG

Constructor Detail

Modeback to summary
private Mode()

Method Detail

valueOfback to summary
public static UserDataHelper.Mode valueOf(String name)
valuesback to summary
public static UserDataHelper.Mode[] values()