An open API service indexing awesome lists of open source software.

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

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
```