Json logging (for example for oidng) is broken
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 52/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- ansible, java
- Domain
- devops, observability-sre
Research direction
Start with roles/oidcng/templates/logback.xml.j2 and compare the configured Logstash TCP appender with the syslog format described in the issue. Verify that the resulting messages are accepted as syslog by rsyslog, preserve the JSON payload, and can be routed to the correct files.
Written by the indexing model from the issue text.
Description
The json logging does not work correctly. The logstash appender that is for example used in in roles/oidcng/templates/logback.xml.j2 looks like this
<appender name="JSON_SYSLOG" class="net.logstash.logback.appender.LogstashTcpSocketAppender">
<destination>host.docker.internal:514</destination>
<encoder class="net.logstash.logback.encoder.LogstashEncoder">
<customFields>{"app":"oidcng"}</customFields>
<includeCallerData>true</includeCallerData>
<fieldNames>
<thread>[ignore]</thread>
<version>[ignore]</version>
<levelValue>[ignore]</levelValue>
</fieldNames>
</encoder>
</appender>
This correctly format the json, but sends a Logstash-compatible message to a syslog port. In particular, it send pure json, whereas syslog instead expects an RFC3164 or RFC5452-compatible message. Such a syslog message contains a header followed by a message:
<PRIO> VERSION TIMESTAMP HOSTNAME APPNAME PROCID MSGID STRUC MESSAGE
for example:
<132> 1 20260507T12:00:00.000000+0200 docker1.dev.openconext.org oidcngjson - - - {"app":"oidng","more":"jsonfields"}
Using the current appender, rsyslog randoml interprets some of the json fields as its metadata fields cause for example the "servicename" to be {"@timestamp":.
This makes it impossible to match log messages and redirect them to the correct files.
- Dominant language
- Jinja
- Stars
- 16
- Forks
- 20
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 12
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from OpenConext/OpenConext-deploy
-
infra
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
OpenConext/OpenConext-deploy#485 ·
Maintainers usually reply within 1 day
-
Add allowlist for incoming HTTP headersMay be free again @baszoetekouw claimed this 41 days ago, and no pull request is open. Open
OpenConext/OpenConext-deploy#762 · 1 assignee ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
OpenConext/OpenConext-deploy#735 ·
Maintainers usually reply within 1 day
-
Split off SURFconext-specififc Manage schemas to surfconext-deploy-environmentsMay be free again @baszoetekouw claimed this 101 days ago, and no pull request is open. Open
OpenConext/OpenConext-deploy#727 · 1 assignee ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
OpenConext/OpenConext-deploy#641 ·
Maintainers usually reply within 1 day
All issues in OpenConext/OpenConext-deploy
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
todo
Difficulty 1/5 Under an hour Newbie friendliness 72/100
tonybaloney/CSnakes#864 ·
-
good first issue help wanted phase:0 priority:P3 type:task
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
Maintainers usually reply within 1 day
-
area::installer enhancement wg::platform-core
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
lemonade-sdk/lemonade#4277 ·
Maintainers usually reply within 1 day