Skip to content

ErickFG08/LogLens

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

22 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ” LogLens

A modern log viewer for Posit Connect
Browse, filter, and search job logs from your Posit Connect server โ€” all from a beautiful R Shiny interface.

Quick Start ยท Features ยท Project Structure ยท Development


โœจ Features

Feature Description
๐Ÿ”— Auto-Connect Connects to Posit Connect on startup via environment variables โ€” no manual setup inside the app
๐Ÿ“ฆ Content & Job Browser Lists all deployed content and their associated jobs in a searchable sidebar
๐Ÿท๏ธ Log Classification Automatically classifies every line into ERROR, WARN, INFO, DEBUG, TRACE, STDOUT, or STDERR
๐ŸŽ›๏ธ Interactive Filters Toggle log levels on/off with colour-coded filter chips
๐Ÿ”Ž Full-Text Search Instantly search across all log messages with a free-text input
๐Ÿ“Š Summary Counters At-a-glance severity breakdown with colour-coded count badges
๐ŸŒ— Dark / Light Theme One-click toggle with preference saved to localStorage
๐Ÿ“‹ Paginated Table High-performance reactable table with customisable page sizes (50 / 100 / 250 / 500)

๐Ÿ—๏ธ Tech Stack

  • Rhino โ€” enterprise-grade R Shiny framework
  • bslib (Bootstrap 5) โ€” theming and layout
  • reactable โ€” interactive data tables
  • connectapi โ€” Posit Connect API client
  • Sass (via Node) โ€” premium design system with CSS custom properties
  • Cypress โ€” end-to-end testing
  • GitHub Actions โ€” CI pipeline for linting, building, and testing

๐Ÿ“‹ Prerequisites

Dependency Version
R โ‰ฅ 4.1
renv (bundled)
Node.js โ‰ฅ 20
npm โ‰ฅ 9

You also need a running Posit Connect server and a valid API key.

๐Ÿš€ Quick Start

1. Clone & Install R Dependencies

git clone <your-repo-url> LogLens
cd LogLens
Rscript -e "renv::restore()"

2. Install Node Dependencies

cd .rhino
npm ci
cd ..

3. Configure Environment Variables

Create a .Renviron file in the project root (it's git-ignored):

CONNECT_SERVER=https://your-connect-server.example.com
CONNECT_API_KEY=your-api-key

4. Build Frontend Assets

Rscript -e "rhino::build_js(); rhino::build_sass()"

5. Launch the App

Rscript -e "rhino::app()"

The app will open in your browser. Select a content item and job from the sidebar, then click Fetch Logs.

๐Ÿ—‚๏ธ Project Structure

LogLens/
โ”œโ”€โ”€ app/
โ”‚   โ”œโ”€โ”€ main.R                  # Root UI & server โ€” wires sidebar + log viewer
โ”‚   โ”œโ”€โ”€ js/
โ”‚   โ”‚   โ””โ”€โ”€ index.js            # Theme toggle (dark/light with localStorage)
โ”‚   โ”œโ”€โ”€ logic/
โ”‚   โ”‚   โ”œโ”€โ”€ connect_api.R       # Posit Connect API wrapper (connectapi)
โ”‚   โ”‚   โ””โ”€โ”€ log_parser.R        # Log parsing & severity classification
โ”‚   โ”œโ”€โ”€ styles/
โ”‚   โ”‚   โ””โ”€โ”€ main.scss           # Full design system (light + dark themes)
โ”‚   โ”œโ”€โ”€ static/                 # Static assets
โ”‚   โ””โ”€โ”€ view/
โ”‚       โ”œโ”€โ”€ sidebar.R           # Content/job selectors, connection status
โ”‚       โ””โ”€โ”€ log_viewer.R        # Filters, search, summary boxes, log table
โ”œโ”€โ”€ tests/
โ”‚   โ”œโ”€โ”€ testthat/               # R unit tests
โ”‚   โ””โ”€โ”€ cypress/                # End-to-end tests
โ”œโ”€โ”€ .github/
โ”‚   โ””โ”€โ”€ workflows/
โ”‚       โ””โ”€โ”€ rhino-test.yml      # CI: lint โ†’ build โ†’ test
โ”œโ”€โ”€ config.yml                  # Rhino app configuration
โ”œโ”€โ”€ dependencies.R              # Explicit package declarations for deployment
โ”œโ”€โ”€ renv.lock                   # Reproducible R dependency lockfile
โ”œโ”€โ”€ rhino.yml                   # Rhino framework config (sass: node)
โ””โ”€โ”€ app.R                       # Entry point (calls rhino::app())

๐Ÿ› ๏ธ Development

Run the App (Dev Mode)

Start the app on port 3333 (used by Cypress):

cd .rhino && npm run run-app

Lint

# All linters
Rscript -e "rhino::lint_r(); rhino::lint_js(); rhino::lint_sass()"

Unit Tests

Rscript -e "rhino::test_r()"

End-to-End Tests (Cypress)

cd .rhino && npm run test-e2e

CI Pipeline

The GitHub Actions workflow (.github/workflows/rhino-test.yml) runs automatically on pushes to main and on pull requests:

  1. Lint โ€” R, JavaScript, and Sass
  2. Build โ€” JavaScript and Sass compilation
  3. Test โ€” R unit tests + Cypress E2E

๐Ÿงฉ Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                      Browser                         โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
โ”‚  โ”‚  Sidebar   โ”‚  โ”‚         Log Viewer              โ”‚ โ”‚
โ”‚  โ”‚            โ”‚  โ”‚                                 โ”‚ โ”‚
โ”‚  โ”‚ โ€ข Content  โ”‚  โ”‚ โ€ข Summary counters              โ”‚ โ”‚
โ”‚  โ”‚   picker   โ”‚  โ”‚ โ€ข Level filter chips            โ”‚ โ”‚
โ”‚  โ”‚ โ€ข Job      โ”‚  โ”‚ โ€ข Free-text search              โ”‚ โ”‚
โ”‚  โ”‚   picker   โ”‚  โ”‚ โ€ข Paginated log table           โ”‚ โ”‚
โ”‚  โ”‚ โ€ข Fetch    โ”‚  โ”‚                                 โ”‚ โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
โ”‚        โ”‚                    โ”‚                        โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
         โ”‚                    โ”‚
    โ”Œโ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”
    โ”‚         Server (R)          โ”‚
    โ”‚                             โ”‚
    โ”‚  connect_api.R  log_parser  โ”‚
    โ”‚       โ”‚              โ”‚      โ”‚
    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”˜
            โ”‚              โ”‚
    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”  Parse & classify
    โ”‚ Posit Connectโ”‚  severity levels
    โ”‚   REST API   โ”‚
    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ“ Environment Variables

Variable Required Description
CONNECT_SERVER โœ… Full URL of your Posit Connect server
CONNECT_API_KEY โœ… API key with permissions to read content and logs
RHINO_LOG_LEVEL โŒ App-level logging threshold (default: INFO)
RHINO_LOG_FILE โŒ Path to write app logs to a file (default: console only)

๐Ÿค Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/my-feature)
  3. Make your changes and ensure linters + tests pass
  4. Commit (git commit -m "feat: add my feature")
  5. Push to your branch and open a Pull Request

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

โšก