Skip to content

pijushcs/LogDumper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LogDumper Application:

The LogDumper supports multiple application clients to log messages that are to be dumped to the server. The dumper application checks the logs of all the running applications that are registered to it, converts it to JSON and sends them to the server.

Usage: java -jar LogDumper.jar [server-host-name] [server-port]


Some Design Notes:

While listing the raw user logs, each client log file is locked with an exclusive lock using FileLock and processed. The JSON translation happens after the lock is released to have the clients get access to the log file.

Note: The client applications are not blocked due to the exclusive lock as the LogDumperLib provides asynchronous logging.

Exceptions are modelled to have the upstream calls handle the excetions and accordings throws the exception. Custom exceptions may be added for better error reporting.

Note: Care has been taken to ensure that no user log data is lost during an error or graceful exit

The user raw logs are validated and modelled to a class DumperLog that is used by Jackson to create the JSON

The default processors/translators have been provided as a signleton that can be created using a factory method from the utility class (Check below section).


Some Class Specific Notes:

LogDumper: Orchestrates the entire workflow.

Interfaces (src/Interfaces):

LogFileTracker:
Interface for the main client log processor.

LogTranslaotr:
Interface for the translating the user log to JSON/XML

DLogConnection:
Interface for the seting up the server connection (TCP/UDP etc)


Implementations (src/DumperImpl):

LogFileTrackerImpl:
Default implementation of the processor. The main task of the processor is to lock client logs for processing and add it to a log-list and return the list of raw user log.

JsonTranslatorImpl:
The main taks of the JSON implementation of the translator is to form a JSON from the raw user log.

DefaultLogConnection:
Implemention of the TCP Connection to ther Dumper Server/

DumperLog:
Representation of the user log used by Jackson for JSON translation.

Utils and Constants (src/Utils)

Constants:
The class has a few Constants and Enums

DumperLogHelper
Most of the frequest helper methods are defined here


About

The main LogDumper Background Application

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published