Coder Social home page Coder Social logo

pmgysel / mongodb-logging-app Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 2.0 66 KB

Demo app for MongoDB: manage log events of varying schema type

Home Page: https://dev.to/pmgysel/log-capturing-app-with-mongodb-spring-boot-swagger-ui-7op

Java 100.00%
mongodb spring-boot swagger-ui rest-api

mongodb-logging-app's Introduction

Log Capturing (with MongoDB + SpringBoot + Swagger UI)

This demo application showcases MongoDB and its capability to store data of varying schema.

Prerequisites

  • Java and Maven
  • A MongoDB server running locally on default port 27017

The data model

Each log event is represented as a key-value Map.

An example log might look like this:

{
  "logEvent": {
    "_id": "5f5542649469105a541140e1",
    "_appType": "PAYMENT",
    "_createDate": "2020-09-07T10:11:16.435",
    "severity": "ERROR",
    "creditCardProvider": "VISA",
    "message": "Payment failed",
    "paymentAmount": "9.90"
  }
}

REST Endpoints

Swagger UI

Run the App

Go ahead and compile the source code. Then start the SpringBoot app LogCaptureApp. Now you're ready to fire REST requests on http://localhost:8080/swagger-ui.html.

Store logs:

  • createLogRandom: Create a random log entry. You can choose the log source.
  • createLog: Create a log entry from JSON. You can use any fields you want.

Display logs:

  • getLogByApp: Search all log entries from a specific application of origin.
  • getLogByDateRange: Search logs by time range.
  • ... or use any other REST GET endpoint

mongodb-logging-app's People

Contributors

pmgysel avatar

Stargazers

Giovanni Desiderio avatar 0xnewe avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.