How to enable logging when query run custom code?

I am testing some custom aggregation extension and get this error stack trace where I don’t get any of my classes to look at, only some libraries which are being used and I wanted to ask if there is a way I can do some logging in my custom code which to see the code execution flow when I run some query to hopefully track down the source?

Caused by: org.apache.druid.query.QueryInterruptedException: java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.nio.BufferOverflowException

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_242]

at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:1.8.0_242]

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.8.0_242]

at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[?:1.8.0_242]

at com.fasterxml.jackson.databind.introspect.AnnotatedConstructor.call(AnnotatedConstructor.java:125) ~[jackson-databind-2.6.7.jar:2.6.7]

at com.fasterxml.jackson.databind.deser.std.StdValueInstantiator.createFromObjectWith(StdValueInstantiator.java:227) ~[jackson-databind-2.6.7.jar:2.6.7]

at com.fasterxml.jackson.databind.deser.impl.PropertyBasedCreator.build(PropertyBasedCreator.java:135) ~[jackson-databind-2.6.7.jar:2.6.7]

at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeUsingPropertyBased(BeanDeserializer.java:383) ~[jackson-databind-2.6.7.jar:2.6.7]

at com.fasterxml.jackson.databind.deser.std.ThrowableDeserializer.deserializeFromObject(ThrowableDeserializer.java:66) ~[jackson-databind-2.6.7.jar:2.6.7]

at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:133) ~[jackson-databind-2.6.7.jar:2.6.7]

at com.fasterxml.jackson.databind.ObjectMapper._readValue(ObjectMapper.java:3708) ~[jackson-databind-2.6.7.jar:2.6.7]

at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2005) ~[jackson-databind-2.6.7.jar:2.6.7]

at org.apache.druid.client.JsonParserIterator.init(JsonParserIterator.java:140) ~[druid-server-0.15.1-incubating.jar:0.15.1-incubating]

… 90 more

``