manual: Document the logging configuration

Change-Id: I66f5fe2e55c7e4cb6cc8ce09dcd8a636c717a5a0
This commit is contained in:
Harald Welte 2021-12-09 12:56:27 +01:00
parent 5a3a0b16a0
commit 6a93cfb1e9
5 changed files with 90 additions and 6 deletions

View File

@ -0,0 +1,58 @@
[[remsim_logging]]
== osmo-remsim logging
All programs within the osmo-remsim project use the logging sub-system of `libosmocore`.
Contrary to the larger Osmocom projects with their own VTY + configuration file, the
logging configuration for osmo-remsim programs must happen via command line arguments.
Also, contrary to the larger Osmocom projects, only logging to `stderr` is supported;
no direct logging to log files, syslog, systemd, etc. is supported at this point.
=== `-d` command line argument
Every osmo-remsim program like `osmo-remsim-bankd`, `osmo-remsim-server` or
`osmo-remsim-client-st2` supports a `-d` command line argument. This argument
takes one mandatory parameter configuring the log level for each log sub-system
as follows:
`-d SUBSYS,num_lvl[:SUBSYS,num_lvl[:...]]`
So basically, a colon-separated list of tuples, where each tuple contains the
sub-system name and the _numeric_ log level.
Below is the list of sub-systems and a table of numerical levels:
.libosmocore log levels and their numeric values
[options="header",width="30%",cols="1,1"]
|===
|Level name|Numeric value
|DEBUG|1
|INFO|3
|NOTICE|5
|ERROR|7
|FATAL|8
|===
.osmo-remsim log sub-system names and their description
[options="header",width="50%",cols="1,2"]
|===
|Sub-System Name|Description
|DMAIN|respective main program code
|DST2|SIMtrace2 `cardem` firmware interaction via USB
|DRSPRO|RSPRO protocol between bankd, server and client
|DREST|REST interface of `osmo-remsim-server`
|DSLOTMAP|slotmap code shared by `osmo-remsim-server` and `osmo-remsim-bankd`
|DBANKDW|worker threads of `osmo-remsim-bankd`
|===
=== Example
Putting the above in a concrete example:
`-d DMAIN,5:DRSPRO,1`
would perform the following configuration:
* log only NOTICE (or higher) messages in the DMAIN subsystem (low verbosity)
* log DEBUG (or higher) messages in the DRSPRO subsystem (very high verbosity)

View File

@ -61,12 +61,16 @@ approach seems to make more sense.
==== SYNOPSIS ==== SYNOPSIS
*osmo-remsim-bankd* [-h] [-i A.B.C.D] [-p <1-65535>] [-b <1-65535>] [-n <1-65535>] [-I A.B.C.D] [-P <1-65535> ] *osmo-remsim-bankd* [-h] [-V] [-d LOGOPT] [-i A.B.C.D] [-p <1-65535>] [-b <1-65535>] [-n <1-65535>] [-I A.B.C.D] [-P <1-65535> ]
==== OPTIONS ==== OPTIONS
*-h, --help*:: *-h, --help*::
Print a short help message about the supported options Print a short help message about the supported options
*-V, --version*::
Print the software version number
*-d, --debug LOGOPT*::
Configure the logging verbosity, see <<remsim_logging>>.
*-i, --server-host A.B.C.D*:: *-i, --server-host A.B.C.D*::
Specify the remote IP address/hostname of the `osmo-remsim-server` to Specify the remote IP address/hostname of the `osmo-remsim-server` to
which this bankd shall establish its RSPRO control connection which this bankd shall establish its RSPRO control connection
@ -83,7 +87,7 @@ approach seems to make more sense.
Specify the local IP address to which the socket for incoming connections Specify the local IP address to which the socket for incoming connections
from `osmo-remsim-clients` is bound to. from `osmo-remsim-clients` is bound to.
*-P, --bind-port <1-65535>*:: *-P, --bind-port <1-65535>*::
Specify the local TCP port to whicc the socket for incoming connections Specify the local TCP port to which the socket for incoming connections
from `osmo-remsim-client`s is bound to. from `osmo-remsim-client`s is bound to.
==== Examples ==== Examples

View File

@ -72,7 +72,11 @@ osmo-remsim-client-st2 currently has the following command-line options:
*-h, --help*:: *-h, --help*::
Print a short help message about the supported options Print a short help message about the supported options
*-s, --server-host A.B.C.D*:: *-V, --version*::
Print the software version number
*-d, --debug LOGOPT*::
Configure the logging verbosity, see <<remsim_logging>>.
*-i, --server-ip A.B.C.D*::
Specify the remote IP address / hostname of the `osmo-remsim-server` to Specify the remote IP address / hostname of the `osmo-remsim-server` to
which this client shall establish its RSPRO control connection which this client shall establish its RSPRO control connection
*-p, --server-port <1-65535>*:: *-p, --server-port <1-65535>*::
@ -220,6 +224,8 @@ osmo-remsim-client-shell currently has the following command-line options:
Print a short help message about the supported options Print a short help message about the supported options
*-v, --version*:: *-v, --version*::
Print the compile-time version information Print the compile-time version information
*-d, --debug LOGOPT*::
Configure the logging verbosity, see <<remsim_logging>>.
*-i, --server-ip A.B.C.D*:: *-i, --server-ip A.B.C.D*::
Specify the remote IP address / hostname of the `osmo-remsim-server` to Specify the remote IP address / hostname of the `osmo-remsim-server` to
which this client shall establish its RSPRO control connection which this client shall establish its RSPRO control connection

View File

@ -13,11 +13,25 @@ bind to INADDR_ANY and offer the following TCP ports:
It is intended to make these settings (IP addresses, ports) configurable It is intended to make these settings (IP addresses, ports) configurable
in future versions. in future versions.
==== SYNOPSIS
*osmo-remsim-server* [-h] [-V] [-d LOGOPT]
==== OPTIONS
*-h, --help*::
Print a short help message about the supported options
*-V, --version*::
Print the software version number
*-d, --debug LOGOPT*::
Configure the logging verbosity, see <<remsim_logging>>.
=== Logging === Logging
`osmo-remsim-server` currently logs to stdout only, and the logging `osmo-remsim-server` currently logs to stderr only; the logging
verbosity is not yet configurable. However, as the libosmocore logging verbosity is configurable via command line argument only. However, as
framework is used, extending this is an easy modification. the libosmocore logging framework is used, extending this is an easy
modification.
[[rsres]] [[rsres]]
=== RESTful/JSON Web API === RESTful/JSON Web API

View File

@ -16,6 +16,8 @@ include::{srcdir}/chapters/remsim-client.adoc[]
include::{srcdir}/chapters/remsim-bankd.adoc[] include::{srcdir}/chapters/remsim-bankd.adoc[]
include::{srcdir}/chapters/logging.adoc[]
include::{srcdir}/chapters/rspro.adoc[] include::{srcdir}/chapters/rspro.adoc[]
//include::./common/chapters/vty.adoc[] //include::./common/chapters/vty.adoc[]