WebTail is just a tail to a file that you can watch from the UI. There's 3 parts to the project. UI, Server & Client. Here client is the one who connects from servers/pods/instances to push data to the server. Both Server & Client are rust applications. Server has a simple actix server. Client is Svelte application.
tail
for the application I want to check logs of.Server will serve the UI and will act as a router for the data coming in from clients, server will expose web sockets for clients to connect and send the live feed, and expose SSE end points for UI users to connect and get the application log. Users can select an application from the drop down to look at the logs of the application (application - server/pod/instance).
clone the repository
and setup submodule.
git clone https://github.com/uratne/webtail
cd webtail
git submodule init
git submodule update
UI is in the fronentd
directory.
As the above document shows we can up a vite server using
npm run dev
cargo run --bin client
cargo run --bin server
main.rs
will give you these commands.cargo run
Currently Server is also a binary, later server and ui will be packaged togeather in a container for simpler deployment
.env
to the directory you are running server fromPATH_TO_FRONTEND
in .env
should point to the build direrctory of the frontendconfigure webtail_config,json
app_name
, can be a SinglePod application or MultiplePod (instance) application. If it's MultiplePod set the pod_name also, this application name and pod name will be shown in the front end to select. log_file_dir
, is the relative/absolute path to the log file you want to taillog_file_name_regex
, is the name of the file, regex is accepted here. If you are using a regex first found file will be tailed. Regex is allowed as for some reason log files are named with data time or something.server_host
, is the host to connect to the serverserver_port
, is the port to connect to the server, set 0 to the port if a port is not requiredserver_path
, is the path to connect to the serverIf server_port
> 0
ws://
server_host
:server_port
/server_path
If server_port
== 0
ws://
server_host
/server_path
7.channel_buffer
is the buffer size of the tokio::mpsc::channel
, leave it between 10-100
add webtail_config.json
to the directory you are running client from
run client
borsh
.SIGTERM
for client and end web socket gracefully.