title |
---|
Local |
In order to log events with Loki, you must download and install both Promtail and Loki.
- Loki is the logging engine.
- Promtail sends logs to Loki.
- Navigate to the release page.
- Scroll down to the Assets section under the version that you want to install.
- Download the Loki and Promtail .zip files that correspond to your system. Note: Do not download LogCLI or Loki Canary at this time. LogCLI allows you to run Loki queries in a command line interface. Loki Canary is a tool to audit Loki performance.
- Unzip the package contents into the same directory. This is where the two programs will run.
- In the command line, change directory (
cd
on most systems) to the directory with Loki and Promtail. Copy and paste the commands below into your command line to download generic configuration files:
wget https://raw.githubusercontent.com/grafana/loki/master/cmd/loki/loki-local-config.yaml
wget https://raw.githubusercontent.com/grafana/loki/master/cmd/promtail/promtail-local-config.yaml
- Enter the following command to start Loki:
Windows
.\loki-windows-amd64.exe --config.file=loki-local-config.yaml
Linux
./loki-linux-amd64 -config.file=loki-local-config.yaml
Loki runs and displays Loki logs in your command line and on http://localhost:3100/metrics.
Congratulations, Loki is installed and running! Next, you might want edit the Promtail config file to get logs into Loki.
Every release includes binaries for Loki which can be found on the Releases page.
The community provides packages of Loki for openSUSE Linux. To install:
- Add the repository
https://download.opensuse.org/repositories/security:/logging/
to your system. For example, if you are using Leap 15.1, runsudo zypper ar https://download.opensuse.org/repositories/security:/logging/openSUSE_Leap_15.1/security:logging.repo ; sudo zypper ref
- Install the Loki package with
zypper in loki
- Enable the Loki and Promtail services:
systemd start loki && systemd enable loki
systemd start promtail && systemd enable promtail
- Modify the configuration files as needed:
/etc/loki/promtail.yaml
and/etc/loki/loki.yaml
.