public class SecurityUtil extends Object
| Modifier and Type | Field and Description |
|---|---|
static PrintStream |
syserr |
static PrintStream |
sysout |
| Modifier and Type | Method and Description |
|---|---|
static void |
bindSystemStreamsToSLF4J()
Redirect
System.out and System.err streams to SLF4J logger. |
static void |
bindSystemStreamsToSLF4J(org.slf4j.Logger newSysOutLogger,
org.slf4j.Logger newSysErrLogger)
Redirect
System.out and System.err streams to the given SLF4J loggers. |
static void |
logCommandLineArguments(String[] args)
Log command line arguments.
|
static void |
logJavaSystemProperties()
Log Java system properties.
|
static void |
logMessage(String message)
Log the formatted message at the INFO priority.
|
static void |
logShellEnvironmentVariables()
Log shell environment variables associated with Java process.
|
static void |
unbindSystemStreams()
Unbined bound system loggers and restore these streams to their original state.
|
public static final PrintStream sysout
public static final PrintStream syserr
public static void bindSystemStreamsToSLF4J()
System.out and System.err streams to SLF4J logger.
This is a benefit if you have a legacy console logger application. Does not provide
benefit of a full implementation. For example, no hierarchical or logger inheritence
support but there are some ancilarity benefits like, 1) capturing messages that would
otherwise be lost, 2) redirecting console messages to centralized log services, 3)
formatting console messages in other types of output (e.g., HTML).public static void bindSystemStreamsToSLF4J(org.slf4j.Logger newSysOutLogger,
org.slf4j.Logger newSysErrLogger)
System.out and System.err streams to the given SLF4J loggers.
This is a benefit if you have a legacy console logger application. Does not provide
benefit of a full implementation. For example, no hierarchical or logger inheritance
support but there are some ancillary benefits like, 1) capturing messages that would
otherwise be lost, 2) redirecting console messages to centralized log services, 3)
formatting console messages in other types of output (e.g., HTML).newSysOutLogger - Logger to use for System.outnewSysErrLogger - Logger to use for System.errpublic static void unbindSystemStreams()
bindSystemStreamsToSLF4J()public static void logCommandLineArguments(String[] args)
main() method
to quickly print arguments for future diagnostics.args - Command line argumentspublic static void logShellEnvironmentVariables()
public static void logJavaSystemProperties()
public static void logMessage(String message)
tbd
message - Message to log.Copyright © 2021. All rights reserved.