th3morg th3morg - 2 years ago 240
Java Question

How do I log SQL Statements in Dropwizard

How do I turn on SQL query logging for a Dropwizard application? I would like it to only log SQL in certain environments.

Answer Source

In your application YAML file add a "logging:" definition like the following:

# Logging settings.

  # The default level of all loggers. Can be OFF, ERROR, WARN, INFO, DEBUG, TRACE, or ALL.
  level: INFO

   # Logger-specific levels.

      # Overrides the levels of certain packages or files.
      "org.skife.jdbi.v2": TRACE 
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download