Looking at the source code for dropwizard I can see that there is custom glue code to read the .yml file and set up logging.
I want my own custom log file, but I'd like to use the rotation and compression that already exists in dropwizard.
Is there a way, short of cloning the code to do this?
https://github.com/dropwizard/dropwizard/tree/master/dropwizard-logging/src/main/java/io/dropwizard/logging
Specifically it looks like need to create my own class which inherits from io.dropwizard.FileAppenderFactory
Or am I attacking this problem from the wrong angle?
There is a way but you need to change the dropwizard source and recompile it again if you are using the lib.In the Application class of dropwizard that you are extending there is static block like blow,just comment the lines and use your own logback.xml file.It really is a pain in the ....
static {
// make sure spinning up Hibernate Validator doesn't yell at us
LoggingFactory.bootstrap();
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With