Fields Summary |
---|
public static final String | UPGRADE_LOGGER |
public static final String | UPGRADE_CLI_LOGGER |
public static final String | UPGRADE_CERTCONVERSION_LOGGER |
public static final String | UPGRADE_GUI_LOGGER |
public static final String | UPGRADE_COMMON_LOGGER |
public static final String | UPGRADE_MISCCONFIG_LOGGER |
public static final String | UPGRADE_TRANSFORM_LOGGER |
public static final String | UPGRADE_REALM_LOGGER |
private static LogFormatter | formatter |
private static FileHandler | loghandler |
private static final Level | DEFAULT_LEVEL |
private static Level | logLevel |
Methods Summary |
---|
public static void | addLogMessageListener(LogMessageListener listener)
formatter.addLogMessageListener(listener);
|
private static java.util.logging.Level | getLogLevel()private helper method to decipher the log level from the system property.
Defaults to the statically defined field DEFAULT_LEVEL
String logLevel = System.getProperty("com.sun.aas.utool.LogLevel");
if (logLevel != null )
{
try{
return Level.parse(logLevel);
}catch(IllegalArgumentException e) {
return DEFAULT_LEVEL;
}
}
return DEFAULT_LEVEL;
|
public static java.util.logging.Logger | getLogger(java.lang.String name)
Logger logger = Logger.getLogger(name);
logger.setLevel(logLevel);
Handler[] h = logger.getHandlers();
for (int i = 0; i < h.length; i++) {
logger.removeHandler(h[i]);
}
logger.addHandler(loghandler);
loghandler.setLevel(logLevel);
return logger;
|
public static void | initialize(java.lang.String fileName)
LogManager.getLogManager().reset();
formatter = new LogFormatter();
boolean append = true;
int limit = 1000000;
loghandler = new FileHandler(fileName,limit,1,append);
logLevel = getLogLevel();
loghandler.setLevel(logLevel );
loghandler.setFormatter(formatter);
|
public static void | removeLogMessageListener(LogMessageListener listener)
formatter.removeLogMessageListener(listener);
|