Skip to content

mjrgr/loggingtestapp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Logging Test Application

A Spring Boot application written in Kotlin that demonstrates advanced logging capabilities with integration to OpenSearch for log aggregation and visualization.

Features

  • Spring Boot application with Kotlin
  • Structured logging using SLF4J and Logback
  • Log shipping with Fluent Bit
  • Log visualization with OpenSearch and OpenSearch Dashboards
  • Docker Compose setup for easy deployment
  • Health monitoring via Spring Boot Actuator

Prerequisites

  • Docker and Docker Compose
  • Java 17 or later (for local development)
  • Gradle (optional, wrapper included)

Quick Start

  1. Clone the repository:

    git clone https://github.com/mjrgr/loggingtestapp.git
    cd loggingtestapp
  2. Start the application stack using Docker Compose:

    cd docker
    docker-compose up -d

This will start:

  • The Spring Boot application on port 8080
  • OpenSearch on port 9200
  • OpenSearch Dashboards on port 5601
  • Fluent Bit for log shipping

Development

Building the Application

You can build the application using the included Gradle wrapper:

./gradlew build

Running Locally

To run the application locally:

./gradlew bootRun

The application will start on http://localhost:8080.

Docker Services

Logging Application

  • Spring Boot application containerized using Gradle image
  • Exposes port 8080
  • Health check endpoint at /actuator/health

OpenSearch

  • Running on port 9200
  • Single-node configuration for development
  • Secured with default admin credentials

OpenSearch Dashboards

  • Available at http://localhost:5601
  • Provides visualization and analysis of logs
  • Default credentials: admin/M3i7s/Mh1Dou

Fluent Bit

  • Monitors log files in /tmp/la/*.log
  • Ships logs to OpenSearch
  • Configurable via docker/fluentbit/fluent-bit.conf

Configuration

Application Configuration

  • Main configuration in src/main/resources/application.yml
  • Logging configuration in src/main/resources/logback.xml

Fluent Bit Configuration

  • Configuration file: docker/fluentbit/fluent-bit.conf
  • Customizable input paths and output settings
  • Current refresh interval: 5 seconds

Project Structure

├── src/main/
│   ├── kotlin/         # Kotlin source files
│   └── resources/      # Application resources
├── docker/
│   ├── compose.yml     # Docker Compose configuration
│   └── fluentbit/      # Fluent Bit configuration
└── build.gradle        # Gradle build configuration

License

This project is licensed under the terms of the LICENSE file included in the repository.

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

About

Sample Kotlin/SpringBoot2 application scheduling a periodic log

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages