Versiones comparadas

Clave

  • Se ha añadido esta línea.
  • Se ha eliminado esta línea.
  • El formato se ha cambiado.

En ciertas ocasiones, al desarrollar una nueva comunicación entre APIs, es útil poder hacer logging de las peticiones y respuestas que se realizan desde un cliente REST.

En esta página se enumeran algunas alternativas para pintar esta información en el log de nuestra aplicación en Spring-Boot.

Guía detallada

A continuación se detallan las distintas configuraciones que permiten realizar el logging de peticiones y respuestas en clientes REST.

1. Logging básico con RestTemplate

Es muy fácil de configurar pero proporciona poca información:

  • No aparecen las cabeceras
  • No aparece el body de la respuesta.


Configuración: 

Añadir en el fichero application.properties:

Bloque de código
##Configuración RestTemplate para logging básico de request y response en clientes
logging.level.org.springframework.web.client.RestTemplate=DEBUG


Cliente con RestTemplate:

Guía detallada

Loggin básico con RestTemplate

...

Bloque de código
languagejava

	final RestTemplate plantilla = new RestTemplate();
	final HttpHeaders headers = new HttpHeaders();
	headers.set( "

...

Cabecera-test", "

...

Valor de test" );
	headers.set( "

...

Cabecera-

...

test2", "

...

Valor de test 2" );
	final HttpEntity<String> entity = new HttpEntity<>( "

...

Body de test", headers );

	final String url = "https://

...

fundewebjsshowcasedesa.um.es/

...

api/v1.0/

...

public/test/CS";

	final ResponseEntity<String> response = plantilla.exchange( url, HttpMethod.GET, entity, String.class );


Ejemplo de log de petición:

Bloque de código
languagexml
13-05-2021 13:25:44.165 DEBUG 12864 --- [nio-8080-exec-1] o.s.w.c.RestTemplate                     : HTTP GET https://

...

fundewebjsshowcasedesa.um.es/

...

api/v1.0/

...

public/test/CS
13-05-2021 13:25:44.166 DEBUG 12864 --- [nio-8080-exec-1] o.s.w.c.RestTemplate                     : Accept=[text/plain, application/json, application/*+json, */*]
13-05-2021 13:25:44.166 DEBUG 12864 --- [nio-8080-exec-1] o.s.w.c.RestTemplate                     : Writing [

...

Body de test] with org.springframework.http.converter.StringHttpMessageConverter
13-05-2021 13:25:44.197 DEBUG 12864 --- [nio-8080-exec-1] o.s.w.c.RestTemplate                     : Response 200 OK
13-05-2021 13:25:44.197 DEBUG 12864 --- [nio-8080-exec-1] o.s.w.c.RestTemplate                     : Reading to [java.lang.String] as "application/json"

Bloque de código
languagexml
	<dependency>
	    <groupId>org.apache.httpcomponents</groupId>
	    <artifactId>httpclient</artifactId>
	</dependency>

...



2. Logging completo con Apache HttpComponents.

Como puede observarse, el log pintado con el método anterior es bastante escueto y no proporciona demasiada información. En concreto, sería interesante que pintara el body de la respuesta. 
Con este segundo método la información pintada es mucho más completa (incluso excesiva).


Configuración: 

  • Añadir en el fichero pom.xml la dependencia:
Bloque de código
languagejfx
final RestTemplate plantilla = new RestTemplate();
plantilla.setRequestFactory( new HttpComponentsClientHttpRequestFactory() );
xml
	<dependency>
	    <groupId>org.apache.httpcomponents</groupId>
	    <artifactId>httpclient</artifactId>
	</dependency>
  • Añadir en el fichero application.properties:
Bloque de código
logging.level.org.apache.http=DEBUG
logging.level.org.apache.http.wire=DEBUG


Cliente con RestTemplate:

Bloque de código
languagejfx
final RestTemplate plantilla = new RestTemplate();
plantilla.setRequestFactory( new HttpComponentsClientHttpRequestFactory() );  //Configuración Apache HttpClient 

final HttpHeaders headers = new HttpHeaders();
headers.set( "Cabecera-test", "Valor de test" );
headers.set( "Cabecera-test2", "Valor de test 2" );
final HttpEntity<String> entity = new HttpEntity<>( "Body de test", headers );

final String url = "https://fundewebjsshowcasedesa.um.es/api/v1.0/public/test/u";

final ResponseEntity re = plantilla.exchange( url, HttpMethod.GET, entity, String.class );


Ejemplo de log de petición:

En esta petición se ha forzado que el endpoint al que llama el cliente devuelva un error 401 para poder distinguir mejor el body de la respuesta.

info
Bloque de código
languagexml
------------------------------------------ Log de la petición
21-10-2021 09:05:45.064 DEBUG 2104 --- [http-
Bloque de código
languagexml
13-05-2021 13:55:12.690 DEBUG 12864 --- [nio-8080-exec-4] o.a.h.c.p.RequestAddCookies              : CookieSpec selected: default
13-05-2021 13:55:12.690 DEBUG 12864 --- [nio-8080-exec-4] o.a.h.c.p.RequestAuthCache               : Auth cache not set in the context
13-05-2021 13:55:12.690 DEBUG 12864 --- [nio-8080-exec-4] h.i.c.PoolingHttpClientConnectionManager : Connection request: [route: {s}->https://micampusdesa.um.es:443][total available: 0; route allocated: 0 of 5; total allocated: 0 of 10]
13-05-2021 13:55:12.690 DEBUG 12864 --- [nio-8080-exec-4] o.a.h.ic.cp.PoolingHttpClientConnectionManagerRequestAddCookies   : Connection leased: [id: 7][route: {s}->https://micampusdesa.um.es:443][total available: 0; route allocated: 1 of: 5; total allocated: 1 of 10]
13-05CookieSpec selected: default
21-10-2021 1309:5505:1245.690069 DEBUG 128642104 --- [http-nio-8080-exec-4] o.a.h.ic.ep.MainClientExecRequestAuthCache               : Auth cache not :set Openingin connection {s}->https://micampusdesa.um.es:443
13-05-2021 13:55:12.690 DEBUG 12864the context
21-10-2021 09:05:45.072 DEBUG 2104 --- [http-nio-8080-exec-4] h.i.c.DefaultHttpClientConnectionOperatorPoolingHttpClientConnectionManager : Connection Connecting to micampusdesarequest: [route: {s}->https://fundewebjsshowcasedesa.um.es/155.54.228.131:443
13-05-2021 13:55:12.690 DEBUG 12864 --- [:443][total available: 0; route allocated: 0 of 5; total allocated: 0 of 10]
21-10-2021 09:05:45.077 DEBUG 2104 --- [http-nio-8080-exec-4] oh.ai.h.c.s.SSLConnectionSocketFactoryPoolingHttpClientConnectionManager : Connection leased: [id: : Connecting socket to micampusdesa2][route: {s}->https://fundewebjsshowcasedesa.um.es/155.54.228.131:443][total withavailable: timeout 0
13-05-2021 13:55:12.692 DEBUG 12864 --- [0; route allocated: 1 of 5; total allocated: 1 of 10]
21-10-2021 09:05:45.080 DEBUG 2104 --- [http-nio-8080-exec-4] o.a.h.ci.s.SSLConnectionSocketFactorye.MainClientExec                 : Enabled protocols: [TLSv1.2, TLSv1.1, TLSv1]
13-05-2021 13:55:12.692 DEBUG 12864Opening connection {s}->https://fundewebjsshowcasedesa.um.es:443
21-10-2021 09:05:45.084 DEBUG 2104 --- [http-nio-8080-exec-4] .i.c.DefaultHttpClientConnectionOperator : Connecting to fundewebjsshowcasedesa.um.es/155.54.228.138:443
21-10-2021 09:05:45.086 DEBUG 2104 --- [http-nio-8080-exec-4] o.a.h.c.s.SSLConnectionSocketFactory     : Connecting Enabledsocket cipher suites:[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_ECDHto fundewebjsshowcasedesa.um.es/155.54.228.138:443 with timeout 0
21-10-2021 09:05:45.160 DEBUG 2104 --- [http-nio-8080-exec-4] o.a.h.c.s.SSLConnectionSocketFactory     : Enabled protocols: [TLSv1.2]
21-10-2021 09:05:45.165 DEBUG 2104 --- [http-nio-8080-exec-4] o.a.h.c.s.SSLConnectionSocketFactory     : Enabled cipher suites:[TLS_ECDHE_ECDSA_WITH_AES_128256_GCM_SHA256SHA384, TLS_ECDHECDHE_RSAECDSA_WITH_AES_128_GCM_SHA256, TLS_DHEECDHE_RSA_WITH_AES_128256_GCM_SHA256SHA384, TLS_DHE_DSSRSA_WITH_AES_128256_GCM_SHA256SHA384, TLS_ECDHEECDH_ECDSA_WITH_AES_256_CBCGCM_SHA384, TLS_ECDHEECDH_RSA_WITH_AES_256_CBCGCM_SHA384, TLS_DHE_RSA_WITH_AES_256_CBC_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_256128_CBCGCM_SHA384SHA256, TLS_ECDH_RSA_WITH_AES_256128_CBCGCM_SHA384SHA256, TLS_DHE_RSA_WITH_AES_256128_CBCGCM_SHA256, TLS_DHE_DSS_WITH_AES_256128_CBCGCM_SHA256, TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHASHA384, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHASHA384, TLS_RSA_WITH_AES_256_CBC_SHASHA256, TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHASHA384, TLS_ECDH_RSA_WITH_AES_256_CBC_SHASHA384, TLS_DHE_RSA_WITH_AES_256_CBC_SHASHA256, TLS_DHE_DSS_WITH_AES_256_CBC_SHASHA256, TLS_ECDHE_ECDSA_WITH_AES_128256_CBC_SHA256SHA, TLS_ECDHE_RSA_WITH_AES_128256_CBC_SHA256SHA, TLS_RSA_WITH_AES_128256_CBC_SHA256SHA, TLS_ECDH_ECDSA_WITH_AES_128256_CBC_SHA256SHA, TLS_ECDH_RSA_WITH_AES_128256_CBC_SHA256SHA, TLS_DHE_RSA_WITH_AES_128256_CBC_SHA256SHA, TLS_DHE_DSS_WITH_AES_128256_CBC_SHA256SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHASHA256, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHASHA256, TLS_RSA_WITH_AES_128_CBC_SHASHA256, TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHASHA256, TLS_ECDH_RSA_WITH_AES_128_CBC_SHASHA256, TLS_DHE_RSA_WITH_AES_128_CBC_SHASHA256, TLS_DHE_DSS_WITH_AES_128_CBC_SHA256, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_EMPTY_RENEGOTIATION_INFO_SCSV]
13-05-2021 13:55:12.692 DEBUG 12864 --- [nio-8080-exec-4] o.a.h.c.s.SSLConnectionSocketFactory     : Starting handshake
13-05-2021 13:55:12.698 DEBUG 12864 --- [nio-8080-exec-4] o.a.h.c.s.SSLConnectionSocketFactory     : Secure session established
13-05-2021 13:55:12.698 DEBUG 12864 --- [nio-8080-exec-4] o.a.h.c.s.SSLConnectionSocketFactory     :  negotiated protocol: TLSv1.2
13-05-2021 13:55:12.698 DEBUG 12864 --- [nio-8080-exec-4] o.a.h.c.s.SSLConnectionSocketFactory     :  negotiated cipher suite: TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
13-05-2021 13:55:12.698 DEBUG 12864 --- [nio-8080-exec-4] o.a.h.c.s.SSLConnectionSocketFactory     :  peer principal: CN=micampusdesa.um.es, OU=ATICA, O=Universidad de Murcia, L=Murcia, ST=Murcia, C=ES
13-05-2021 13:55:12.698 DEBUG 12864 --- [nio-8080-exec-4] o.a.h.c.s.SSLConnectionSocketFactory     :  peer alternative names: [micampusdesa.um.es, www.micampusdesa.um.es]
13-05-2021 13:55:12.698 DEBUG 12864 --- [nio-8080-exec-4] o.a.h.c.s.SSLConnectionSocketFactory     :  issuer principal: CN=GEANT OV RSA CA 4, O=GEANT Vereniging, C=NL
13-05-2021 13:55:12.698 DEBUG 12864 --- [nio-8080-exec-4] .i.c.DefaultHttpClientConnectionOperator : Connection established 155.54.67.188:58123<->155.54.228.131:443
13-05-2021 13:55:12.698 DEBUG 12864 --- [_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_EMPTY_RENEGOTIATION_INFO_SCSV]
21-10-2021 09:05:45.179 DEBUG 2104 --- [http-nio-8080-exec-4] o.a.h.ic.e.MainClientExec   s.SSLConnectionSocketFactory              : Executing request GET /consultaexpedientes/rest/v1.0/private/test/CS HTTP/1.1
13-05Starting handshake
21-10-2021 1309:5505:1247.698361 DEBUG 128642104 --- [http-nio-8080-exec-4] o.a.h.ic.es.MainClientExecSSLConnectionSocketFactory     : Secure session established
21-10-2021 09:05:47.363 DEBUG 2104 --- [http-nio-8080-exec-4] o.a.h.c.s.SSLConnectionSocketFactory     : Target authnegotiated stateprotocol: UNCHALLENGEDTLSv1.2
1321-0510-2021 1309:5505:1247.698365 DEBUG 128642104 --- [http-nio-8080-exec-4] o.a.h.ic.e.MainClientExec          s.SSLConnectionSocketFactory     :  :negotiated Proxycipher auth state: UNCHALLENGED
13-05suite: TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
21-10-2021 1309:5505:1247.699368 DEBUG 128642104 --- [http-nio-8080-exec-4] o.a.h.c.s.headersSSLConnectionSocketFactory     :  peer principal: CN=mncskubedesa.atica.um.es, OU=ATICA, O=Universidad de                : http-outgoing-7 >> GET /consultaexpedientes/rest/v1.0/private/test/CS HTTP/1.1
13-05-2021 13:55:12.699 DEBUG 12864Murcia, L=Murcia, ST=Murcia, C=ES
21-10-2021 09:05:47.371 DEBUG 2104 --- [http-nio-8080-exec-4] o.a.h.c.s.headersSSLConnectionSocketFactory     :  peer                     : http-outgoing-7 >> Accept: text/plain, application/json, application/*+json, */*
13-05-2021 13:55:12.699 DEBUG 12864alternative names: [mncskubedesa.atica.um.es, fundewebjsshowcasedesa.um.es, verdacciodesa.um.es]
21-10-2021 09:05:47.376 DEBUG 2104 --- [http-nio-8080-exec-4] o.a.h.c.s.headersSSLConnectionSocketFactory     :  issuer principal: CN=GEANT OV RSA CA 4, O=GEANT              : http-outgoing-7 >> Header: value
13-05-2021 13:55:12.699 DEBUG 12864Vereniging, C=NL
21-10-2021 09:05:47.384 DEBUG 2104 --- [http-nio-8080-exec-4] o.ai.hc.headersDefaultHttpClientConnectionOperator : Connection                          : http-outgoing-7 >> Other-Header: othervalue
13-05-2021 13:55:12.699 DEBUG 12864established 155.54.67.188:54720<->155.54.228.138:443
21-10-2021 09:05:47.387 DEBUG 2104 --- [http-nio-8080-exec-4] o.a.h.headers        .i.e.MainClientExec                 : Executing request : http-outgoing-7 >> Content-Type: text/plain;charset=ISO-8859-1
13-05-2021 13:55:12.699 DEBUG 12864GET /api/v1.0/public/test/u HTTP/1.1
21-10-2021 09:05:47.389 DEBUG 2104 --- [http-nio-8080-exec-4] o.a.h.headers      i.e.MainClientExec                      : http-outgoing-7 >> Host: micampusdesa.um.es
13-05Target auth state: UNCHALLENGED
21-10-2021 1309:5505:1247.699389 DEBUG 128642104 --- [http-nio-8080-exec-4] o.a.h.headers      i.e.MainClientExec                      : http-outgoing-7 >> Connection: Keep-Alive
13-05Proxy auth state: UNCHALLENGED
21-10-2021 1309:5505:1247.699389 DEBUG 128642104 --- [http-nio-8080-exec-4] o.a.h.headers                            : http-outgoing-72 >> User-Agent: Apache-HttpClient/4.5.11 (Java/1.8.0_281)
13-05-2021 13:55:12.699 DEBUG 12864GET /api/v1.0/public/test/u HTTP/1.1
21-10-2021 09:05:47.389 DEBUG 2104 --- [http-nio-8080-exec-4] o.a.h.headers                            : http-outgoing-72 >> Accept-Encoding: gzip,deflate
13-05-2021 13:55:12.699 DEBUG 12864: text/plain, application/json, application/*+json, */*
21-10-2021 09:05:47.389 DEBUG 2104 --- [http-nio-8080-exec-4] o.a.h.wireheaders                               : http-outgoing-72 >> "GET /consultaexpedientes/rest/v1.0/private/test/CS HTTP/1.1[\r][\n]"
13-05-2021 13:55:12.699 DEBUG 12864Cabecera-test: Valor de test
21-10-2021 09:05:47.389 DEBUG 2104 --- [http-nio-8080-exec-4] o.a.h.wire   headers                            : http-outgoing-72 >> "AcceptCabecera-test2: text/plain, application/json, application/*+json, */*[\r][\n]"
13-05-2021 13:55:12.699 DEBUG 12864Valor de test 2
21-10-2021 09:05:47.408 DEBUG 2104 --- [http-nio-8080-exec-4] o.a.h.wireheaders                               : http-outgoing-72 >> "Header: value[\r][\n]"
13-05-2021 13:55:12.699 DEBUG 12864Content-Type: text/plain;charset=ISO-8859-1
21-10-2021 09:05:47.411 DEBUG 2104 --- [http-nio-8080-exec-4] o.a.h.wireheaders                               : http-outgoing-72 >> "Other-Header: othervalue[\r][\n]"
13-05Host: fundewebjsshowcasedesa.um.es
21-10-2021 1309:5505:1247.699412 DEBUG 128642104 --- [http-nio-8080-exec-4] o.a.h.wire   headers                            : http-outgoing-72 >> "Content-TypeConnection: text/plain;charset=ISO-8859-1[\r][\n]"
13-05Keep-Alive
21-10-2021 1309:5505:1247.699412 DEBUG 128642104 --- [http-nio-8080-exec-4] o.a.h.wire   headers                            : http-outgoing-72 >> "Host: micampusdesa.um.es[\r][\n]"
13-05-2021 13:55:12.699 DEBUG 12864User-Agent: Apache-HttpClient/4.5.12 (Java/1.8.0_301)
21-10-2021 09:05:47.412 DEBUG 2104 --- [http-nio-8080-exec-4] o.a.h.wire   headers                            : http-outgoing-72 >> "Connection: Keep-Alive[\r][\n]"
13-05Accept-Encoding: gzip,deflate
21-10-2021 1309:5505:1247.699412 DEBUG 128642104 --- [http-nio-8080-exec-4] o.a.h.wire                               : http-outgoing-72 >> "User-Agent: Apache-HttpClient/4.5.11 (Java/1.8.0_281)GET /api/v1.0/public/test/u HTTP/1.1[\r][\n]"
1321-0510-2021 1309:5505:1247.699424 DEBUG 128642104 --- [http-nio-8080-exec-4] o.a.h.wire                               : http-outgoing-72 >> "Accept-Encoding: gzip,deflate: text/plain, application/json, application/*+json, */*[\r][\n]"
1321-0510-2021 1309:5505:1247.699440 DEBUG 128642104 --- [http-nio-8080-exec-4] o.a.h.wire                               : http-outgoing-72 >> "Cabecera-test: Valor de test[\r][\n]"
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
13-05-2021 13:55:12.704 DEBUG 12864 --- []"
21-10-2021 09:05:47.450 DEBUG 2104 --- [http-nio-8080-exec-4] o.a.h.wire                               : http-outgoing-2 >> "Cabecera-test2: Valor de test 2[\r][\n]"
21-10-2021 09:05:47.453 DEBUG 2104 --- [http-nio-8080-exec-4] o.a.h.wire                               : http-outgoing-2 >> "Content-Type: text/plain;charset=ISO-8859-1[\r][\n]"
21-10-2021 09:05:47.455 DEBUG 2104 --- [http-nio-8080-exec-4] o.a.h.wire                               : http-outgoing-2 >> "Host: fundewebjsshowcasedesa.um.es[\r][\n]"
21-10-2021 09:05:47.459 DEBUG 2104 --- [http-nio-8080-exec-4] o.a.h.wire                               : http-outgoing-2 >> "Connection: Keep-Alive[\r][\n]"
21-10-2021 09:05:47.462 DEBUG 2104 --- [http-nio-8080-exec-4] o.a.h.wire                               : http-outgoing-2 >> "User-Agent: Apache-HttpClient/4.5.12 (Java/1.8.0_301)[\r][\n]"
21-10-2021 09:05:47.465 DEBUG 2104 --- [http-nio-8080-exec-4] o.a.h.wire                               : http-outgoing-2 >> "Accept-Encoding: gzip,deflate[\r][\n]"
21-10-2021 09:05:47.468 DEBUG 2104 --- [http-nio-8080-exec-4] o.a.h.wire                               : http-outgoing-72 <<>> "HTTP/1.1 200 [\r][\n]"
13-05-2021 13:55:12.705 DEBUG 12864 --- [nio-8080-exec-4] o.a.h.wire                               : http-outgoing-7 << "Server: nginx/1.19.2[\r][\n]"
13-05-2021 13:55:12.705 DEBUG 12864
------------------------------------------ Log de la respuesta => Dirección flechas "<<"

------------------------------------------ Log del código de estado devuelto
21-10-2021 09:05:47.490 DEBUG 2104 --- [http-nio-8080-exec-4] o.a.h.wire                               : http-outgoing-72 << "Date: Thu, 13 May 2021 11:55:12 GMTHTTP/1.1 401 [\r][\n]"
13-05
------------------------------------------

21-10-2021 1309:5505:1247.705493 DEBUG 128642104 --- [http-nio-8080-exec-4] o.a.h.wire                               : http-outgoing-72 << "ContentStrict-Transport-Type: application/jsonSecurity: max-age=15768000; includeSubDomains[\r][\n]"
1321-0510-2021 1309:5505:1247.705496 DEBUG 128642104 --- [http-nio-8080-exec-4] o.a.h.wire                               : http-outgoing-72 << "Content-Length: 2Date: Thu, 21 Oct 2021 07:05:46 GMT[\r][\n]"
1321-0510-2021 1309:5505:1247.705499 DEBUG 128642104 --- [http-nio-8080-exec-4] o.a.h.wire                               : http-outgoing-72 << "ConnectionContent-Type: keep-aliveapplication/json[\r][\n]"
1321-0510-2021 1309:5505:1247.705502 DEBUG 128642104 --- [http-nio-8080-exec-4] o.a.h.wire                               : http-outgoing-72 << "VaryTransfer-Encoding: Originchunked[\r][\n]"
1321-0510-2021 1309:5505:1247.705505 DEBUG 128642104 --- [http-nio-8080-exec-4] o.a.h.wire                               : http-outgoing-72 << "VaryConnection: Access-Control-Request-Methodkeep-alive[\r][\n]"
1321-0510-2021 1309:5505:1247.705506 DEBUG 128642104 --- [http-nio-8080-exec-4] o.a.h.wire                               : http-outgoing-72 << "Vary: Access-Control-Request-HeadersOrigin[\r][\n]"
1321-0510-2021 1309:5505:1247.705506 DEBUG 128642104 --- [http-nio-8080-exec-4] o.a.h.wire                               : http-outgoing-72 << "Vary: OriginAccess-Control-Request-Method[\r][\n]"
1321-0510-2021 1309:5505:1247.705506 DEBUG 128642104 --- [http-nio-8080-exec-4] o.a.h.wire                               : http-outgoing-72 << "Vary: Access-Control-Request-MethodHeaders[\r][\n]"
1321-0510-2021 1309:5505:1247.705506 DEBUG 128642104 --- [http-nio-8080-exec-4] o.a.h.wire                               : http-outgoing-72 << "Vary: Access-Control-Request-HeadersSet-Cookie: JSESSIONID=8249A87231939143E042C26AA99C4D70; Path=/api; HttpOnly[\r][\n]"
1321-0510-2021 1309:5505:1247.705506 DEBUG 128642104 --- [http-nio-8080-exec-4] o.a.h.wire                               : http-outgoing-72 << "X-Content-Type-Options: nosniff[\r][\n]"
1321-0510-2021 1309:5505:1247.705506 DEBUG 128642104 --- [http-nio-8080-exec-4] o.a.h.wire                               : http-outgoing-72 << "X-XSS-Protection: 1; mode=block[\r][\n]"
1321-0510-2021 1309:5505:1247.705524 DEBUG 128642104 --- [http-nio-8080-exec-4] o.a.h.wire                               : http-outgoing-72 << "Cache-Control: no-cache, no-store, max-age=0, must-revalidate[\r][\n]"
1321-0510-2021 1309:5505:1247.705527 DEBUG 128642104 --- [http-nio-8080-exec-4] o.a.h.wire                               : http-outgoing-72 << "Pragma: no-cache[\r][\n]"
1321-0510-2021 1309:5505:1247.705529 DEBUG 128642104 --- [http-nio-8080-exec-4] o.a.h.wire                               : http-outgoing-72 << "Expires: 0[\r][\n]"
1321-0510-2021 1309:5505:1247.705532 DEBUG 128642104 --- [http-nio-8080-exec-4] o.a.h.wire                               : http-outgoing-72 << "X-Frame-Options: SAMEORIGIN[\r][\n]"
1321-0510-2021 1309:5505:1247.705534 DEBUG 128642104 --- [http-nio-8080-exec-4] o.a.h.wire                               : http-outgoing-7 << "Access-Control-Allow-Origin: *-2 << "[\r][\n]"
1321-0510-2021 1309:5505:1247.705539 DEBUG 128642104 --- [http-nio-8080-exec-4] o.a.h.wireheaders                               : http-outgoing-72 << "Access-Control-Allow-Credentials: true[\r][\n]"
13-05-2021 13:55:12.705 DEBUG 12864 HTTP/1.1 401 
21-10-2021 09:05:47.543 DEBUG 2104 --- [http-nio-8080-exec-4] o.a.h.wireheaders                               : http-outgoing-72 << "Access-Control-Allow-Methods: GET, PUT, POST, DELETE, PATCH, OPTIONS[\r][\n]"
13-05-2021 13:55:12.705 DEBUG 12864Strict-Transport-Security: max-age=15768000; includeSubDomains
21-10-2021 09:05:47.546 DEBUG 2104 --- [http-nio-8080-exec-4] o.a.h.wire   headers                            : http-outgoing-72 << "Access-Control-Allow-HeadersDate: DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization,Set-Cookie[\r][\n]"
13-05-2021 13:55:12.705 DEBUG 12864Thu, 21 Oct 2021 07:05:46 GMT
21-10-2021 09:05:47.548 DEBUG 2104 --- [http-nio-8080-exec-4] o.a.h.wire  headers                             : http-outgoing-72 << "[\r][\n]"
13-05 Content-Type: application/json
21-10-2021 1309:5505:1247.705550 DEBUG 128642104 --- [http-nio-8080-exec-4] o.a.h.wire   headers                            : http-outgoing-72 << "CS"
13-05 Transfer-Encoding: chunked
21-10-2021 1309:5505:1247.705553 DEBUG 128642104 --- [http-nio-8080-exec-4] o.a.h.headers                            : http-outgoing-72 << HTTP/1.1 200 
13-05Connection: keep-alive
21-10-2021 1309:5505:1247.705555 DEBUG 128642104 --- [http-nio-8080-exec-4] o.a.h.headers                            : http-outgoing-72 << ServerVary: nginx/1.19.2
13-05Origin
21-10-2021 1309:5505:1247.705559 DEBUG 128642104 --- [http-nio-8080-exec-4] o.a.h.headers                            : http-outgoing-72 << Date: Thu, 13 May 2021 11:55:12 GMT
13-05-2021 13:55:12.705 DEBUG 12864Vary: Access-Control-Request-Method
21-10-2021 09:05:47.561 DEBUG 2104 --- [http-nio-8080-exec-4] o.a.h.headers                            : http-outgoing-72 << Content-TypeVary: application/json
13-05Access-Control-Request-Headers
21-10-2021 1309:5505:1247.705563 DEBUG 128642104 --- [http-nio-8080-exec-4] o.a.h.headers                            : http-outgoing-72 << ContentSet-LengthCookie: 2
13-05JSESSIONID=8249A87231939143E042C26AA99C4D70; Path=/api; HttpOnly
21-10-2021 1309:5505:1247.705566 DEBUG 128642104 --- [http-nio-8080-exec-4] o.a.h.headers                            : http-outgoing-72 << ConnectionX-Content-Type-Options: keep-alivenosniff
1321-0510-2021 1309:5505:1247.705568 DEBUG 128642104 --- [http-nio-8080-exec-4] o.a.h.headers                            : http-outgoing-72 << VaryX-XSS-Protection: Origin
13-051; mode=block
21-10-2021 1309:5505:1247.705571 DEBUG 128642104 --- [http-nio-8080-exec-4] o.a.h.headers                            : http-outgoing-72 << VaryCache-Control: Access-Control-Request-Method
13-05no-cache, no-store, max-age=0, must-revalidate
21-10-2021 1309:5505:1247.705575 DEBUG 128642104 --- [http-nio-8080-exec-4] o.a.h.headers                            : http-outgoing-72 << VaryPragma: Access-Control-Request-Headers
13-05no-cache
21-10-2021 1309:5505:1247.705577 DEBUG 128642104 --- [http-nio-8080-exec-4] o.a.h.headers                            : http-outgoing-72 << VaryExpires: Origin0
1321-0510-2021 1309:5505:1247.705579 DEBUG 128642104 --- [http-nio-8080-exec-4] o.a.h.headers                            : http-outgoing-72 << VaryX-Frame-Options: Access-Control-Request-Method
13-05SAMEORIGIN
21-10-2021 1309:5505:1247.705584 DEBUG 128642104 --- [http-nio-8080-exec-4] o.a.h.headersi.e.MainClientExec                 : Connection can         : http-outgoing-7 << Vary: Access-Control-Request-Headers
13-05-2021 13:55:12.705 DEBUG 12864be kept alive indefinitely
21-10-2021 09:05:47.587 DEBUG 2104 --- [http-nio-8080-exec-4] o.a.h.headers             .i.a.HttpAuthenticator               : http-outgoing-7 << X-Content-Type-Options: nosniff
13-05Authentication required
21-10-2021 1309:5505:1247.705589 DEBUG 128642104 --- [http-nio-8080-exec-4] o.a.h.headers            .i.a.HttpAuthenticator                : http-outgoing-7 << X-XSS-Protection: 1; mode=block
13-05-2021 13:55:12.705 DEBUG 12864: fundewebjsshowcasedesa.um.es:443 requested authentication
21-10-2021 09:05:47.589 DEBUG 2104 --- [http-nio-8080-exec-4] o.a.h.i.a.headersHttpAuthenticator                            : http-outgoing-7 << Cache-Control: no-cache, no-store, max-age=0, must-revalidate
13-05-2021 13:55:12.705 DEBUG 12864: Response contains no authentication challenges
21-10-2021 09:05:47.589 DEBUG 2104 --- [http-nio-8080-exec-4] o.a.h.c.p.headersResponseProcessCookies         : Cookie accepted [JSESSIONID="8249A87231939143E042C26AA99C4D70", version:0,               : http-outgoing-7 << Pragma: no-cache
13-05-2021 13:55:12.705 DEBUG 12864domain:fundewebjsshowcasedesa.um.es, path:/api, expiry:null]
21-10-2021 09:05:47.609 DEBUG 2104 --- [http-nio-8080-exec-4] o.a.h.headers.wire                               : http-outgoing-7 << Expires: 0
13-05-2021 13:55:12.705 DEBUG 128642 << "a0[\r][\n]"

---------------------------- Log con Body de la respuesta
21-10-2021 09:05:47.613 DEBUG 2104 --- [http-nio-8080-exec-4] o.a.h.headers] o.a.h.wire                               : http-outgoing-2 << "{"fecha":"21/10/2021 07:05:46","estado":"UNAUTHORIZED","mensaje":"No tiene acceso para solicitar    : http-outgoing-7 << X-Frame-Options: SAMEORIGIN
13-05-2021 13:55:12.705 DEBUG 12864este servicio","tipoRespuesta":"CUSTOM_DefaultErrorAttributes"}[\r][\n]"
-----------------------------

21-10-2021 09:05:47.618 DEBUG 2104 --- [http-nio-8080-exec-4] o.a.h.headerswire                               : http-outgoing-72 << Access-Control-Allow-Origin: *
13-05"0[\r][\n]"
21-10-2021 1309:5505:1247.705620 DEBUG 128642104 --- [http-nio-8080-exec-4] o.a.h.headerswire                               : http-outgoing-72 << Access-Control-Allow-Credentials: true
13-05"[\r][\n]"
21-10-2021 1309:5505:1247.705625 DEBUG 128642104 --- [http-nio-8080-exec-4] oh.ai.hc.headersPoolingHttpClientConnectionManager : Connection [id: 2][route: {s}->https://fundewebjsshowcasedesa.um.es:443] can be kept alive indefinitely
21-10-2021 09:05:47.628 DEBUG 2104               --- [http-nio-8080-exec-4] h.i.c.DefaultManagedHttpClientConnection : http-outgoing-7 << Access-Control-Allow-Methods2: GET,set PUT,socket POST,timeout DELETE, PATCH, OPTIONS
13-05to 0
21-10-2021 1309:5505:1247.705631 DEBUG 128642104 --- [http-nio-8080-exec-4] oh.ai.hc.headersPoolingHttpClientConnectionManager : Connection released: [id:                        : http-outgoing-7 << Access-Control-Allow-Headers: DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization,Set-Cookie
2][route: {s}->https://fundewebjsshowcasedesa.um.es:443][total available: 1; route allocated: 1 of 5; total allocated: 1 of 10]


Referencias:

Artículos Relacionados

Contenido por etiqueta
showLabelsfalse
max5
spaces~ramon.ginel@ticarum.es
showSpacefalse
sortmodified
reversetrue
typepage
cqllabel in ("rest","resttemplate","fundewebjs","logs","cliente") and type = "page" and space = "~ramon.ginel@ticarum.es"
labelsrest logs RestTemplate fundewebjs cliente

...