Logarr – A self-hosted, single-page, log consolidation tool written in PHP and HTML

0

Super simple logs with Logarr

In this guide I will explain how to integrate Logarr into the letsencrypt/nginx container on unRAID.

Go and thank seanvree for creating this awesome tool!

Installation

Start by going to https://github.com/seanvree/logarr/ and download the ZIP. I went with the develop branch as I wanted the latest features.

  1. Create a new folder called “logarr inside the “www” folder in the letsencrypt container directory.
  2. Extract the files into the logarr folder. The path should then be: /www/logarr/index.php
  3. Go to your letsencrypt container settings and add a new path with these settings.
    • Name: logs
    • Container Path: /logs
    • Host Path: This can for example be /your/containers/installdirectory <– This is the location of the different log files i.e /mnt/cache/appdata/
    • Access Mode: Read Only
    • Description: log path for Logarr
  4. Add your custom subdomain

You can of course create a path for each specific log file location, but I didn’t bother with that.

Letsencrypt logarr

letsencrypt subdomain

Nginx config

Go to your nginx config file and add the subdomain block below your Main server block in nginx. Remember to edit the server_name.

The

 if ($cookie_cookiePassword != “yourcookiepasswordhere“) { return 401; } 

is the cookiepassword in Org or otherwise. So remember to remove that if you are not using cookie password.

The subdomain server block


#LOGARR 
server {
listen 80; 
listen 443 ssl http2;
server_name sub.domain.com;

root /config/www/logarr/;
index index.html index.php;
if ($cookie_cookiePassword != "yourcookiepasswordhere") { return 401; }
location / {
try_files $uri $uri/ /index.php?_url=$uri&$query_string;
}

location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
# With php7-cgi alone:
fastcgi_pass 127.0.0.1:9000;
# With php7-fpm:
#fastcgi_pass unix:/var/run/php7-fpm.sock;
fastcgi_index index.php;
include /etc/nginx/fastcgi_params;
}

fastcgi_buffer_size 4K;
fastcgi_buffers 64 4k; 
}

If you want to use sub directory:


# LOGARR
location /logarr {
#auth_request /auth-admin; 
root /config/www;
index index.php;
include /config/nginx/php.conf;
}

As you can see in the sub directory you have to include a php.conf file.
Add that file in your nginx folder

In the file add this:


location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
# With php7-cgi alone:
fastcgi_pass 127.0.0.1:9000;
# With php7-fpm:
#fastcgi_pass unix:/var/run/php7-fpm.sock;
fastcgi_index index.php;
include /etc/nginx/fastcgi_params;
}

Adding logs

In your logarr folder there is a config.php file in the config folder. Follow the instruction inside the file. I recommend using Notepad++

I only added logs for Sonarr, Radarr and plexpy so my paths looked like this:


$logs = array(
"Sonarr" => '/logs/sonarr/logs/sonarr.txt',
"Radarr" => '/logs/radarr/logs/radarr.txt',
"Plexpy" => '/logs/plexpy/logs/plexpy.log',

/logs is the folder path you created earlier in your letsencrypt settings, so this links directly to the host path you specified. So if your host path to your container is /mnt/cache/appdata/sonarr The path in the php file should be /logs/sonarr/logs/sonarr.txt

Chill

Go to your subdomain and it should look like this:

logs

And if you’re wondering why the icon looks different it’s because I changed it to look like the other arr logos.

logo

W.

Weyland

Share

%d bloggers like this: