Giter VIP home page Giter VIP logo

Comments (6)

mandy-chessell avatar mandy-chessell commented on September 17, 2024

Logging debug messages server-side is a requirement for Egeria modules.
Most use the RESTCallLogger for this which also logs the time of the call.

We need an issue for which components are not logging server side.

All client-side requests go through the REST connector and so enabling debug logging just requires log.debug calls.

from egeria-docs.

planetf1 avatar planetf1 commented on September 17, 2024

Also add info on debugging ssl -- for example can run the chassis, or a client with

-Djavax.net.debug=ssl:handshake:verbose:keymanager:trustmanager 

This enables the logging built into the standard java ssl modules (not in our code -- so we need to do it this way)

The spring logging actuator/config above also caters for debugging all inbound http requests, including those that don't reach our code - bad structure in the request body, invalid endpoint etc - again this is referring to system capabilities since our code is not reached.

So this is more about debugging the setup of the environment itself, rather than trying to understand what Egeria itself is doing once it's involved where as you say, we'd use the Audit Log.

Good tip on the rest call logger for egeria clients

from egeria-docs.

planetf1 avatar planetf1 commented on September 17, 2024

(Am happy to make these updates - just collating some content and ensuring it's not lost)

from egeria-docs.

planetf1 avatar planetf1 commented on September 17, 2024
-Dlogging.level.org.springframework.web.client.RestTemplate=DEBUG
-Dserver.tomcat.basedir=/tmp
-Dserver.tomcat.accesslog.enabled=true
-Dserver.tomcat.accesslog.buffered=false

is an example which will produce a simple access log under /tmp/logs ie

tail -f access_log.2021-11-29.log                                                                                               [17:53:06]
0:0:0:0:0:0:0:1 - - [29/Nov/2021:17:52:54 +0000] "GET / HTTP/1.1" 404 100

for the inbound requests - so at least we can see what is being called, in case it is malformed & never reaches Egeria

(as well as add debug for the client)

from egeria-docs.

planetf1 avatar planetf1 commented on September 17, 2024

Some further hints at https://stackoverflow.com/questions/7952154/spring-resttemplate-how-to-enable-full-debugging-logging-of-requests-responses - but note that by default we are using the jdk http client rather than apache. Enhanced logging may be one reason to move to the latter

For jdk http client see https://stackoverflow.com/questions/53215038/how-to-log-request-response-using-java-net-http-httpclient

-Djdk.httpclient.HttpClient.log=requests

is an option. Needs some further investigation

from egeria-docs.

planetf1 avatar planetf1 commented on September 17, 2024

Another good suggestion to debug spring request/response - -Ddebug

With this added I was able to determine why a particular REST call was failing. Without this only a 400 was returned, with nothing in the audit log, since the error is swallowed by spring when parsing the request -- we would need to add more handlers to manage this better.

With the debug we see:

2022-02-02 15:07:21.103 DEBUG 49120 --- [io-9443-exec-10] o.s.web.servlet.DispatcherServlet        : POST "/open-metadata/admin-services/users/garygeeke/servers/intsrv/integration-services/database-integrator", parameters={}
2022-02-02 15:07:21.105 DEBUG 49120 --- [io-9443-exec-10] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped to org.odpi.openmetadata.adminservices.spring.ConfigIntegrationServicesResource#configureIntegrationService(String, String, String, IntegrationServiceRequestBody)
2022-02-02 15:07:21.121 DEBUG 49120 --- [io-9443-exec-10] o.s.web.method.HandlerMethod             : Could not resolve parameter [3] in public org.odpi.openmetadata.commonservices.ffdc.rest.VoidResponse org.odpi.openmetadata.adminservices.spring.ConfigIntegrationServicesResource.configureIntegrationService(java.lang.String,java.lang.String,java.lang.String,org.odpi.openmetadata.adminservices.rest.IntegrationServiceRequestBody): JSON parse error: Unexpected character ('\' (code 92)): was expecting double-quote to start field name; nested exception is com.fasterxml.jackson.core.JsonParseException: Unexpected character ('\' (code 92)): was expecting double-quote to start field name
 at [Source: (PushbackInputStream); line: 1, column: 4]
2022-02-02 15:07:21.125  WARN 49120 --- [io-9443-exec-10] .w.s.m.s.DefaultHandlerExceptionResolver : Resolved [org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Unexpected character ('\' (code 92)): was expecting double-quote to start field name; nested exception is com.fasterxml.jackson.core.JsonParseException: Unexpected character ('\' (code 92)): was expecting double-quote to start field name<EOL> at [Source: (PushbackInputStream); line: 1, column: 4]]
2022-02-02 15:07:21.125 DEBUG 49120 --- [io-9443-exec-10] o.s.web.servlet.DispatcherServlet        : Completed 400 BAD_REQUEST

Very useful ....

from egeria-docs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.