-
-
Notifications
You must be signed in to change notification settings - Fork 89
Setup Log Viewer
Daniel Tischner edited this page Oct 13, 2021
·
1 revision
The logviewer module is a Spring + Vaadin Web-Application in which one can see the logs written by the applications in real-time.
In the following, we explain how to set the website up and how to host it.
- First you need a Discord application, you can use the same also used for the main application. See Create Discord server and bot for details on how to create one.
- Open the Applications Section from Discord
- Open your Application
- Open the OAuth2 Tab
- Add a Redirect Link, e.g.
https://localhost:443/login/oauth2/code/github
- Save your changes
- Create a
config.json
file in the directory of the logviewer moduleTJ-Bot/logviewer/config.json
. Alternatively you can place it wherever you want and provide the path to the file as a start-argument. The content of the file should be like this (fill in the Discord data):
{
"clientName": "<DISCORD_APPNAME>",
"clientId": "<DISCORD_OAUTH2_CLIENTID>",
"clientSecret": "<DISCORD_OAUTH2_SECRET>",
"rootUserName": "<YOUR_DISCORD_USERNAME>",
"rootDiscordID": "<YOUR_DISCORD_ID>",
"logPath": "application/logs",
"databasePath": "logviewer/db/db.db",
"redirectPath": "https://localhost:443/login/oauth2/code/github"
}
-
clientName
is the name of your Discord Application -
clientId
is the clientId you can copy in the OAuth2 Tab from Discord -
clientSecret
is the secret you can copy in the OAuth2 Tab -
rootUserName
is your own Discord username -
rootDiscordID
is your own Discord ID, enable Developer Mode in your Discord App and right-click on one of your own posts -
logPath
is the path to the logs from the Bot, not for this application -
databasePath
is the path where the database for this Web-Application should be saved -
redirectPath
is the URL you used in the Discord OAuth2 Settings
- You are done, start the application. Open your browser on https://localhost:443 and accept the Authorization.
On the left side you can see three views.
- Logs displays the actual logfiles as they are in the configured directories.
- Streamed displays the log-events as the main application sends them to the web application.
- User-Management enables adding or removing users who can access this website and editing their roles (right click the panel).