LogConfigReader.java revision 3296aadab8464fc555488c34c7ee63644b754387
/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2006 Sun Microsystems Inc. All Rights Reserved
*
* The contents of this file are subject to the terms
* of the Common Development and Distribution License
* (the License). You may not use this file except in
* compliance with the License.
*
* You can obtain a copy of the License at
* https://opensso.dev.java.net/public/CDDLv1.0.html or
* opensso/legal/CDDLv1.0.txt
* See the License for the specific language governing
* permission and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* Header Notice in each file and include the License file
* at opensso/legal/CDDLv1.0.txt.
* If applicable, add the following below the CDDL Header,
* with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*
* $Id: LogConfigReader.java,v 1.19 2009/11/04 22:33:10 bigfatrat Exp $
*
* Portions Copyrighted 2010-2014 ForgeRock AS.
* Portions Copyrighted 2014 Nomura Research Institute, Ltd
* Portions Copyrighted 2013 Cybernetica AS.
*/
package com.sun.identity.log.s1is;
import com.iplanet.am.util.SystemProperties;
import com.iplanet.sso.SSOException;
import com.iplanet.sso.SSOToken;
import com.sun.identity.log.LogConstants;
import com.sun.identity.log.LogManager;
import com.sun.identity.log.LogManagerUtil;
import com.sun.identity.security.AdminTokenAction;
import com.sun.identity.shared.Constants;
import com.sun.identity.shared.datastruct.CollectionHelper;
import com.sun.identity.shared.debug.Debug;
import com.sun.identity.sm.SMSException;
import com.sun.identity.sm.ServiceListener;
import com.sun.identity.sm.ServiceSchema;
import com.sun.identity.sm.ServiceSchemaManager;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.security.AccessController;
import java.util.Comparator;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
/**
* <tt>LogConfigReader</TT> is used to load the configuration from the
* Directory Server and store the configuration as Properties of
* <tt>LogManager</tt>. <p>
* <tt>LogConfigReader</TT> is very Speicific to DSAME. <p>
* java.util.logging.config.class System property should point to this class,
* since LogManager uses this property instantiates this class to load
* the configuration.
*/
public class LogConfigReader implements ServiceListener{
private static Debug debug;
private static ServiceSchema smsLogSchema = null;
private static ServiceSchema smsPlatformSchema = null;
private static ServiceSchema smsNamingSchema = null;
private static Map logAttributes = null;
private static Map platformAttributes = null;
private static Map namingAttributes = null;
private String localProtocol = null;
private String localHost = null;
private String localPort = null;
private boolean useOldLogFormat = false;
/**
* Local Log service identifier
*/
public static String localLogServiceID = null;
private static boolean isRegisteredForDSEvents = false;
private LogManager manager;
/**
* The constructor loads the configuration from the DS using
* DSAME SDK. Constructs a String as "key=value CRLF" for each
* AttributeSchema in the amLogging.xml. In case the AttributeSchema
* has multiple values or a List, it gets converted to a "," seperated
* String.
* <p> Example1: iplanet-am-logging-backend=FILE \r\n
* <p> Example2: iplanet-am-logging-logfields=TIME, DOMAIN, IPADDR,
* HOSTNAME, DATA, LEVEL, LOGINID \r\n
* <p> The input stream hence constructed is converted into a
* ByteArrayInputStream and is loaded into LogManager.
* @throws IOException
*/
public LogConfigReader() throws IOException {
debug = Debug.getInstance("amLog");
localProtocol = SystemProperties.get("com.iplanet.am.server.protocol");
localHost = SystemProperties.get("com.iplanet.am.server.host");
localPort = SystemProperties.get(Constants.AM_SERVER_PORT);
localLogServiceID = localProtocol + "://" + localHost + ":" + localPort;
useOldLogFormat =
SystemProperties.getAsBoolean(Constants.USE_OLD_LOG_FORMAT);
SSOToken ssoToken;
try {
ssoToken = getSSOToken();
} catch (SSOException ssoe) {
debug.error("LogConfigReader: Could not get proper SSOToken", ssoe);
return;
}
if (debug.messageEnabled()) {
debug.message("LogConfigReader: ssoToken obtained" + ssoToken);
}
try {
getDefaultAttributes(ssoToken);
} catch (SMSException smse) {
debug.warning("LogConfigReader: Could not " +
"get defaultAttributes", smse);
return;
} catch (SSOException ssoe) {
debug.error("LogConfigReader: Could not " +
"get defaultAttributes", ssoe);
return;
}
String configString = constructInputStream();
ByteArrayInputStream inputStream = null;
try { inputStream =
new ByteArrayInputStream(configString.getBytes("ISO8859-1"));
} catch (UnsupportedEncodingException unse) {
debug.error("LogConfigReader: unsupported Encoding" + unse);
}
manager =
(com.sun.identity.log.LogManager) LogManagerUtil.getLogManager();
try {
manager.readConfiguration(inputStream);
} catch (IOException ioe) {
debug.error("LogConfigReader: Can not load configuration" + ioe);
throw new IOException(ioe.toString());
}
setLocalFlag();
}
private void copyConfigOption(StringBuilder sb, String key, Map attributes,
String description) {
try {
String value = CollectionHelper.getMapAttr(attributes, key);
if (value == null || value.isEmpty()) {
debug.warning("LogConfigReader: " + description + " is null");
} else {
sb.append(key).append("=").append(value).append(LogConstants.CRLF);
}
} catch (Exception e) {
debug.error("LogConfigReader: Could not read " + description, e);
}
}
/**
* LogManager needs inputStream in the form of " Key = Value \r\n ".
* so to get that we need to get the keys of the default attributs append
* a "=", get the value for that key and append a CRLF. This input stream
* will then be loaded into the logmanager via properties API.
*/
private String constructInputStream() {
StringBuilder sbuffer = new StringBuilder(2000);
String key = null;
String value = null;
Set set;
Iterator it;
StringBuilder tempBuffer = new StringBuilder();
boolean fileBackend = false;
String basedir = null;
String famuri = null;
// processing logging attributes.
try {
/*
* generate %BASE_DIR% and %SERVER_URI% values, in case
* they're not set up yet (e.g., during configuration
*/
famuri = SystemProperties.get(
Constants.AM_SERVICES_DEPLOYMENT_DESCRIPTOR);
famuri = famuri.replace('\\','/');
basedir = SystemProperties.get(
SystemProperties.CONFIG_PATH);
basedir = basedir.replace('\\','/');
if (famuri.startsWith("/")) {
byte[] btmp = famuri.getBytes();
famuri = new String(btmp, 1, (btmp.length - 1));
}
if (basedir.endsWith("/")) {
byte[] btmp = basedir.getBytes();
basedir = new String(btmp, 0, (btmp.length - 1));
}
logAttributes = smsLogSchema.getAttributeDefaults();
// File/jdbc
key = LogConstants.BACKEND;
value = CollectionHelper.getMapAttr(logAttributes, key);
if ((value == null) || (value.length() ==0)) {
debug.warning("LogConfigReader: Backend string is null");
} else {
sbuffer.append(key).append("=")
.append(value).append(LogConstants.CRLF);
fileBackend = value.equals("File");
}
} catch (Exception e) {
debug.error("LogConfigReader: Could not read Backend ", e);
}
copyConfigOption(sbuffer, LogConstants.DB_DRIVER, logAttributes, "DB driver");
copyConfigOption(sbuffer, LogConstants.DB_PASSWORD, logAttributes, "DB password");
copyConfigOption(sbuffer, LogConstants.DB_USER, logAttributes, "DB user");
// all Fields
try {
key = LogConstants.ALL_FIELDS;
tempBuffer.append("time, Data, ");
set = (Set) logAttributes.get(key);
if (!useOldLogFormat) {
it = set.iterator();
} else {
TreeSet orderedHeaders = new TreeSet(new LogHeaderComparator());
orderedHeaders.addAll(set);
it = orderedHeaders.descendingIterator();
}
String headerValue = (String) it.next();
if (headerValue.contains(Constants.COLON)) {
headerValue =
headerValue.substring(headerValue.indexOf(Constants.COLON) + 1);
}
tempBuffer.append(headerValue);
while(it.hasNext()) {
headerValue = (String) it.next();
if (headerValue.contains(Constants.COLON)) {
headerValue =
headerValue.substring(headerValue.indexOf(Constants.COLON) + 1);
}
tempBuffer.append(", ").append(headerValue);
}
sbuffer.append(key).append(Constants.EQUALS)
.append(tempBuffer).append(LogConstants.CRLF);
} catch (Exception ex) {
debug.error("LogConfigReader: Could not read all field ", ex);
}
// Selected Log Fields
try {
key = LogConstants.LOG_FIELDS;
set = (Set) logAttributes.get(key);
if ((set != null) && (!set.isEmpty())) {
it = set.iterator();
tempBuffer = new StringBuilder();
tempBuffer.append((String) it.next());
while(it.hasNext()) {
tempBuffer.append(", ").append((String) it.next());
}
sbuffer.append(key).append("=")
.append(tempBuffer).append(LogConstants.CRLF);
}
} catch (Exception e) {
debug.error("LogConfigReader: Could not read log-field ", e);
}
copyConfigOption(sbuffer, LogConstants.ENABLE_ROTATION, logAttributes, "Enable Logfile rotation");
copyConfigOption(sbuffer, LogConstants.MAX_FILE_SIZE, logAttributes, "Max File Size");
copyConfigOption(sbuffer, LogConstants.LOGFILE_PREFIX, logAttributes, "Logfile prefix string");
copyConfigOption(sbuffer, LogConstants.LOGFILE_SUFFIX, logAttributes, "Logfile suffix string");
copyConfigOption(sbuffer, LogConstants.LOGFILE_ROTATION, logAttributes, "Logfile rotation interval");
copyConfigOption(sbuffer, LogConstants.NUM_HISTORY_FILES, logAttributes, "Num history files");
copyConfigOption(sbuffer, LogConstants.ARCHIVER, logAttributes, "Archiver class");
copyConfigOption(sbuffer, LogConstants.FILE_HANDLER, logAttributes, "File handler class");
copyConfigOption(sbuffer, LogConstants.SECURE_FILE_HANDLER, logAttributes, "Secure File handler class");
copyConfigOption(sbuffer, LogConstants.DB_HANDLER, logAttributes, "DB handler class");
copyConfigOption(sbuffer, LogConstants.REMOTE_HANDLER, logAttributes, "Remote handler class");
copyConfigOption(sbuffer, LogConstants.SYSLOG_HANDLER, logAttributes, "Syslog handler class");
copyConfigOption(sbuffer, LogConstants.ELF_FORMATTER, logAttributes, "ELF Formatter class");
copyConfigOption(sbuffer, LogConstants.SECURE_ELF_FORMATTER, logAttributes, "Secure ELF Formatter class");
copyConfigOption(sbuffer, LogConstants.DB_FORMATTER, logAttributes, "DB Formatter class");
copyConfigOption(sbuffer, LogConstants.REMOTE_FORMATTER, logAttributes, "Remote Formatter class");
copyConfigOption(sbuffer, LogConstants.SYSLOG_FORMATTER, logAttributes, "Syslog Formatter class");
copyConfigOption(sbuffer, LogConstants.AUTHZ, logAttributes, "Authz class");
getLoggingDirectory(fileBackend, basedir, famuri, sbuffer);
copyConfigOption(sbuffer, LogConstants.SECURITY_STATUS, logAttributes, "Security status"); // On or Off
copyConfigOption(sbuffer, LogConstants.SECURITY_SIGNING_ALGORITHM, logAttributes,
"Secure log signing algorithm");
copyConfigOption(sbuffer, LogConstants.SECURE_LOG_HELPER, logAttributes, "Secure log helper class");
// secure logger certificate store
try {
key = LogConstants.LOGGER_CERT_STORE;
value = CollectionHelper.getMapAttr(logAttributes, key);
if ((value == null) || (value.length() ==0)) {
debug.warning("LogConfigReader: secure logger " +
"certificate store is null");
} else {
value = value.replace('\\','/');
if (value.contains("%BASE_DIR%") ||
value.contains("%SERVER_URI%"))
{
value = value.replace("%BASE_DIR%", basedir);
value = value.replace("%SERVER_URI%", famuri);
}
sbuffer.append(key).append("=")
.append(value).append(LogConstants.CRLF);
}
} catch (Exception e) {
debug.error("LogConfigReader: Could not read secure " +
"logger certificate store ", e);
}
copyConfigOption(sbuffer, LogConstants.LOGVERIFY_PERIODINSECONDS, logAttributes, "Log verify period");
copyConfigOption(sbuffer, LogConstants.LOGSIGN_PERIODINSECONDS, logAttributes, "Log sign period");
copyConfigOption(sbuffer, LogConstants.FILE_READ_HANDLER, logAttributes, "File read handler");
copyConfigOption(sbuffer, LogConstants.DB_READ_HANDLER, logAttributes, "DB read handler");
copyConfigOption(sbuffer, LogConstants.MAX_RECORDS, logAttributes, "Max records string");
copyConfigOption(sbuffer, LogConstants.FILES_PER_KEYSTORE, logAttributes, "Files per keystore");
copyConfigOption(sbuffer, LogConstants.TOKEN_PROVIDER, logAttributes, "Token provider class");
copyConfigOption(sbuffer, LogConstants.SECURE_TIMESTAMP_GENERATOR, logAttributes,
"Secure timestamp generator class");
copyConfigOption(sbuffer, LogConstants.VERIFIER_ACTION_CLASS, logAttributes, "Verifier action class");
copyConfigOption(sbuffer, LogConstants.FILTER_CLASS_NAME, logAttributes, "Filter class");
copyConfigOption(sbuffer, LogConstants.DEBUG_IMPL_CLASS, logAttributes, "Debug impl class");
copyConfigOption(sbuffer, LogConstants.BUFFER_SIZE, logAttributes, "Buffer size");
copyConfigOption(sbuffer, LogConstants.DB_MEM_MAX_RECS, logAttributes, "Max DB mem buffer size");
copyConfigOption(sbuffer, LogConstants.BUFFER_TIME, logAttributes, "Buffer time");
copyConfigOption(sbuffer, LogConstants.TIME_BUFFERING_STATUS, logAttributes, "Time buffering status");
copyConfigOption(sbuffer, LogConstants.ORA_DBDATA_FIELDTYPE, logAttributes, "Oracle DB data type");
copyConfigOption(sbuffer, LogConstants.MYSQL_DBDATA_FIELDTYPE, logAttributes, "MySQL DB data type");
copyConfigOption(sbuffer, LogConstants.ORA_DBDATETIME_FORMAT, logAttributes, "Oracle DB date/time format");
copyConfigOption(sbuffer, LogConstants.MYSQL_DBDATETIME_FORMAT, logAttributes, "MySQL DB date/time format");
copyConfigOption(sbuffer, LogConstants.SYSLOG_PROTOCOL, logAttributes, "Syslog protocol");
copyConfigOption(sbuffer, LogConstants.SYSLOG_HOST, logAttributes, "Syslog host");
copyConfigOption(sbuffer, LogConstants.SYSLOG_PORT, logAttributes, "Syslog port");
copyConfigOption(sbuffer, LogConstants.SYSLOG_FACILITY, logAttributes, "Syslog facility");
copyConfigOption(sbuffer, LogConstants.SYSLOG_CONNECTION_TIMEOUT, logAttributes, "Syslog connection timeout");
// Log status from the logging config
try {
key = LogConstants.LOG_STATUS_ATTR;
value = CollectionHelper.getMapAttr(logAttributes, key);
if ((value == null) || (value.length() == 0)) {
debug.warning("LogConfigReader:reading from SystemProperties");
// try to read from AMConfig.properties
value = SystemProperties.get(LogConstants.LOG_STATUS);
if (debug.messageEnabled()) {
debug.message("####### SystemProperties logStatus is: " +
value);
}
if ((value == null) || (value.length() == 0)) {
value = "ACTIVE";
}
}
// "value" will have a value
sbuffer.append(key).append("=").append(value).
append(LogConstants.CRLF);
} catch(Exception e) {
debug.error("LogConfigReader:Could not read Log Status attribute");
}
copyConfigOption(sbuffer, LogConstants.LOGGING_LEVEL, logAttributes, "Logging level");
copyConfigOption(sbuffer, LogConstants.LOCALE, smsPlatformSchema.getAttributeDefaults(), "Locale string");
copyConfigOption(sbuffer, LogConstants.LOGGING_SERVICE_URL, smsNamingSchema.getAttributeDefaults(),
"Logging service URL");
// hostname resolution
try {
key = LogConstants.LOG_RESOLVE_HOSTNAME_ATTR;
value = CollectionHelper.getMapAttr(logAttributes, key);
if ((value == null) || (value.length() == 0)) {
debug.warning("LogConfigReader: " +
"Log Resolve Hostname attribute is null");
// try to read from AMConfig.properties
value =
SystemProperties.get(LogConstants.LOG_RESOLVE_HOSTNAME);
if (debug.messageEnabled()) {
debug.message(
"####### SystemProperties resolveHostName is: " +
value);
}
if ((value == null) || (value.length() == 0)) {
value = "false";
}
}
// "value" will have a value
sbuffer.append(key).append("=")
.append(value).append(LogConstants.CRLF);
} catch (Exception e) {
debug.error("LogConfigReader: could not get from DS", e);
}
return sbuffer.toString();
}
class LogHeaderComparator implements Comparator {
/**
* Compares two strings from the Log headers. Names should either be
* in the form ##:HeaderName or HeaderName, where ## is a two digit
* number. Instances with ##: preceding will go first, in ascending
* order according to the two digit number. If two of the same number
* appear they will be ordered according to the order of in which they
* were compared.
*
* @param o1 First object in comparison
* @param o2 Second object in comparison
* @return Returns positive if prefix for o2 is gt o1, otherwise negative
*/
public int compare(Object o1, Object o2) {
String s1 = (String) o1;
String s2 = (String) o2;
if (s1.contains(Constants.COLON) && s2.contains(Constants.COLON)) {
int s1v = Integer.parseInt(s1.substring(0, s1.indexOf(Constants.COLON)));
int s2v = Integer.parseInt(s2.substring(0, s2.indexOf(Constants.COLON)));
if (s1v < s2v) {
return 1;
} else {
return -1;
}
} else if (s1.contains(Constants.COLON)) {
return 1;
} else if (s2.contains(Constants.COLON)) {
return -1;
}
return -1;
}
public boolean equals(Object obj) {
return obj instanceof LogHeaderComparator;
}
}
private void getLoggingDirectory(
boolean fileBackend,
String basedir,
String famuri,
StringBuilder sbuffer
) {
String key = LogConstants.LOG_LOCATION;
String logDir = SystemProperties.get(LogConstants.SYS_PROP_LOG_DIR);
if ((logDir != null) && (logDir.trim().length() > 0)) {
logDir = logDir.replace('\\','/');
logDir += "/";
sbuffer.append(key).append("=")
.append(logDir).append(LogConstants.CRLF);
return;
}
/*
* log location subdirectory
* is specified in AMConfig.properties. read it here and append
* to log location, so only have to deal with it here.
*/
String locSubdir = null;
if (fileBackend) {
locSubdir = SystemProperties.get(LogConstants.LOG_LOCATION_SUBDIR);
if ((locSubdir != null) &&
(locSubdir.trim().length() > 0) &&
(!locSubdir.endsWith("/")))
{
locSubdir += "/";
}
}
String value = CollectionHelper.getMapAttr(logAttributes, key);
if ((value == null) || (value.length() ==0)) {
debug.warning("LogConfigReader: LogLocation string is null");
} else {
value = value.replace('\\','/');
if (value.contains("%BASE_DIR%") ||
value.contains("%SERVER_URI%"))
{
value = value.replace("%BASE_DIR%", basedir);
value = value.replace("%SERVER_URI%", famuri);
}
if (fileBackend && !value.endsWith("/")) {
value += "/";
}
if ((locSubdir != null) && (locSubdir.trim().length() > 0)) {
// locSubdir already ensured trailing slash, above
value += locSubdir;
}
sbuffer.append(key).append("=")
.append(value).append(LogConstants.CRLF);
}
}
/**
* This method is used to get the global schemas of Logging, Platform
* and Naming Services. Platform service schema is used to determine the
* platform locale, naming service is used to get the logging service url.
*/
private void getDefaultAttributes(SSOToken ssoToken)
throws SMSException, SSOException {
ServiceSchemaManager schemaManager =
new ServiceSchemaManager("iPlanetAMLoggingService", ssoToken);
smsLogSchema = schemaManager.getGlobalSchema();
if (!isRegisteredForDSEvents) {
schemaManager.addListener(this);
}
schemaManager =
new ServiceSchemaManager("iPlanetAMPlatformService", ssoToken);
if (!isRegisteredForDSEvents) {
schemaManager.addListener(this);
}
smsPlatformSchema = schemaManager.getGlobalSchema();
schemaManager =
new ServiceSchemaManager("iPlanetAMNamingService", ssoToken);
if (!isRegisteredForDSEvents) {
schemaManager.addListener(this);
isRegisteredForDSEvents = true;
}
smsNamingSchema = schemaManager.getGlobalSchema();
// get the default attributes of each service(Logging, Platform and
// Naming).
logAttributes = smsLogSchema.getAttributeDefaults();
platformAttributes = smsPlatformSchema.getAttributeDefaults();
namingAttributes = smsNamingSchema.getAttributeDefaults();
}
/**
* This method is used for gettting the SSOToken from the
* TokenManager using Principal and defaultOrg. Need to
* figure out a better method and/or to confirm
* whether the existing method is good enough.
* This method of obtaining token has problems in DSAME5.2 alpha(hanging)
* Written on 25/4/2002 for DSAME6.0
* @throws SMSException
* @throws SSOException
*/
private SSOToken getSSOToken() throws SSOException {
return (SSOToken) AccessController.doPrivileged(
AdminTokenAction.getInstance());
}
/**
* This method checks whether the logging service url is explicitly
* mentioned in the naming service. If yes then validates the URL against
* the platform server list of trusted servers. if the logging service
* url is not mentioned explicitly it sets the local flag to true.
*/
private void setLocalFlag() {
if (debug.messageEnabled()) {
debug.message("LogConfigReader: logserviceID is"
+ localLogServiceID);
}
try{
// can't do this here because NamingService is not
// dynamically updated.
// URL url = WebtopNaming.getServiceURL(LOGGING_SERVICE,
// protocol, host, port);
String urlString =
manager.getProperty(LogConstants.LOGGING_SERVICE_URL);
String logHost = null;
if (urlString.indexOf("%") == -1) {
logHost = urlString;
} else {
logHost = localLogServiceID;
}
if ((localLogServiceID) != null && (logHost != null)) {
if (logHost.startsWith(localLogServiceID))
{
LogManager.isLocal = true;
}
else {
LogManager.isLocal = false;
}
}
} catch (Exception e) {
debug.error("LogConfigReader: Error setting localFlag: ",e);
}
}
// following methods
// to implement ServiceListener
public void globalConfigChanged(
String servName,
String ver,
String frpName,
String servComp,
int type
) {
debug.message("Global config change");
}
public void organizationConfigChanged(
String servName,
String ver,
String orgName,
String grpName,
String servComp,
int type
) {
debug.message("Org config change");
}
public void schemaChanged(String servName,String ver) {
if (debug.messageEnabled()) {
debug.message("LogService schemaChanged(): ver = " + ver);
}
/*
* if logging config has been read before (i.e., eliminating
* the case where logging status is inactive on startup),
* then if logging status goes from active to inactive,
* force a write of a record (to each active log file)
* indicating the change. can't really do it in LogManager,
* as the java.util.LogManager (below) has already set
* the logging status to inactive, and no more records will
* get written out.
*/
manager =
(com.sun.identity.log.LogManager) LogManagerUtil.getLogManager();
if (manager.getDidFirstReadConfig() &&
manager.getLoggingStatusIsActive() &&
newStatusIsInactive())
{
manager.logStopLogs();
}
//shifting to LogManager according to review.
try{
manager.readConfiguration();
} catch (Exception e) {
debug.error("Error in readConfiguration()",e);
}
}
private boolean newStatusIsInactive() {
SSOToken ssoToken;
try {
ssoToken = getSSOToken();
} catch (SSOException ssoe) {
debug.error("LogConfigReader:newStatusIsInactive:" +
"Could not get proper SSOToken", ssoe);
return false;
}
try {
ServiceSchemaManager schemaManager =
new ServiceSchemaManager("iPlanetAMLoggingService", ssoToken);
ServiceSchema smsLogSchema = schemaManager.getGlobalSchema();
Map sss = smsLogSchema.getAttributeDefaults();
String key = LogConstants.LOG_STATUS_ATTR;
String value = CollectionHelper.getMapAttr(sss, key);
if ((value == null) || (value.length() == 0)) {
value = "ACTIVE";
}
return (value.equalsIgnoreCase("INACTIVE"));
} catch(Exception e) {
debug.error("LogConfigReader:newStatusIsInactive:" +
"error reading Log Status attribute: " + e.getMessage());
}
return false;
}
}