How to find the full name of a Java class in the DropWizard logs
We are using DropWizard in a Java based microservice. In the logs, we have lines like:
[dw-1000 - POST myservice/endpoint] c.s.x.m.s.c.p2p - my error message
My question is, how can I find out the fully qualified path names of the Java class presented as "csxmscp2p" in the above log message?
Thank.
+3
source to share
1 answer
You need to change the default configuration in yaml: logFormat is the key to your solution.% C displays the full name of the logger, and if no number is specified, it is the full name without names:
logging:
appenders:
- type: file
...
logFormat: '[%d{yyyy-MM-dd HH:mm:ss.SSS}] [%-5level] [%c] [%thread] [-[%msg]-] %n'
+2
source to share