3

log4j2.xml has AsyncLogger name="org.mule.module.db" level="INFO" but i am not seeing the parameterized query in the logs. I have log4j2.xml under /src/main/resources. I am using parameterized query to perform update operation on sql server. I would like to see the queries which are constructed during runtime in the logs.

user94538
  • 177
  • 5
  • 24

1 Answers1

1

In order to log the SQL statement being executed by Mule, you need to add the following log4j configuration.

For the new DB module:

log4j.logger.org.mule.module.db=DEBUG

For the old JDBC transport:

log4j.logger.com.mulesoft.mule.transport.jdbc=DEBUG

see https://support.mulesoft.com/s/article/ka4340000004GWgAAM/Logging-the-SQL-statements-in-Mule See https://www.mulesoft.org/jira/browse/MULE-7371

  • I am using log4j2.xml and already has AsyncLogger name="org.mule.module.db" level="INFO" in the log4j2.xml. log4j.logger.org.mule.module.db=DEBUG is for log4j.xml. – user94538 Feb 27 '17 at 22:10
  • Have you tried setting AsyncLogger name="org.mule.module.db" level="DEBUG" Secondly have checked the class path to see which log4j2.xml is being picked up, I found this blog useful interms of child first pattern http://blogs.mulesoft.com/dev/mule-dev/mule-3-6-asynchronous-logging/ – George Jeffcock Mar 01 '17 at 20:13
  • Also search google for ""-M-Dlog4j.debug=true" and you will find help how to track which log4j2 is being picked up so you can be sure your changes are being respected at runtime – George Jeffcock Mar 01 '17 at 20:33