How to get the jetty server instance or log the jetty requests in a file?

664 views
Skip to first unread message

Dheerendra Rathor

unread,
May 22, 2014, 4:31:13 AM5/22/14
to dropwiz...@googlegroups.com
Is there any way to get the jetty server instance so that I can handle all the jetty requests and can log them manually in a file? or there is any other method to log requests to file in dropwizard?

Jochen Schalanda

unread,
May 22, 2014, 4:51:01 AM5/22/14
to dropwiz...@googlegroups.com
Hi,

as of Dropwizard 0.7.0 you can simply attach a File appender [1,2] to
the Jetty request log [3]:

Example:

> # Your application configuration
> server:
> requestLog:
> appenders:
> - type: file
> currentLogFilename: /var/log/requests.log


[1]:
https://dropwizard.github.io/dropwizard/0.7.0/docs/manual/core.html#file-logging
[2]:
https://dropwizard.github.io/dropwizard/0.7.0/docs/manual/configuration.html#file
[3]:
https://dropwizard.github.io/dropwizard/0.7.0/docs/manual/configuration.html#request-log


Cheers,
Jochen
> --
> 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 dropwizard-us...@googlegroups.com
> <mailto:dropwizard-us...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages