Coder Social home page Coder Social logo

monitorr / logarr Goto Github PK

View Code? Open in Web Editor NEW
275.0 275.0 12.0 5.91 MB

“Logarr” is a self-hosted PHP web app that consolidates, formats, and displays log and text files for easy analysis and monitoring.

Home Page: https://github.com/Monitorr

License: MIT License

PHP 35.62% JavaScript 44.46% CSS 19.92%
docker front-end html log-consolidation logarr logging php self-hosted webserver

logarr's Introduction

monitorr

- Monitorr is a webfront to live display the status of any webapp or service

GitHub Master-release [MASTER]

Docker build [DOCKER]

GitHub (pre-)release [DEVELOP]

NOTICE (27 June 18): If updating to version 1.7 from ANY previous version, BEFORE updating backup your custom.css file located at: [Monitorr install path]/assets/data/css/custom.css . After the update is complete, simply restore the custom.css file to the same location overwriting the custom.css file that was updated. This is due to a bug which has been resolved in version 1.7 therefore this process will no longer be needed in future updates. See the WiKi Update Notice for more information.

Features:

Latest major change: Multi HD display / Service ping response time display

  • LIVE! (w/ option to pause live updating)
  • Self-hosted.
  • Responsive mobile display.
  • Monitor any app/service on any domain (Curl as primary check, fsockopen as fallback).
  • Enable/disable hot linking for each service.
  • Service ping response time display. (NEW)
  • Host system resources display (CPU, MEM, HD, PING, Uptime) (UPDATED)
  • Integrated settings page w/ authentication.
  • User customizable system threshold colors.
  • Custom CSS tool. (NEW)
  • Server DTG data. (UPDATED)
  • Update tool via web UI / branch switching w/ update notification.
  • Minimal UI for iFrame displays. (See: WIKI)

Features in development:

Screenshots:

Monitorr Screenshot

Mobile:

Monitorr Mobile SS

Prerequisites:

  1. PHP (7.1+ recommended)
  2. PHP cURL
  3. PHP ZipArchive
  4. PHP PDO
  5. SQLite
  6. GIT (Recommended for Windows hosts (see wiki)

Quick Start:

  1. Clone/download the Monitorr repository to your webserver. (Docker image available here: Docker build )
  2. Browse to: [localhost\domain]/monitorr/index.php
  3. Establish data directory, and user database via secure registration tool.
  4. Log in and configure Monitorr via secure settings UI.
  5. Chill

Feature Requests:

Feature Requests

Current feature requests:

Feature Requests

Connect:

About Us:

Credits:

- Causefx - christronyxyocum - rob1998 - Roxedux -

Libraries used in this project:

logarr's People

Contributors

jonathanfinley avatar rob1998 avatar roxedus avatar seanvree avatar tronyx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

logarr's Issues

Required Permissions

Your environment:

  • Operating system: Lubuntu
  • Webserver: NGIX v. 3.8
  • PHP Version: 7.2.1 x64 NTS
  • Logarr Branch: Develop

Describe your issue:

Hello,
What permissions are needed for logarr to display the log files?
(Sorry if this has been covered already)
Cheers

BUG: HMTL data from table is inherited on main PHP page

BUG:

If one of the loggers contains certain HTML in their LOG - the main PHP wrapper will inherit that code making the parent PHP page display incorrectly. (see screenshot below)

Workaround:
Determine where the parent PHP page starts displaying incorrectly, and manually CLEAR the target offending LOG file. You DO NOT need to delete the log, just open the log file and delete it's contents.

NOTE: If this is a common occurrence with a specific logger, MOVE the offending logger's LOG path to the end of LOG path list in your index.php file, example:

//Add Logs Here
$logs = array(
    "Radarr" => 'C:\ProgramData\Radarr\logs\radarr.txt',
    "MP4 Converter" => 'C:\sickbeard_mp4_automator\info.log',
    "Headphones" => 'C:\logs\headphones\headphones.log',
    "Sonarr" => 'C:\ProgramData\NzbDrone\logs\sonarr.txt',
    "SABNZBd" => 'C:\sabnzbd\logs\sabnzbd.log',
    "NZBHydra" => 'C:\logs\nzbhydra\nzbhydra.log',
  "Sonarr" => 'C:\ProgramData\NzbDrone\logs\sonarr.txt',
);

IN example below, SONARR is making the PHP wrapper page display incorrectly.

Screenshot:

logarrdisplayerror

FEAT: Searching indicator (in progress)

Issue: if user has a lot of logs, and triggers a search, it may take several seconds to complete, however, there is no searching indicator.

Suggestion: Add some type of searching indicator if possible.

FEAT: Support Docker Logs

It would be great if Logarr could support logs from Docker containers. I was able to successfully print the logs for a container (named 'logarr' in this instance) by running:

curl --unix-socket /var/run/docker.sock "http://localhost/v1.24/containers/logarr/logs?stdout=1"

This is with curl, but Go and Python are both supported as well. If there were an option in the config file to set the container name, the Docker API could be used to pull the logs.

Some information:
https://docs.docker.com/engine/api/get-started/#print-the-logs-of-a-specific-container

test

Your environment:

  • Operating system: Windows 10P x65 build: 1709

  • Webserver: NGIX v. 3.8

  • PHP Version: 7.2.1 x64 NTS

  • Logarr Branch: Develop

Describe your issue:

test

FEAT: Search function

To DO:

  • Add # of results from search output below search box
  • "ENTER" key to search?
  • How to clear search result highlighting w/o refreshing the page

FEAT: Auto-refreshhhhhh!!!!

Feature: Auto update logs

STATUS: TESTING

Current Branch: DEVELOP

  • (OK) Development
  • (OK) Functionality
  • (OK) UI: Browser
  • (OK) Test: Windows
  • (OK) Test: Linux
  • (OK) UI Android
  • (OK) UI iOS
  • (OK) Pushed to DEV
  • (Pending) Merged with master
  • (Pending) Release published

mon_dev

FEAT: Use dynamically named log files?

Issue: If the application does not use static file names, how do we use the "lastest" log file, i.e. application-date.txt?

Possible solution:

// Ombi Fix
$files = scandir('/config/logs/ombi', SCANDIR_SORT_DESCENDING);
$ombi = '/config/logs/ombi/' . $files[0];

"Ombi" => $ombi,

NOTE: This above code addition WILL work, the problem is that SOME applications update several log files in a single DIR location. For example, PLEX, which updates 3 different logs files in the same DIR in parallel. plex.log, plex.errors.log, plex.debug.log, etc etc.

credit: @Fma965

FEAT: Clear search results/highlighting

Issue: User must refresh page in order to 'clear' search results/highlighting.

Suggestion: Implement a feature to clear search results/highlighting w/o having to refresh page.

FEAT: increase padding

i often find myself scrolling trough logs instead of the page, so when i want the log of the bottom i start to scroll the log before the actual page. to not do this i need to move my coursor, this is fine, but i find it requireing too much effort with the smal padding.

BUG: Display Log File Size

Not sure if this is possible, but would be good to add a display of how large (in size) or how many lines the log file is.

FEAT: Multi-wide mode!

credit: Fma965

Pretty dope "wide mode" using flex.

master...Fma965:master

        <div id="logcontainer">

            <div id="logwrapper">
                <div class="flex">
                    <?php foreach ($logs as $k => $v) { ?>
                        <div class="flex-child">
                            <div id="logs">

                                <div class="row2">

                                    <div id="filepath" class="left">
                                        <strong><?php echo $v; ?></strong>
                                    </div>

                                    <div id="header" class="w3-container w3-center">
                                        <h3><span class="header"><strong><?php echo $k; ?>:</strong></span></h3>
                                    </div>

                                    <div id="filesize"  class="right">
                                        Log File Size: <strong> <?php echo human_filesize(filesize($v)); ?></strong>
                                    </div>

                                </div>

                                <div class="slide">
                                    <input class="toggle" type="checkbox" id="<?php echo $k; ?>" checked>
                                    <label for="<?php echo $k; ?>"></label>
                                        <div id="expand" class="expand">
                                            <p><?php readExternalLog($v); ?></p>
                                        </div>
                                </div>

                            </div>
                        </div>
                    <?php } ?>
                </div>
            </div>
                
        </div>

CSS:

.flex {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
}

.flex-child {
    max-width: 1900px;
    min-width: 1000px;
    flex: 1 1 0;
}

image

Add WIKI

Subjects:

USAGE
1 - Ensure your logs are rolling over !!!!
2 - Ensure your logs are rolling over !!!!
3 - log files size
4 - Auto update
a. update interval - NO LESS THAN 10 seconds!
b. size of logs has huge impact.
c. browser UI/DOM LOCKED during update/search - by design.
4 - sensitive data in logs / exposing to WAN

CONFIG

  • PHP

  • Cloning repo to SUB DIR of webserver

  • Symlink method:

a. Hardlink ("mklink /d"): - If user keeps all logs in consolidated location and uses a HARD LINK - to target log file ie, C:\logs\sonarr\sonarr.txt -> c:\programdata\sonarr\sonarr.txt then IF the log is "rolled over" by way of deleting the original log file (as opposed to overwriting the data in the same file and re-creating it), the link will break, and Logarr will show the outdated log data that is left over in the dead file link (C:\logs\sonarr.txt).
Advantage: Logarr will always show true log file size as long as file link is valid
Disadvantage: If logs are rolled over frequently, Logarr MAY display outdated log data.

b. Softlink ("mklink"): If user uses the soflink method, and the log is "rolled over" using ANY method, as long as the target file name stays the same, Logarr will always display the latest log file data. HOWEVER - Log file sizes will always show 0KB in the webui.

c. user chooses to simply use the original log file path in the Logarr config file, and NOT use file linking at all, none of the above applies.

  • Webserver CONFIGs
    a. Protecting via nginx with .htaccess
    b. Protecting via org auth
    c. Static/dynamic compression?

FAQ:
1 - Why is the UI deformed with weird HTML?
a) programs that include HTML in raw text. See: #8
2 - Why are log files outdated in Logarr but NOT in application logs?
a) Symlink method used (See Config)
3 - Mobile browsing: May or may not work... not designed for mobile due to the large amounts of data that is xfered.
4) How to add dynamically-named log files: see #57

Docker Image

I made a basic Docker image available at kmlucy/docker-logarr. If you guys want to link to it as another way to run Logarr, you are more than welcome to.

FEAT: Add Catagories

If you are monitoring a lot of files, it would be great to be able to put them on different pages. For example, you could have a webserver page with Apache, PHP, NGINX, etc., a media page with Plex, Radarr, Sonarr, Ombi, etc. That way you don't have one huge page with dozens of log files.

BUG: HTML in Log Files Breaks Site

My log files for Jackett contain html, and specifically the problem is that they contain magnet links. EX:

System.Exception: Error while parsing field=download, selector=td > a[href^="/file"], value=<null>: Selector "td > a[href^="/file"]" didn't match <tr>   <td style="word-wrap: break-word;"> <a href="***" title="***">***</a>       <img alt="Verified" title="Verified and marked" src="/images/verified.png" width="20" height="20">                         <br>             <a href="magnet:?xt=urn:***" rel="nofollow"> <img alt="Download *** using magnet link" title="Download *** using magnet link" src="/images/magnet.svg" width="16" height="16">
                </a>  Uploaded 2 days ago Size 1.9 GB</td>
        <td class="is-hidden-touch">1.9 GB</td>
        <td class="is-hidden-touch" style="text-align: center;">6</td> <td class="is-hidden-touch" style="text-align: center;">2 days ago</td>
        <td style="text-align: center;">1492</td>
        <td style="text-align: center;">1110</td>
</tr>

Because of this, everything below this log file functions as the embedded link. There needs to be some way to negate any html that happens to be in the log files.

FEAT: Normalize time stamps

set a standard format for date/time so you're not stuck with the default log format.

... then create a settings gui just so the Europeans can change it to whatever nonsense they want :)

FEAT: Integrated Settings Page

Feature: Integrated Settings Page

STATUS: In development

Current Branch: ALPHA

Progress:

  • (Pending) Development
  • (Pending) Functionality
  • (Pending) Pushed to Alpha
  • (Pending) Test: Windows
  • (Pending) Test: Docker
  • (Pending) Test: Linux
  • (Pending) UI Android
  • (Pending) UI iOS:
  • (Pending) Merged to DEV
  • (Pending) Merged with master
  • (Pending) Release published

Individual setting pages:

  1. Info:
  1. User Preferences:
  • Site Title
  • Site URL
  • Time Standard
  • Time Zone
  • Update Branch
  • [ NA] Language (I think we should remove this unless we can find a solution - SEANVREE) (future update - Rob)
  • Custom CSS
  • Custom JS
  1. Logarr Settings:
  • Refresh log
  • Refresh config
  • Refresh Time
  • Auto refresh logs on/off
  • Jump on Search
  • Default max lines value
  • Auto highlight errors on/off
  1. Authentication:
  • Datadir
  • Enable/Disable on logs
  • Enable/Disable on settings
  • Enable/Disable registration
  1. Logs:
  • Ttitle
  • Path
  • dynamic path (regex)
  • Max line limit
  • Auto role file size
  • Category
  • Custom error terms highlight on load ??

FEAT: Add scroll to top button

Feature: Add scroll to top button

STATUS: Pre-dev

Current Branch: n/a

  • (pending) Development
  • (pending) Functionality
  • (pending) Test: Windows
  • (Pending) Test: Linux
  • (Pending) UI Android: N/A
  • (Pending) UI iOS: N/A
  • (Pending) Pushed to DEV
  • (Pending) Merged with master
  • (Pending) Release published

FEAT: Add Light Theme

Add LIGHT theme, Dark to stay default.

P.S. I don't want to get into theming here as this project's goal is to stay "minimal" but I think adding a LIGHT them, and Possibly one more would be beneficial.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.