use of alma.acs.logging.AcsLogger in project ACS by ACS-Community.
the class ComponentClientTestCase method setUp.
/**
* Starts CORBA in the client process and connects to the manager and logger.
* <p>
* <b>Subclasses that override this method must call <code>super.setUp()</code>,
* likely before any other code in that method.</b>
*
* @see junit.framework.TestCase#setUp()
*/
protected void setUp() throws Exception {
m_logger = ClientLogManager.getAcsLogManager().getLoggerForApplication(getFullName(), true);
m_logger.info("-------------------------------");
m_logger.info("ComponentClientTestCase#setUp()");
POA rootPOA = null;
try {
acsCorba = new AcsCorba(m_logger);
rootPOA = acsCorba.initCorbaForClient(false);
connectToManager();
DAL cdb = DALHelper.narrow(m_acsManagerProxy.get_service("CDB", false));
m_threadFactory = new CleaningDaemonThreadFactory(m_namePrefix, m_logger);
m_containerServices = new ContainerServicesImpl(m_acsManagerProxy, cdb, rootPOA, acsCorba, m_logger, m_acsManagerProxy.getManagerHandle(), this.getClass().getName(), null, m_threadFactory) {
public AcsLogger getLogger() {
return m_logger;
}
};
managerClientImpl.setContainerServices(m_containerServices);
initRemoteLogging();
ACSAlarmSystemInterfaceFactory.init(m_containerServices);
} catch (Exception ex1) {
m_logger.log(Level.SEVERE, "failed to initialize the ORB, or connect to the ACS Manager, " + "or to set up the container services.", ex1);
if (acsCorba != null) {
try {
acsCorba.shutdownORB(true, false);
acsCorba.doneCorba();
} catch (Exception ex2) {
// to JUnit we want to forward the original exception ex1,
// not any other exception from cleaning up the orb
// which we would not have done without the first exception.
// Thus we simply print ex2 but let ex1 fly
ex2.printStackTrace();
}
}
throw ex1;
}
}
use of alma.acs.logging.AcsLogger in project ACS by ACS-Community.
the class MiscUtils method getPackageLogger.
/**
* Returns a logger for the specified class, based on
* the requester's package name, e.g. "alma.acs.commandcenter.engine",
* thus the logger will be shared by all classes in that package.
*
* @param requester class which needs a package-wide logger
* @return a logger
*/
public static AcsLogger getPackageLogger(Class<?> requester) {
String pkg = requester.getPackage().getName();
AcsLogger ret = ClientLogManager.getAcsLogManager().getLoggerForApplication(pkg, false);
return ret;
}
use of alma.acs.logging.AcsLogger in project ACS by ACS-Community.
the class HibernateLoggerHelper method getLogger.
/**
* @see ACSLoggerFactory#getLogger(String)
*/
public Logger getLogger(String name) {
if (name.equals("org.hibernate.SQL") || // there is an inconsistency in hibernate's parameter logging, where first "org.hibernate.type" is checked in NullableType#IS_VALUE_TRACING_ENABLED, but later loggers "org.hibernate.type.XYZ" get used.
name.startsWith("org.hibernate.type") || name.equals("org.hibernate.jdbc.util.SQLStatementLogger")) {
if (jdkAdapterSql == null) {
AcsLogger acsLoggerDelegateSql = ClientLogManager.getAcsLogManager().getLoggerForCorba(HIBERNATE_SQL_LOGGER_NAME_PREFIX, true);
acsLoggerDelegateSql.addLoggerClass(JDK14LoggerAdapter.class);
jdkAdapterSql = new JDK14LoggerAdapter(acsLoggerDelegateSql);
}
return jdkAdapterSql;
} else {
if (jdkAdapterDefault == null) {
AcsLogger acsLoggerDelegateDefault = ClientLogManager.getAcsLogManager().getLoggerForCorba(HIBERNATE_LOGGER_NAME_PREFIX, true);
acsLoggerDelegateDefault.addLoggerClass(JDK14LoggerAdapter.class);
jdkAdapterDefault = new JDK14LoggerAdapter(acsLoggerDelegateDefault);
}
return jdkAdapterDefault;
}
}
use of alma.acs.logging.AcsLogger in project ACS by ACS-Community.
the class TypelessPropertyImpl method publish_now.
/**
* @see alma.ACS.TypelessPropertyOperations#publish_now()
*/
public void publish_now() {
AcsLogger logger = parentComponent.getComponentContainerServices().getLogger();
logger.warning("IDL method publish_now not yet implemented");
}
use of alma.acs.logging.AcsLogger in project ACS by ACS-Community.
the class AcsContainer method get_statistics_logger_configuration_byname.
/**
* Gets the names and status of statistics module of requested logger.
* If the logger statistics module has never been configured yet, then it will provide "Undefined"
* as elementName
* Throws LoggerDoesNotExistEx if a the logger is not found
*/
public LogStatsInformation get_statistics_logger_configuration_byname(String logger_name) throws alma.Logging.LoggerDoesNotExistEx {
// Retrieve logger by logger name
AcsLogger retrievedLogger = ClientLogManager.getAcsLogManager().getLoggerByName(logger_name);
// Verification if logger does exist (!= null)
if (retrievedLogger == null) {
LoggerDoesNotExistEx inexistantLoggerEx = new LoggerDoesNotExistEx(logger_name);
throw inexistantLoggerEx;
}
// Store logger statistics configuration
LogStatsInformation statsInfo = new LogStatsInformation(retrievedLogger.stats.getStatisticsIdentification(), retrievedLogger.getName(), retrievedLogger.stats.getDisableStatistics(), retrievedLogger.stats.getStatisticsCalculationPeriod(), retrievedLogger.stats.getStatisticsGranularity());
return statsInfo;
}
Aggregations