Setting up logging against Postgresql Driver

The Daml driver for Postgresql documents that it uses logback to control logging and @Gary_Verhaegen documents how you can control logging against the sandbox here.

  1. Can we use the same arguments against the Postgresql driver? What should we do if running against an Enterprise docker image?
  2. Is there an example xml file that one can use as a template, to see the list of available loggers?
  3. Does Canton use a similar mechanism to control logging?
  1. The easiest option is probably to set a custom logback file via environment variables. Specifically you can pass -e "JAVA_TOOL_OPTIONS=-Dlogback.configurationFile=path/to/logback.xml" to docker run. If things don’t work you can enable logback’s debug flag which will show which config files it searched for -e "JAVA_TOOL_OPTIONS=-Dlogback.configurationFile=path/to/logback.xml -Dlogback.debug=true". The path here will point inside the container. You can either mount a logback file from the docker host via -v hostdir:containerdir or alternative build your own image based on the EE daml on sql image.
  2. I’d recommend starting with the logback file that is included in the daml on sql JAR by default. You can extract it with unzip daml-on-sql.jar logback.xml.
  3. Canton is also based on logback. You can find more details in the documentation.
1 Like