Skip to content

DRAFT: Feat/journal logging#775

Draft
killermoehre wants to merge 9 commits intoznuny:devfrom
b1-systems:feat/journal-logging
Draft

DRAFT: Feat/journal logging#775
killermoehre wants to merge 9 commits intoznuny:devfrom
b1-systems:feat/journal-logging

Conversation

@killermoehre
Copy link
Copy Markdown

Proposed change

Add a new logging backend to log directly in systemd-journald with its native protocol. This allows for more meta data with each log line ans also proper multi line logs.

Type of change

  • '1 - 🚀 feature' - New feature (which adds functionality to an existing integration)

Checklist

  • The code change is tested and works locally.(❗)
  • There is no commented out code in this PR.(❕)
  • You improved or added new unit tests.(❕)
  • Local ZnunyCodePolicy passed.(❕)
  • Local UnitTests / Selenium passed.(❕)
  • GitHub workflow CI (UnitTests / Selenium) passed.(❗)

@killermoehre
Copy link
Copy Markdown
Author

killermoehre commented Mar 25, 2026

As this is my first pull request for Znuny, I would really love some help on how to test this 😅

In theory the Serialize function works.

Also, I'm really unsure about the licence header. I basically copied the SysLog.pm and adjusted it accordingly.

@killermoehre killermoehre marked this pull request as draft March 25, 2026 18:53
@killermoehre
Copy link
Copy Markdown
Author

I marked this as DRAFT because I'm unsure about the KeyTranslate hash. What values are actually logged?

@rkaldung rkaldung added the 3 - verified This issue or pull request was verified. label Mar 30, 2026
@rkaldung
Copy link
Copy Markdown
Member

@dennykorsukewitz can you assist/provide examples?

@killermoehre
Copy link
Copy Markdown
Author

Also, I'm really unsure about the licence header. I basically copied the SysLog.pm and adjusted it accordingly.

Found the ZnunyCodePolicy repo. Now I'm sure about the licence header.

@dennykorsukewitz
Copy link
Copy Markdown
Member

Also, I'm really unsure about the licence header. I basically copied the SysLog.pm and adjusted it accordingly.

Found the ZnunyCodePolicy repo. Now I'm sure about the licence header.

Hi @killermoehre ,
Unfortunately, I haven't had a chance to look at it yet.
That's right,...the ZnunyCodePolicy should help you out here.

Copy link
Copy Markdown
Member

@dennykorsukewitz dennykorsukewitz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @killermoehre

Thank you very much for your pull request. 👍🏼 🚀

I just took a quick look at it and I'm not familiar with the journal yet.

I found a few things here that are worth taking a closer look at:

  • ObjectDependencies are missing
  • Lines and modules are not the only parameters. what about Priority
  • What about the encoding (character set)? Check Kernel/System/Log/SysLog.pm
  • SysConfig
    • LogModule::Journal::SocketPath
    • LogModule::Journal::Charset ?
  • Right now, I don't see where the actual message is added...
  • UnitTest (as you said yourself) scripts/test/Log/Journal.t - The base file would be scripts/test/Log.t

I hope I didn't scare you and that this is helpful for now.

Keep going 🚀

@killermoehre
Copy link
Copy Markdown
Author

killermoehre commented Apr 2, 2026

I found a few things here that are worth taking a closer look at:

  • ObjectDependencies are missing

Added.

  • Lines and modules are not the only parameters. what about Priority

That's where I need some guidance, @dennykorsukewitz. What fields are available?

  • What about the encoding (character set)? Check Kernel/System/Log/SysLog.pm

The journal just reads everything as utf-8. No need to transform.

  • SysConfig
    • LogModule::Journal::SocketPath

Added.

    • LogModule::Journal::Charset ?

Not necessary.

  • Right now, I don't see where the actual message is added...

The messages are added to the systemd-journal. You see them with journalctl and depending on how you start your daemon, they are part of apache.service or something else. Being able to log proper is the first step from my side to port Znuny into a well-behaving capsuled daemon and after this to port it into actual container to run Znuny in k8s.

  • UnitTest (as you said yourself) scripts/test/Log/Journal.t - The base file would be scripts/test/Log.t

Thanks. Will write the unit test and probably cry for help.

I hope I didn't scare you and that this is helpful for now.

Keep going 🚀

Very helpful, will keep going.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3 - verified This issue or pull request was verified.

Development

Successfully merging this pull request may close these issues.

3 participants