Example

Logging Endpointregistration

Demonstrates how to debug startup issues with Helix endpoint registration logging and PID logging. Shows the listener properties, the startup log lines they produce, and a small application route that the endpoint registration listener reports during boot.
Group
REST API
Path
examples/rest-api/logging-endpointregistration

Overview

Helix Spring Boot webservice that shows how to debug startup issues with the endpoint registration logging listener and

the PID logging listener.

Run this example from the shared examples build:

Run

Run this example from the shared examples build


./gradlew -p examples runExample -Pexample=rest-api/logging-endpointregistration --init-script "$(pwd)/helix.init.gradle"

What It Shows

  • the Helix API starter baseline
  • the built-in EndpointRegistrationLoggingListener
  • the built-in PidLoggingListener
  • the Helix properties that control those listeners
  • how to read the startup logs when you are debugging missing endpoints or process-identification issues

Endpoints

  • GET /v1/logging-endpointregistration/debug
  • GET /v1/logging-endpointregistration/orders/{orderId}
  • GET /liveness
  • GET /health

Example success response

{
  "applicationEndpoint": "/v1/logging-endpointregistration/orders/{orderId}",
  "debugEndpoint": "/v1/logging-endpointregistration/debug",
  "endpointRegistrationLoggingProperty": "helix.listener.endpointregistration.enabled",
  "pidLoggingProperty": "helix.listener.pidlogging.enabled",
  "endpointRegistrationEnabled": true,
  "pidLoggingEnabled": true,
  "debugAdvice": "Enable startup logs, then look for 'Registered endpoint:' lines and 'Application started with PID:' during boot."
}

Example startup log output

Registered endpoint: {GET [/v1/logging-endpointregistration/orders/{orderId}]}
Registered endpoint: {GET [/v1/logging-endpointregistration/debug]}
Application started with PID: 12345

Development

Building the Application

Run the following command to build the service:

Command

Building the Application


./gradlew clean build

Testing the Application

Run the following command to run the service tests:

Command

Testing the Application


./gradlew test
./gradlew integration

Trying the API

Run the service with both logging listeners enabled:

Then try:

If you want to isolate one listener while debugging, you can toggle them independently:

Use endpoint registration logging when you need to confirm which request mappings actually made it into the running application context. Use PID logging when you need to correlate the running process with local tooling, deployment scripts, or process managers.

Command

Trying the API


./gradlew bootRun --jvm-args='-DPID=12345'

Command

Trying the API


curl http://localhost:8080/v1/logging-endpointregistration/debug

curl http://localhost:8080/v1/logging-endpointregistration/orders/ORD-100

Command

Trying the API


./gradlew bootRun --args='--helix.listener.endpointregistration.enabled=false'

./gradlew bootRun --args='--helix.listener.pidlogging.enabled=false'