Enabling API and web services logs
Use this information to configure logging information about APIs and CMDB Web Services.
To enable CMDB API logging
As an Application Developer, you can enable log for BMC Helix CMDB Java API processing and set the logging parameters by using the following sample appender-code in the <log4j2.xml> configuration file of your custom applications:
<Configuration>
<Appenders>
<Console name="Console" target="SYSTEM_OUT">
<PatternLayout
pattern="%d %-5p [%t] %C (%F:%L) - %m%n" />
</Console>
<!-- Appender for CMDB API -->
<RollingFile name="cmdbAPIAppender" fileName="cmdbAPILog.log"
filePattern="cmdbAPILog-%i.log">
<PatternLayout
pattern="%d{MMM dd yyyy HH:mm:ss.SSS} %-5p [%t] (%27F:%-5L) - %m%n" />
<Policies>
<SizeBasedTriggeringPolicy size="5 MB" />
</Policies>
<!-- Keep ten backup file -->
<DefaultRolloverStrategy max="10" />
</RollingFile>
</Appenders>
<Loggers>
<!-- Logger for CMDB API -->
<!-- Print only messages of level warn in the package com.bmc.cmdb -->
<logger name="com.bmc.cmdb.api" level="warn"
additivity="false">
<AppenderRef ref="cmdbAPIAppender" />
</logger>
</Loggers>
</Configuration>
In this case, the generated logs, <cmdbAPIlog.log>, are saved in the specified directory along with the application log file. For more information about log4j2 configuration, see the Apache online documentation.
The BMC Helix CMDB Java API classifies the messages into error
, warning
, info
, and debug
categories. The logging levels are inclusive of their preceding levels. For example, if you set the debug level to 3, you receive log messages for levels 1, 2, and 3. For entry level log details, see Contents of the logs. To change the logging level for Java API, set the value
element with the appropriate setting for the com.bmc.cmdb.api
logging component.
If the server response time is slow when you execute your Java program, you can modify the timeout properties in the cmdbapi_sample.properties Java API configuration file. For more information about troubleshooting this issue, see Java API configuration properties.
To set logging levels for CMDB Web Services
You can use the atrium_serviceconfig service to configure logging level for the deprecated cmdbws and the CMDB Web Services. These levels determine the types of messages that BMC Helix CMDB logs for each web service call. The default logging level is set to WARN. You can change this logging level to INFO, ERROR, DEBUG, and TRACE.
To set logging levels for deprecated cmdbws, use the bmc.cmdbws.log.level property.
The settings for these properties are stored in <BMCAtriumCoreInstallationDirectory>\wsc\cmdbws directory\cmdbws.properties. For more information about the bmc.cmdbws.log.level
property, see CMDBWS and WS-Security.
Use the SetProperties web services function to change the log level. See SetProperties function.
To set logging levels for all other CMDB Web Services, use the bmc.atrium.log.level
property.
The settings for these properties are stored in <ATRIUMCORE_HOME>/wsc/atriumws<currentAtriumVersion>/conf/AtriumProperties.xml. For more information about the bmc.atrium.log.level
property, see Modifying the web services configuration.
Use the SetProperties web services function to change the log level. See SetProperties function.
Comments
Log in or register to comment.