Include systemd-journal-gatewayd / -remote in TorizonCore

I was thinking of using the systemd-journal logger for my programs (there are several) instead of any 3-manufacturer loggers or developing something of my own. Also because I would like to see log entries concerning the system.

For an easy access to the logs without console I found systemd-journal-gatewayd which is included in the package systemd-journal-remote.

This would make sense to include in the TorizonCore build I guess and not in the Docker image. So I tried to compile this via recipe but that doesn’t seem to exist.

$ bitbake-layers show-recipes "*journal*"
=== Matching recipes: ===
systemd-journald-persistent:
  meta-updater         1.0

Can you give me a hint?

Hi @TriUrs,

I’m not too familiar with systemd-journal-gatewayd/remote. Just so I understand what is your exact use case here? seems like your applications will send logs via HTTP/network and then systemd-journal-gatewayd/remote will receive and store these logs locally? Is that correct or is there more to it then that?

Also I did a quick look and its seems gatewayd/remote are packages in the main systemd recipe: http://cgit.openembedded.org/openembedded-core/tree/meta/recipes-core/systemd/systemd_244.5.bb?h=dunfell

Probably just need to include the packages to have them in the image build.

Best Regards,
Jeremias

Instead of implementing a logger myself (like we did under WinCE) or use a third party solution I wanted to use the logger from the system. It is robust and tested. In addition, we also have the system log itself in it, which is often very useful.

That means our software (C++ / C#) should write to the systemd-journal log and the readout should happen e.g. via ASP.Net Blazor or via network.

I am also not very familiar with systemd-journal and am testing if the idea is feasible at all.

Hmm… strange. systemd with journal in general is included. Thanks for the hint, I will investigate a little bit more…

Hmm… strange. systemd with journal in general is included. Thanks for the hint, I will investigate a little bit more…

Just to clarify the main systemd recipe is included in the base image by default, this is true. But it seems like some of the features were split up into various sub-packages. Meaning these are not installed unless explicitly included in the image.

For example there’s a sub-package here called “systemd-journal-remote”: http://cgit.openembedded.org/openembedded-core/tree/meta/recipes-core/systemd/systemd_244.5.bb?h=dunfell#n407

That has the files and features for journal-remote.

Best Regards,
Jeremias

Dear Jeremias

I found that out yesterday as well. I also found out it compiles, because I found the binary inside the build folder. But I didn’t find out how to set the option to include it in the image.

How to add recipes I understand but how and which option I have to set to include systemd-journal-remote in the image I don’t understand yet. Can you help me?

Adding a recipe to an image is the same as adding a package to an image. Just add systemd-journal-remote to the IMAGE_INSTALL variable. Just make sure you double-check and get the name of the package correct.

Best Regards,
Jeremias

Hi jeremias

I’ve added

IMAGE_INSTALL_append = " systemd-journal-remote"

to local.conf und es kompiliert ohne Fehlermeldung aber im Image ist es nicht.

Tried several other variants and googled but found no solution. Any ideas?

Hmm my only suggestion would be to check the build logs produced by Yocto to see what work it did when processing the systemd-journal-remote package. Yocto usually would throw at least a warning if something was built but not packaged in the Image.

Best Regards,
Jeremias

Thank you for the idea.

I think I need to go with “PACKAGECONFIG” to enable this feature. I will write if I found a solution.

Please do let us know how this works out!