From 4ab22dc98e0e1c69662230bd767f211d9b398092 Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Thu, 18 Apr 2024 12:49:48 +0200 Subject: [PATCH] docs: quickstart: add configure logging section Add a section that explains how to fix duplicate timestamps in journalctl. --- docs/_docs/guide/01-quickstart.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/docs/_docs/guide/01-quickstart.md b/docs/_docs/guide/01-quickstart.md index fa11e1eb9..9f8d93169 100644 --- a/docs/_docs/guide/01-quickstart.md +++ b/docs/_docs/guide/01-quickstart.md @@ -428,6 +428,34 @@ $ sudo systemctl restart open5gs-amfd $ sudo systemctl restart open5gs-upfd ``` +#### Configure logging + +The Open5GS components log to `/var/log/open5gs/*.log` and to `stderr` by +default. + +##### Avoid duplicate timestamps in journalctl + +Open5GS adds timestamps to each log line in the log file, and on `stderr`. If +you run Open5GS with systemd and prefer looking at the logs with `journalctl`, +then each line will have two timestamps. To fix this, disable the timestamp for +`stderr` with the following configuration change: + +```diff +diff --git a/configs/open5gs/mme.yaml.in b/configs/open5gs/mme.yaml.in +index 87c251b9d..599032b8a 100644 +--- a/configs/open5gs/mme.yaml.in ++++ b/configs/open5gs/mme.yaml.in +@@ -1,6 +1,9 @@ + logger: ++ default: ++ timestamp: false + file: + path: /var/log/open5gs/mme.log ++ timestamp: true + # level: info # fatal|error|warn|info(default)|debug|trace + + global: +``` #### Register Subscriber Information ---