Help with log4j netty configuration in sandbox

I’m trying to set up TLS on the sandbox, and as per the suggestion in our documentation, I would like to enable logging in Netty to debug the connection.

I’ve followed the instructions in the log4j documentation, and created a config file log4j2.xml in the root directory of my application, like this:

<?xml version="1.0" encoding="UTF-8"?>;
    <Logger name="io.netty" level="debug">
      <AppenderRef ref="Console"/>

I’ve tried some different combinations of this. But I get a feeling the file isn’t being read by canton at all, when I run daml start. Can someone help me?

As per @Remy 's comment here, I’ve enabled DEBUG at the root level on the command line, and I can see error messages such as:

2023-03-16 09:54:37,958 [grpc-nio-worker-ELG-3-5] DEBUG io.grpc.netty.NettyServerHandler 

So perhaps It’s just the logger name that is incorrect (i.e. io.grpc.netty instead of io.netty) [edit: no, that didn’t help]

Canton uses Slf4j and Logback, not Log4j, so I don’t think you can use that to configure the logging. If you want to point at a custom configuration file this post might come in handy.

Alternatively you can (temporarily) touch up the logging configuration files store in the $HOME/.daml directory.