<p>Vadim Yanitskiy <strong>uploaded patch set #5</strong> to this change.</p><p><a href="https://gerrit.osmocom.org/c/libosmocore/+/20045">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">logging: introduce experimental 'systemd-journal' target<br><br>This change implements 'systemd-journal' logging target, that is<br>similar to the existing 'syslog' target.  The key difference is<br>that 'systemd-journal' allows us to offload rendering of the meta<br>information, such as location (file name, line number), subsystem,<br>and logging level, to systemd.  Moreover, we can attach arbitrary,<br>user-specific fields [1] to the logging messages, so they can be<br>used for advanced log filtering (e.g. by IMSI/TMSI/TLLI):<br><br>  $ journalctl OSMO_SUBSYS=DMSC -f<br><br>Since we don't want to make libsystemd a required dependency, this<br>feature is optional, and needs to be enabled at build-time:<br><br>  $ ./configure --enable-systemd-logging<br><br>The new logging target can be configured in the same way as any<br>other one - via the VTY interface, or using the configuration file:<br><br>  log systemd-journal [raw]<br>    logging level set-all notice<br>    logging filter all 1<br><br>Two logging handlers are available: generic and raw.  The first one<br>behaves similarly to both 'syslog' and 'stderr', i.e. all the meta<br>information is rendered by libosmocore itself, and then passed to<br>systemd together with the logging message.  The later is more like<br>the 'gsmtap' target, so all available meta information is handed<br>over to systemd in form of fields [1]:<br><br>  - CODE_FILE / CODE_LINE - location info,<br>  - PRIORITY - syslog-compatible logging level,<br>  - OSMO_SUBSYS - Osmocom-specific sub-system (e.g. DMSC),<br>  - OSMO_SUBSYS_HEX - same as OSMO_SUBSYS, but encoded in hex,<br>  - MESSAGE - the logging message itself,<br><br>and then can be rendered in any supported format (e.g. JSON).<br><br>More details about the API can be found in [2].<br><br>[1] https://www.freedesktop.org/software/systemd/man/systemd.journal-fields.html<br>[2] https://www.freedesktop.org/software/systemd/man/sd-journal.html<br><br>Change-Id: I609f5cf438e6ad9038d8fc95f00add6aac29fb23<br>---<br>M configure.ac<br>M include/osmocom/core/logging.h<br>M src/Makefile.am<br>A src/logging_systemd.c<br>M src/vty/logging_vty.c<br>5 files changed, 211 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/45/20045/5</pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/libosmocore/+/20045">change 20045</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/libosmocore/+/20045"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: libosmocore </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I609f5cf438e6ad9038d8fc95f00add6aac29fb23 </div>
<div style="display:none"> Gerrit-Change-Number: 20045 </div>
<div style="display:none"> Gerrit-PatchSet: 5 </div>
<div style="display:none"> Gerrit-Owner: Vadim Yanitskiy <vyanitskiy@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: Vadim Yanitskiy <vyanitskiy@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-Reviewer: neels <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newpatchset </div>