LogUtil (Apache Tomcat 11.0.24 API Documentation)
Description: declaration: package: org.apache.juli, class: LogUtil

# Class LogUtil

java.lang.Object
org.apache.juli.LogUtil

public class LogUtil extends Object
Utility class for log-related operations.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static String`
  `escape(String input)`
  Escape a string so it can be displayed in a readable format.

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Method Details

  - ### escape

    public static String escape(String input)
    Escape a string so it can be displayed in a readable format. Characters that may not be printable in some/all of the contexts in which log messages will be viewed will be escaped using Java \\uNNNN escaping.

    All control characters are escaped apart from horizontal tab (\\u0009), new line (\\u000a) and carriage return (\\u000d).

    Parameters:
      `input` - The string to escape
    Returns:
      The escaped form of the input string