dotnetcore 3.1 linux service code example

Example 1: asp.net core linux systemd

sudo cp AspNetSite.service /etc/systemd/system/AspNetSite.service
sudo systemctl daemon-reload

Example 2: asp.net core linux systemd

sudo journalctl -u AspNetSite #query all output, oldest to newest
sudo journalctl -u AspNetSite -f #query all output and follow live
sudo journalctl -u AspNetSite -r #query all output, newest to oldest
sudo journalctl -u AspNetSite --since="2020-01-17 11:00:00" --until="2020-01-17 11:15:00" #filter by time