- ASDF or NVM can be used as node version manager
- Nodejs version v21.1.0
- npm 10.2.0
- No deps required for running this project, but for linting and formatting purposes eslint and prettier is used
npm ci
npm run format:fix
#for formatting filesnpm run lint:fix
#for checking eslint rules
- Logs files can be stored in
data/
dir and File PATH needs to passed using env varLOG_FILE_PATH
- copy file to this path and pass
LOG_FILE_PATH
value
- copy file to this path and pass
- few other optional env var can be passed such as
- HOST
- PORT
- LOG_FILE_LINE_MAX_LENGTH defaults to 256
- dev mode can be started with
npm run dev
#watches for file changes
- production mode can be started with
npm start
Root route
Check the if the service is up?
Logs explorer api with many options to fetch data
- With Pagination
GET
/v1/logs?page=1&pageSize=100
- Max pageSize can be 500
- Without Pagination and return all data
GET
/v1/logs?skipPagination=true
- If data is more can face some issues based on server and client side resources
- With streaming rows
GET
/v1/logs?streamRows
- Streams data to client
startTime
- ISO date time stringendTime
- ISO date time string
GET /v1/logs
GET /v1/logs?page=1&pageSize=10
GET /v1/logs?skipPagination=true&startTime=2020-01-01T00:05:32.946Z&endTime=2020-02-01T00:05:32.946Z
GET /v1/logs?skipPagination=true&streamRows=true
GET /v1/logs?startTime=2020-01-01T00:05:32.946Z&skipPagination=true&streamRows=true