https://github.com/timo-reymann/enhanced-diagnostics-spring-boot-starter
Starter for enhanced diagnostics based on java lib
https://github.com/timo-reymann/enhanced-diagnostics-spring-boot-starter
boot enhanced-diagnostics java spring
Last synced: 5 months ago
JSON representation
Starter for enhanced diagnostics based on java lib
- Host: GitHub
- URL: https://github.com/timo-reymann/enhanced-diagnostics-spring-boot-starter
- Owner: timo-reymann
- License: mit
- Archived: true
- Created: 2018-07-23T11:50:09.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-10-05T10:54:26.000Z (over 7 years ago)
- Last Synced: 2024-11-20T03:33:08.841Z (over 1 year ago)
- Topics: boot, enhanced-diagnostics, java, spring
- Language: Java
- Homepage:
- Size: 52.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
enhanced-diagnostics-spring-boot-starter
===
Drop-in starter for enhanced-diagnostics starter
## Add to your depencies
```xml
com.github.timo-reymann
enhanced-diagnostics-spring-boot-starter
1.0.0
```
## Usage
Drop in the dependency, and override the default bean, and there you go!
```java
@Bean
public ReportProcessorBean() {
return new ReportProcessorBean() {
@Override
public void process(Report report) {
// Process your report, as you like
}
};
}
```
On your frontend you can get the public key via ``/report/publicKey`` in pem format.
## Frontend example
```html
const logger = new DatabaseLogger('db', 1);
const reporter = new LogReporter(logger);
console.log("This will be transmitted");
fetch("/report/publicKey", {
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
})
.then(r => r.json()) // Parse json
.then(data => { // Get public key
const key = data.publicKey
reporter.buildReportChunks(key).then(chunks => { // Submit report
fetch("/report", {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json'
},
body: chunks
})
})
});
```
## Customize
```yaml
enhanced-diagnostics:
route-prefix: /customReportPath
```