Dropwizard
использует logback
и slf4j
.Я не могу найти ссылки на то, что logback
напрямую поддерживает инструкции по настройке log4j
.
Теперь по вопросу: у меня есть игрушечный проект Dropwizard, использующий в настоящее время версию 1.3.4.Я настраиваю простой метод ресурсов для выполнения GET
по внешнему HTTP-адресу.В файле config.yml
у меня есть следующее:
logging:
# level: INFO
level: DEBUG
loggers:
com.gitlab.zloster: DEBUG
Эта конфигурация дает мне очень подробное ведение журнала DEBUG
для всего:
DEBUG [2019-04-30 14:30:27,035] org.apache.http.client.protocol.RequestAddCookies: CookieSpec selected: ignoreCookies
DEBUG [2019-04-30 14:30:27,035] org.apache.http.client.protocol.RequestAuthCache: Auth cache not set in the context
DEBUG [2019-04-30 14:30:27,035] com.codahale.metrics.httpclient.InstrumentedHttpClientConnectionManager: Connection request: [route: {s}->https://www.dir.bg:443][total kept alive: 0; route allocated: 0 of 1024; total allocated: 1 of 1024]
DEBUG [2019-04-30 14:30:27,035] com.codahale.metrics.httpclient.InstrumentedHttpClientConnectionManager: Connection leased: [id: 2][route: {s}->https://www.dir.bg:443][total kept alive: 0; route allocated: 1 of 1024; total allocated: 2 of 1024]
DEBUG [2019-04-30 14:30:27,035] org.apache.http.impl.execchain.MainClientExec: Opening connection {s}->https://www.dir.bg:443
DEBUG [2019-04-30 14:30:27,039] org.apache.http.impl.conn.DefaultHttpClientConnectionOperator: Connecting to www.dir.bg/194.145.63.12:443
DEBUG [2019-04-30 14:30:27,039] org.apache.http.conn.ssl.SSLConnectionSocketFactory: Connecting socket to www.dir.bg/194.145.63.12:443 with timeout 500
DEBUG [2019-04-30 14:30:27,053] org.apache.http.conn.ssl.SSLConnectionSocketFactory: Enabled protocols: [TLSv1, TLSv1.1, TLSv1.2]
DEBUG [2019-04-30 14:30:27,053] org.apache.http.conn.ssl.SSLConnectionSocketFactory: Enabled cipher suites:[TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384, TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384, TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384, TLS_DHE_RSA_WITH_AES_256_CBC_SHA256, TLS_DHE_DSS_WITH_AES_256_CBC_SHA256, TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_256_CBC_SHA, TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDH_RSA_WITH_AES_256_CBC_SHA, TLS_DHE_RSA_WITH_AES_256_CBC_SHA, TLS_DHE_DSS_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256, TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256, TLS_DHE_RSA_WITH_AES_128_CBC_SHA256, TLS_DHE_DSS_WITH_AES_128_CBC_SHA256, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA, TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDH_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_DSS_WITH_AES_128_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, TLS_RSA_WITH_AES_256_GCM_SHA384, TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384, TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384, TLS_DHE_RSA_WITH_AES_256_GCM_SHA384, TLS_DHE_DSS_WITH_AES_256_GCM_SHA384, TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256, TLS_DHE_RSA_WITH_AES_128_GCM_SHA256, TLS_DHE_DSS_WITH_AES_128_GCM_SHA256, TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA, TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA, SSL_RSA_WITH_3DES_EDE_CBC_SHA, TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA, TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA, SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA, SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA, TLS_EMPTY_RENEGOTIATION_INFO_SCSV]
DEBUG [2019-04-30 14:30:27,053] org.apache.http.conn.ssl.SSLConnectionSocketFactory: Starting handshake
DEBUG [2019-04-30 14:30:27,060] org.apache.http.conn.ssl.SSLConnectionSocketFactory: Secure session established
DEBUG [2019-04-30 14:30:27,060] org.apache.http.conn.ssl.SSLConnectionSocketFactory: negotiated protocol: TLSv1.2
DEBUG [2019-04-30 14:30:27,060] org.apache.http.conn.ssl.SSLConnectionSocketFactory: negotiated cipher suite: TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
DEBUG [2019-04-30 14:30:27,060] org.apache.http.conn.ssl.SSLConnectionSocketFactory: peer principal: CN=*.dir.bg, OU=PositiveSSL Wildcard, OU=Domain Control Validated
Если я изменю конфигурацию на:
logging:
level: INFO
# level: DEBUG
loggers:
com.gitlab.zloster: DEBUG
Я получаю очень чистый журнал:
INFO [2019-04-30 14:44:30,742] org.eclipse.jetty.setuid.SetUIDListener: Opened application@44fff386{HTTP/1.1,[http/1.1]}{0.0.0.0:8080}
INFO [2019-04-30 14:44:30,745] org.eclipse.jetty.server.Server: jetty-9.4.z-SNAPSHOT; built: 2018-05-03T15:56:21.710Z; git: daa59876e6f384329b122929e70a80934569428c; jvm 1.8.0_111-8u111-b14-3~12.04-b14
INFO [2019-04-30 14:44:31,391] io.dropwizard.jersey.DropwizardResourceConfig: The following paths were found for the configured resources:
GET /external (com.gitlab.zloster.resources.ExternalResource)
GET /moment (com.gitlab.zloster.resources.MomentResource)
GET /validate (com.gitlab.zloster.resources.ValidationResource)
POST /validate (com.gitlab.zloster.resources.ValidationResource)
INFO [2019-04-30 14:44:31,395] org.eclipse.jetty.server.handler.ContextHandler: Started i.d.j.MutableServletContextHandler@44598ef7{/,null,AVAILABLE}
INFO [2019-04-30 14:44:31,413] org.eclipse.jetty.server.AbstractConnector: Started application@44fff386{HTTP/1.1,[http/1.1]}{0.0.0.0:8080}
INFO [2019-04-30 14:44:31,414] org.eclipse.jetty.server.Server: Started @2757ms
127.0.0.1 - - [30/Apr/2019:14:44:38 +0000] "GET /external HTTP/1.1" 200 65 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0" 368
127.0.0.1 - - [30/Apr/2019:14:44:40 +0000] "GET /external HTTP/1.1" 200 65 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0" 54
127.0.0.1 - - [30/Apr/2019:14:44:46 +0000] "GET /external HTTP/1.1" 200 65 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0" 63
Код здесь: https://gitlab.com/zloster/dropwizard-static/commit/16c3dba9ea46f1223d84f975779aec4876bf4507