Comments (6)
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.
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.
(Am happy to make these updates - just collating some content and ensuring it's not lost)
from egeria-docs.
-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.
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.
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)
- Update React Ui docs to reference the new certificates
- update the docs around hms connector to document the new flags
- Test if 3.15 connectors work with 4.0 Deployments HOT 3
- Messed up pages for services
- Cannot navigate from audit log concept to further information
- Experimenting with XTDB in Charts HOT 1
- Document LFX process/configuration (analytics, security) HOT 1
- Document use of container registries
- Add more detailed documentation on helm charts, design, modifications
- Add process docs on handling gradle wrapper HOT 1
- April newsletter - update 'cloud native' summary HOT 1
- Add logging configuration example
- [Enhancement] Update documentation to build images/containers HOT 1
- The webinar youtube video widgets are not displaying HOT 3
- Spelling mistake in Type Explorer (TEX) docs page
- update release guide with hms listener
- Documentation - Link to Avro File Connector is invalid HOT 3
- Documentation - Missing variable name in explanation HOT 1
- Link to XTDB configuration is invalid
- Link Target within documentation not found (404) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from egeria-docs.