Code Monkey home page Code Monkey logo

log-parser-application's Introduction

Log Parser App

Overview

This project consists of a backend API (log-parser-backend) and a frontend UI (log-parser-frontend) for parsing log files and displaying the relevant information.

Backend

Installation

  1. Navigate to the backend directory: cd log-parser-backend
  2. Install dependencies: npm install
cd log-parser-backend
npm install

Execution

Run the backend using the following command:

cd log-parser-backend
npx ts-node src/index.ts

Testing

Execute the backend tests with:

cd log-parser-backend
npm test

Frontend

Installation

  1. Navigate to the frontend directory: cd log-parser-frontend
  2. Install dependencies: npm install
cd log-parser-frontend
npm install

Execution

Run the frontend using the following command:

cd log-parser-frontend
npm start

Requirements

Input File Format

Log messages should adhere to the following format:

<ISO Date> - <Log Level> - {"transactionId": "<UUID>", "details": "<message event/action description>", "err": "<Optional, error description>", ...<additional log information>}

Example

2021-08-09T02:12:51.259Z - error - {"transactionId":"9abc55b2-807b-4361-9dbe-aa88b1b2e978","details":"Cannot find user orders list","code":404,"err":"Not found"}

API Response Format

The API responds with a JSON array containing log information:

[{"timestamp": <Epoch Unix Timestamp>, "loglevel": "<loglevel>", "transactionId": "<UUID>", "err": "<Error message>" }]

Example

[{"timestamp":1628475171259,"loglevel":"error","transactionId":"9abc55b2-807b-4361-9dbe-aa88b1b2e978","err":"Not found"}]

Frontend UI Features

The frontend UI allows users to upload log files, displays a loader during API calls, and automatically downloads the JSON file on successful response. In case of an error, an alert is shown to the user.

log-parser-application's People

Watchers

Tarun Jain avatar  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.