Setting up logging against Postgresql Driver
App Development2 posts325 views1 likesLast activity Jan 2022
LE
Leonid_RozenbergOP
Jan 2022The 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.
- Can we use the same arguments against the Postgresql driver? What should we do if running against an Enterprise docker image?
- Is there an example xml file that one can use as a template, to see the list of available loggers?
- Does Canton use a similar mechanism to control logging?
CO
cocreature
Jan 2022- 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"todocker 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:containerdiror alternative build your own image based on the EE daml on sql image. - 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. - Canton is also based on logback. You can find more details in the documentation.