LIGHT

  • News
  • Docs
  • Community
  • Reddit
  • GitHub
Star
CONCERNS

Logger Config

Logger-config is a module in the Light-4j framework that will use to get the loggers and their current logging levels. It can also change the logging level for given loggers at runtime (Example: Change logging level to DEBUG for “com.networknt” logger for troubleshooting purpose). The user can also create a brand new logger with a level for debugging issues for a specific package on the target server.

Note: This feature is only supposed to be used in a development environment without security enabled. On production, the security must be enabled so that only authorized users can update the logging level through API calls. It is highly recommended to leverage the light-controller(standard) or light-portal(enterprise) to manage all the runtime instances and update them through the UI.

Logger-config

There are three Logger Handlers available in logging module.

  • LoggerGetHandler : This handler will provide the all available loggers & their current logging levels.

    End point : /logger

    Method : GET

    Example URL : https://localhost:8443/logger

  • LoggerGetNameHandler : This handler will provide a logger and its logging level by name.

    End point : /logger/com.networknt

    Method : GET

    Example URL : https://localhost:8443/logger/com.networknt

  • LoggerPostHandler : Using this handler we can change the logging level for given logger e.g. change logging level to DEBUG for “com.networknt” logger for troubleshooting purpose.

    End point : /logger

    Method : POST

    Example Input format : {“name”: “com.networknt”level”:“DEBUG”}

    Example URL : https://localhost:8443/api/customers/loggers/com.networknt

Input is mandatory, If you provide the input in request body, it will change and return the updated logging level for given logger else it will throw an error.

Usage

Add dependency.

<dependency>
  <groupId>com.networknt</groupId>
  <artifactId>logger-config</artifactId>
  <version>${version.light-4j}</version>
</dependency>

Configuration for handler.yml

Add these handlers.

- [email protected]
- [email protected]r
- [email protected]

Add the below end points under path.

- path: '/logger'
  method: 'get'
  exec:
  # - security
  - getLogger

- path: '/loggers/{loggerName}'
  method: 'get'
  exec:
  # - security
  - getNamedLogger

- path: '/logger'
  method: 'post'
  exec:
  # - security
  - body
  - postLogger
  

By default logger is enabled in logger-config.yml. if you want to disable it, just add the logger-config.yml file in your resource folder and make enabled property to false in logger-config.yml.

Light-Controller

The light-controller is using only the getLogger and postLogger from the UI for each registered instance. For more info, please visit light-controller.

  • About Light Platform
    • Overview
    • Testimonials
    • What is Light
    • Features
    • Principles
    • Benefits
    • Roadmap
    • Community
    • Articles
    • Videos
    • License
  • Getting Started
    • Get Started Overview
    • Environment
    • Light Codegen Tool
    • Light Rest 4j
    • Light Tram 4j
    • Light Graphql 4j
    • Light Hybrid 4j
    • Light Eventuate 4j
    • Light Oauth2
    • Light Portal Service
    • Light Proxy Server
    • Light Router Server
    • Light Config Server
    • Light Saga 4j
    • Light Session 4j
    • Webserver
    • Websocket
    • Spring Boot Servlet
  • Architecture
    • Architecture Overview
    • API Category
    • API Gateway
    • Architecture Patterns
    • CQRS
    • Eco System
    • Event Sourcing
    • Fail Fast vs Fail Slow
    • Integration Patterns
    • JavaEE declining
    • Key Distribution
    • Microservices Architecture
    • Microservices Monitoring
    • Microservices Security
    • Microservices Traceability
    • Modular Monolith
    • Platform Ecosystem
    • Plugin Architecture
    • SOA
    • Scalability and Performance
    • Serverless
    • Service Collaboration
    • Service Mesh
    • Spring is bloated
    • Stages of API Adoption
    • Transaction Management
    • Microservices Cross-cutting Concerns Options
    • Service Mesh Plus
    • Service Discovery
  • Design
    • Design Overview
    • Design First vs Code First
    • Desgin Pattern
    • Service Evolution
    • Consumer Contract and Consumer Driven Contract
    • Handling Partial Failure
    • Idempotency
    • Environment Segregation
    • Multi-Tenancy
    • Why check token expiration
    • WebServices to Microservices
  • Cross-Cutting Concerns
    • Concerns Overview
  • API Styles
    • Light-4j for absolute performance
    • Style Overview
    • Distributed session on IMDG
    • Hybrid Serverless Modularized Monolithic
    • Kafka - Event Sourcing and CQRS
    • REST - Representational state transfer
    • Web Server with Light Platform
    • Websocket with light platform
    • Spring Boot Integration
    • Single Page Application
    • GraphQL - A query language for your API
    • Light IBM MQ
    • Light AWS Lambda
  • Infrastructure Services
    • Service Overview
    • Light Proxy
    • Light Router
    • Light Portal
    • Messaging Infrastructure
    • COVID-19
    • Centralized Logging
    • Light OAuth2
    • Metrics and Alerts
    • Config Server
    • Tokenization
    • Light Controller
  • Tool Chain
    • Tool Chain Overview
  • Utility Library
  • Service Consumer
    • Service Consumer
  • Development
    • Development Overview
  • Deployment
    • Deployment Overview
    • Frontend Backend
    • Linux Service
    • Windows Service
    • Install Eventuate on Windows
    • Secure API
    • Client vs light-router
    • Memory Limit
    • Deploy to Kubernetes
  • Benchmark
    • Benchmark Overview
  • Tutorial
    • Tutorial Overview
  • Troubleshooting
    • Troubleshoot
  • FAQ
    • FAQ Overview
  • Milestones
  • Contribute
    • Contribute to Light
    • Development
    • Documentation
    • Example
    • Tutorial
“Logger Config” was last updated: December 3, 2020: fixes #218 update the logger-config document in cross-cutting concern (f6e51c4)
Improve this page
  • News
  • Docs
  • Community
  • Reddit
  • GitHub
  • About Light Platform
  • Getting Started
  • Architecture
  • Design
  • Cross-Cutting Concerns
  • API Styles
  • Infrastructure Services
  • Tool Chain
  • Utility Library
  • Service Consumer
  • Development
  • Deployment
  • Benchmark
  • Tutorial
  • Troubleshooting
  • FAQ
  • Milestones
  • Contribute