Java Clients
Logging Java Connection Factory ActivityIf you connect using the PlatformConnectionFactory class, logging is handled by the Logging Service component of SAS Foundation Services. The logging context for a Java Connection Factory is "com.sas.services.connection". For more information about the Logging Service, see Modifying the Logging Service Configuration in the SAS Integration Technologies: Administrator's Guide and com.sas.services.logging in the Foundation Services class documentation. If you are connecting using the ConnectionFactory class, logging is handled by the Note: The following sections apply to the ConnectionFactory class only. Changing the Message LevelTo change the types of messages that are logged, create a Logger object using the The following code fragment specifies that detailed tracing messages should be logged in addition to the default messages: import java.util.logging.*; ConnectionFactoryManager cxfManager = new ConnectionFactoryManager(); ConnectionFactoryConfiguration cxfConfig = ... String loggerName = cxfManager.getFactoryLoggerName(cxfConfig); Logger logger = Logger.getLogger(loggerName); logger.setLevel(Level.FINEST); The following code fragment specifies that no messages are logged: import java.util.logging.*; ConnectionFactoryManager cxfManager = new ConnectionFactoryManager(); ConnectionFactoryConfiguration cxfConfig = ... String loggerName = cxfManager.getFactoryLoggerName(cxfConfig); Logger logger = Logger.getLogger(loggerName); logger.setLevel(Level.OFF); Logging to a FileTo log messages to a file, create a FileHandler object using the constructor method in The following code fragment specifies that verbose messages are logged to a file and console logging is disabled: import java.util.logging; ConnectionFactoryManager cxfManager = new ConnectionFactoryManager(); ConnectionFactoryConfiguration cxfConfig = ... String loggerName = cfxManager.getFactoryLoggerName(cxfConfig); Logger logger = Logger.getLogger(loggerName); logger.setLevel(Level.FINEST); FileHandler handler = new FileHandler("file-path"); handler.setLevel(Level.FINEST); logger.addHandler(handler); logger.setUseParentHandlers(false); Note: If you do not specify |