Skip to content

Expose and explore .log files via a secure Node.js API.

License

Notifications You must be signed in to change notification settings

marcoshmendes/logonaut

Repository files navigation

Logonaut

License Node.js Made with Express

Explore your logs over HTTP. Secure. Simple. Flexible.

Logonaut is a lightweight Express-based API to expose and read .log files over HTTP — ideal for accessing logs like those generated by pm2 remotely.


🚀 Features

  • 📂 Read from standard and error log files
  • 🔐 Token-based authentication (Bearer)
  • 🛡️ Built-in rate limiting for security
  • ⚙️ Configurable via .env
  • 🧩 Easy to run with PM2, Docker, or Systemd

📦 Getting started

Clone and install dependencies:

git clone https://github.com/seu-usuario/logonaut.git
cd logonaut
npm install
cp .env.example .env

Edit your .env file:

LOG_FILE_PATH=/home/user/.pm2/logs/app-out.log
ERROR_LOG_FILE_PATH=/home/user/.pm2/logs/app-error.log
API_TOKEN=your_secure_token
PORT=3000

Then start the server:

npm start

Example usage

curl -H "Authorization: Bearer YOUR_TOKEN" http://localhost:3000/logs
curl -H "Authorization: Bearer YOUR_TOKEN" http://localhost:3000/logs/error?lines=500

Docker (optional)

docker build -t logonaut .
docker run -d -p 3000:3000 --env-file .env logonaut

About

Expose and explore .log files via a secure Node.js API.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published