Skip to content

Add JSON debug log format#219

Merged
pavelhoral merged 3 commits intoWrenSecurity:mainfrom
kovaceviccz:add-json-debug-log-format
Aug 22, 2025
Merged

Add JSON debug log format#219
pavelhoral merged 3 commits intoWrenSecurity:mainfrom
kovaceviccz:add-json-debug-log-format

Conversation

@kovaceviccz
Copy link
Copy Markdown
Contributor

@kovaceviccz kovaceviccz commented Aug 8, 2025

This PR addresses part of #214 by introducing a new DebugRecord value object to encapsulate log entry data, and a DebugFormatter abstraction with PlainTextDebugFormatter (legacy format) and JsonDebugFormatter (structured output) implementations. The active formatter is selected via the new org.wrensecurity.wrenam.debug.format system property; for example, setting -Dorg.wrensecurity.wrenam.debug.format=json enables JSON-formatted debug output, while omitting it defaults to the legacy plain text format.

It also replaces the legacy SimpleDateFormat with the thread-safe DateTimeFormatter and updates date/time formats to better align with the ISO-8601 standard.

Comment thread openam-shared/src/main/java/com/sun/identity/shared/debug/DebugConstants.java Outdated
@kovaceviccz kovaceviccz force-pushed the add-json-debug-log-format branch 3 times, most recently from 511ccbe to 2bdb327 Compare August 20, 2025 08:31
@kovaceviccz
Copy link
Copy Markdown
Contributor Author

Thanks for going over it, @pavelhoral. I’ve made the updates you suggested and pushed a new PR version. Does this look better?

@kovaceviccz kovaceviccz force-pushed the add-json-debug-log-format branch 4 times, most recently from 48a39dc to 7bea3bb Compare August 21, 2025 10:22
pavelhoral
pavelhoral previously approved these changes Aug 21, 2025
Copy link
Copy Markdown
Member

@pavelhoral pavelhoral left a comment

Choose a reason for hiding this comment

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

LGTM

@kovaceviccz kovaceviccz force-pushed the add-json-debug-log-format branch 4 times, most recently from ca27c0b to c2dc75c Compare August 21, 2025 15:04
Comment thread openam-shared/src/main/java/com/sun/identity/shared/debug/DebugConstants.java Outdated
@kovaceviccz kovaceviccz force-pushed the add-json-debug-log-format branch from c2dc75c to 0da890d Compare August 22, 2025 08:52
Copy link
Copy Markdown
Member

@pavelhoral pavelhoral left a comment

Choose a reason for hiding this comment

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

LGTM

@pavelhoral pavelhoral merged commit f27bca6 into WrenSecurity:main Aug 22, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants