You'd need to subclass RequestLogFactory to give it additional logic to handle this. Here's the default subclass of RequestLogFactory used in Dropwizard (LogbackAccessRequestLogFactory):
https://github.com/dropwizard/dropwizard/blob/49ea3ed32b01c3990f00a878d665f2cbf384d00f/dropwizard-request-logging/src/main/java/io/dropwizard/request/logging/LogbackAccessRequestLogFactory.java It might be sufficient to use LogbackAccessRequestLogFactory but provide your own AppenderFactory implementation: https://github.com/dropwizard/dropwizard/blob/49ea3ed32b01c3990f00a878d665f2cbf384d00f/dropwizard-logging/src/main/java/io/dropwizard/logging/AppenderFactory.java But I don't think the functionality you're looking for is pre-built anywhere. Ryan On Wed, Jun 15, 2016 at 7:31 AM, Voruganti Madhukar < [email protected]> wrote: > How to log the messages to different files based on some condition in an > application and not based on the log level. > > For e.g: > > I have sent a request to application in the logs it will print response > code, headers and etc. But based on some condition headers should print to > another log file not to the regular log file. > > -- > You received this message because you are subscribed to the Google Groups > "dropwizard-user" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "dropwizard-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
