Class ActuatorController

java.lang.Object
com.bobocode.bring.web.actuator.controller.ActuatorController
All Implemented Interfaces:
BringServlet

public class ActuatorController extends Object implements BringServlet
Controller responsible for managing actuator endpoints. Provides endpoints for checking application health, retrieving environment properties, Git information, and dynamically changing log levels.

The class is annotated with @RestController, indicating that it handles HTTP requests and returns the response in the specified format. The base path for all endpoints is "/actuator".

The class has endpoints for checking the health of the application, retrieving environment properties, and getting Git information. Additionally, it includes an endpoint for dynamically changing the log level of specific loggers based on the package name.

Uses the DefaultActuatorService for preparing actuator-related data and the LogLevelChangerUtils for dynamically changing log levels.

Since:
1.0
Author:
Blyzhnytsia Team
  • Field Details

  • Constructor Details

    • ActuatorController

      public ActuatorController()
  • Method Details

    • health

      public String health()
      Endpoint for checking the health of the application.
      Returns:
      The HTTP status representing the health of the application.
    • env

      public PropertiesData env()
      Endpoint for retrieving environment properties of the application.
      Returns:
      The environment properties of the application.
    • info

      public GitInfo info()
      Endpoint for retrieving Git information about the application.
      Returns:
      The Git information of the application.
    • logger

      public void logger(String packageName, String newLevel)
      Endpoint for dynamically changing the log level of specific loggers based on package name.
      Parameters:
      packageName - The name of the logger's package to change the level.
      newLevel - The new log level for the specified logger's package.