Skip to content

aluminumio/log-viewer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

Aluminumio Log Viewer

A modern web-based log viewer for Busl streaming servers. View logs in real-time with syntax highlighting, search, and download capabilities.

Features

  • 🚀 Real-time log streaming via Server-Sent Events (SSE)
  • 🎨 Syntax highlighting for log levels (ERROR, WARN, INFO, SUCCESS)
  • 💾 Download logs as text files
  • 🔍 Auto-detection of log levels
  • 📱 Responsive design for mobile and desktop
  • 🔄 Auto-reconnect on connection loss
  • 🕒 Timestamps for each log entry
  • 🗑️ Clear logs functionality
  • 💾 Remembers server URL preference

Usage

Quick Start

  1. Open index.html in a web browser
  2. Enter your Busl server URL (e.g., http://localhost:5001)
  3. Enter a stream ID
  4. Click "Connect"

Direct URL Access

You can link directly to a stream:

file:///path/to/index.html?stream=your-stream-id

Deployment Options

Static File Server

# Using Python
python3 -m http.server 8080

# Using Node.js
npx http-server -p 8080

# Using nginx
server {
    listen 80;
    server_name logs.example.com;
    root /var/www/log-viewer;
    index index.html;
}

GitHub Pages

  1. Push to a GitHub repository
  2. Enable GitHub Pages
  3. Access at https://username.github.io/repo-name/?stream=your-stream-id

Docker

FROM nginx:alpine
COPY index.html /usr/share/nginx/html/
EXPOSE 80

Configuration

The viewer stores preferences in localStorage:

  • busl-server: Last used server URL

Keyboard Shortcuts

  • Enter in stream ID field: Connect
  • Ctrl/Cmd + K: Clear logs (when focused)

Integration Examples

Embed in Your App

<iframe 
    src="https://logs.yourcompany.com/?stream=build-123" 
    width="100%" 
    height="600"
    frameborder="0">
</iframe>

Link from CI/CD

[View Build Logs](https://logs.yourcompany.com/?stream=build-${BUILD_ID})

Bookmarklet

Create a bookmarklet to quickly open logs:

javascript:(function(){
    const streamId = prompt('Enter stream ID:');
    if(streamId) window.open('https://logs.yourcompany.com/?stream=' + streamId);
})();

Customization

Changing Colors

Edit the CSS variables in the <style> section:

/* Dark theme colors */
body {
    background: #0d1117;
    color: #c9d1d9;
}

/* Log level colors */
.log-entry.error { color: #f85149; }
.log-entry.warning { color: #d29922; }
.log-entry.info { color: #58a6ff; }
.log-entry.success { color: #3fb950; }

Adding Features

The viewer is a single HTML file for easy customization:

  • Add search functionality
  • Implement log filtering
  • Add export to JSON
  • Create custom themes

Security Considerations

  • The viewer connects directly to your Busl server
  • No data is sent to external services
  • Supports HTTPS connections
  • Basic auth is handled by the browser

Browser Support

  • Chrome/Edge: Full support
  • Firefox: Full support
  • Safari: Full support (iOS 11+)
  • Internet Explorer: Not supported

Troubleshooting

Connection Issues

  • Verify the Busl server is running
  • Check for CORS headers on the server
  • Ensure the stream ID exists
  • Try using the server IP instead of hostname

Performance

  • The viewer keeps the last 10,000 log entries
  • Older entries are automatically removed
  • Download logs before they're rotated out

License

MIT License - see LICENSE file for details

About

Web-based real-time log viewer for Busl streams

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages