The default location of logs is
/var/log/memgraph/memgraph.log but it can be
changed using the
--log-file configuration flag.
Memgraph tracks logs at various levels: TRACE, DEBUG, INFO, WARNING, ERROR,
CRITICAL. By default, it is using the WARNING level, but you can change the
level using the
configuration file or during
runtime using the
SET DATABASE SETTING "log.level" TO "WARNING";
The configuration set during runtime will be applied only for that session.
You can check the log level by running
SHOW DATABASE SETTING "log.level"; query.
If you are using Memgraph Lab, you can access the Logs from the interface if the port 7444 was exposed when running the instance.
If you installed Memgraph with Linux, logs can be found in the
If you installed Memgraph using Docker:
Open a new terminal and find the
CONTAINER ID of the Memgraph Docker
Run the following command:
docker exec -it <CONTAINER ID> bash
Be sure to replace the
<CONTAINER ID> parameter.
Position yourself in the
To list the content of the log, use the
cat /var/log/memgraph/<memgraph_date>.log command.
For example, if the
ls command returned
memgraph_2022-03-04.log you would
list the contents using the following command:
If you want to save the log to your computer, exit the container with
exit, place yourself in a directory where you want to save the copy and run
the following command:
docker cp <memgraph_date>.log <CONTAINER ID>:/var/log/memgraph/<memgraph_date>.log
For example, the following command will make a copy of the
memgraph_2022-03-04.log file on the user's desktop:
C:\Users\Vlasta\Desktop>docker cp memgraph_2022-03-04.log bb3de2634afe:/var/log/memgraph/memgraph_2022-03-04.log.log