Top Description Fields Constructors Methods
org.apache.logging.log4j.util

pack-priv final Class LowLevelLogUtil

extends Object
Class Inheritance
Imports
edu.umd.cs.findbugs.annotations.SuppressFBWarnings, java.io.OutputStream, .PrintWriter, .Writer, java.util.Objects

PrintWriter-based logging utility for classes too low level to use org.apache.logging.log4j.status.StatusLogger. Such classes cannot use StatusLogger as StatusLogger or org.apache.logging.log4j.simple.SimpleLogger depends on them for initialization. Other framework classes should stick to using StatusLogger.
Since
2.6

Field Summary

Modifier and TypeField and Description
private static PrintWriter

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static void
log(final String
the message to log
message
)

Logs the given message.

public static void
logException(final Throwable exception)

public static void
logException(final String message, final Throwable exception)

public static void
setOutputStream(final OutputStream
the OutputStream to log to
out
)

Sets the underlying OutputStream where exceptions are printed to.

public static void
setWriter(final Writer
the Writer to log to
writer
)

Sets the underlying Writer where exceptions are printed to.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

writerback to summary
private static PrintWriter writer
Annotations
@SuppressWarnings:DefaultCharset

Constructor Detail

LowLevelLogUtilback to summary
private LowLevelLogUtil()

Method Detail

logback to summary
public static void log(final String message)

Logs the given message.

Parameters
message:String

the message to log

Since
2.9.2
logExceptionback to summary
public static void logException(final Throwable exception)
Annotations
@SuppressFBWarnings:INFORMATION_EXPOSURE_THROUGH_AN_ERROR_MESSAGE
justification:Log4j prints stacktraces only to logs, which should be private.
logExceptionback to summary
public static void logException(final String message, final Throwable exception)
setOutputStreamback to summary
public static void setOutputStream(final OutputStream out)

Sets the underlying OutputStream where exceptions are printed to.

Parameters
out:OutputStream

the OutputStream to log to

Annotations
@SuppressWarnings:DefaultCharset
setWriterback to summary
public static void setWriter(final Writer writer)

Sets the underlying Writer where exceptions are printed to.

Parameters
writer:Writer

the Writer to log to