Enabling the Content Services GraphQL API trace log

You can set the logging levels and the output file for tracing operations for GraphQL API on the Liberty profile application server.

About this task

When you try to diagnose problems for GraphQL API, it is important to be able to see the log messages. To print readable log messages in log files, you must specify the applicable settings.

Procedure

To enable logging for GraphQL API:

In the GraphQL configuration store configDropins/overrides directory, create a file called liberty-logging.xml, with the following contents:
	<server>
		<logging  traceSpecification="com.ibm.ecm.content.graphql.*=finest:com.ibm.ecm.content.graphql.resolvers.*=finest"
		traceFileName="trace.log"
		maxFileSize="20"
		maxFiles="10"
		traceFormat="BASIC" />
	</server>

Notes:

The *=finest setting is equivalent to ALL.

The trace.log file is only created if additional or detailed trace is enabled.

If the logging level is info/audit/warning/severe/fatal, information is logged into message.log and trace.log is not created.

If the logging level is config/detail/fine/finer/finest/all, information is logged into trace.log and the trace.log file is created.

For more details, see Liberty profile: Logging and Trace.