Archive / Spring

RSS feed for this section

Spring

Spring Actuator Metrics availableTags

Get useful metrics to monitor your app With Spring Actuator API several useful metrics can be exposed that you can use to monitor your Spring Boot application. Metrics like application health or the last HTTP requests. I’ll show you how to do that. I’ve made an example project you can found at https://github.com/claudioaltamura/docker-springboot-helloworld. After starting […]

Trace http requests with Spring Actuator

List the last http request with ease Spring Actuator provides also a httptrace endpoint. You get the last HTTP request with /httptrace. After adding Spring Boot Actuator dependencies to your project dependencies, you have to expose the httptrace endpoint via your application.properties: In Spring Boot 2.0 the trace endpoint was renamed to httptrace. You can […]

Change your application log level with Spring Actuator

You can do it even at runtime 🙂 Spring Boot provides a loggers actuator endpoint for viewing and changing log levels at runtime. What do I need? Add the Spring Boot Starter Actuator to you pom.xml or build.gradleorg.springframework.boot:spring-boot-starter-actuator Expose at least the loggers endpoint in your application.propertiesmanagement.endpoints.web.exposure.include=loggers When exposed, you get all loggers details with /loggers: […]

Spring und Unit-Tests mit Mockito

Ich hatte mich schon längere Zeit gefragt, ob ich nicht noch einfacher auf die Mocks zugreifen kann, um das Verhalten zu manipulieren. Also recherierte ich ein bißchen und bin dann bei der neusten Mockito-Version (1.9.5) auf die Annotations @Mock und @InjectMocks aufmerksam gewurden. Mit @Mock kennzeichne ich einfach die Klassen die zu Mocken sind. Und […]

Consent Management Platform von Real Cookie Banner