Skip to content

docs: add SwingBridge guide for logging and identifying logs per user#5807

Open
taefi wants to merge 4 commits into
mainfrom
swing-bridge-logging
Open

docs: add SwingBridge guide for logging and identifying logs per user#5807
taefi wants to merge 4 commits into
mainfrom
swing-bridge-logging

Conversation

@taefi

@taefi taefi commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Description

Adds a new SwingBridge documentation page, Logging & Identifying Logs per User (tools/modernization-toolkit/swing-bridge/logging.adoc, navigation slot 5), documenting the per-session log attribution features shipped in vaadin/vaadin-swing-bridge#239, vaadin/vaadin-swing-bridge#240, and vaadin/vaadin-swing-bridge#241.

The page is written for readers without deep Vaadin knowledge and structured as an integration ladder, from zero cooperation to the interop APIs:

  • Quick Setup — the two copy-paste steps (JVM flag + pattern token) with the expected log output.
  • Choosing an Integration Level — a five-rung ladder table (automatic console prefixing → configuration-only file tagging → one-line identity → log context API → interop cooperation), each rung linking to its section.
  • What Gets Tagged, and How — console prefixing vs. file/structured logs, with Log4j2 (%X{swingSession}, async-safety explained), Logback, and JUL configuration blocks; every snippet labeled with the codebase it belongs to (Vaadin application vs. Swing application).
  • Publishing the User Identity — both authentication placements as separate scenarios: login inside the Swing application (property one-liner → SwingBridgeLogContext → zero-change reflection observer) and login extracted to Vaadin with host-side navigation (setLogIdentity and its per-(session, application) keying), plus bespoke logging subsystems via the typed interop (@ExposedMethod initLogIdentity) and the both-sides case.
  • Support Workflow — showing the run ID in the application and reportIncident.
  • Old and New Logging Frameworks Together — where a Swing application's log statements actually go (class-loader shadowing, Log4j 1.x bridging, "the app's own log file won't exist" expectation-setting), Spring Boot's Logback vs. SwingBridge's Log4j2, the multiple-SLF4J-providers pitfall and the slf4j.provider pin, and a coverage-expectations table.
  • Desktop Builds Are Unaffected and a symptom-based Troubleshooting list.

Supporting changes:

  • configuration.adoc: two new system-property rows (swingbridge.consoleLogPrefix, swingbridge.log.user) cross-linking the new page.
  • installation-from-scratch.adoc: the template's log4j-slf4j2-impl exclusion is now explained and linked to the new page's trade-off discussion (previously the exclusion appeared with no rationale, and it directly affects where embedded applications' log output ends up).
  • Vale vocabulary: accepts appender(s), Splunk, and interop — the latter clears 13 pre-existing spelling errors across the existing interop section. The new page lints at 0 Vale errors.

@github-actions

github-actions Bot commented Jul 13, 2026

Copy link
Copy Markdown

Preview Deployment

This PR has been deployed for preview.

URL: https://docs-preview-pr-5807.fly.dev

Changed pages

Added content is highlighted in green; removed content is marked in red on each page.

Built from 5a1cb94

@taefi taefi changed the title docs: add SwingBridge logging and user identification guide docs: add SwingBridge guide for logging and identifying logs per user Jul 13, 2026
taefi added 3 commits July 17, 2026 14:50
New page (order 5) covering per-session log attribution: quick setup,
an integration-level ladder from zero cooperation to the interop APIs,
console prefixing and the Log4j2/Logback/JUL adapters, publishing the
user identity for both A&A placements (login inside Swing vs. extracted
to Vaadin), the reportIncident support workflow, and a section on
old and new logging frameworks coexisting (Log4j 1.x bridging, guest
config shadowing, Spring Boot Logback vs. Log4j2, SLF4J provider
pinning).

Also: configuration.adoc gains the swingbridge.consoleLogPrefix and
swingbridge.log.user rows; installation-from-scratch.adoc explains its
log4j-slf4j2-impl exclusion and links the trade-offs; the Vale
vocabulary accepts appender(s), Splunk, and interop (clears 13
pre-existing spelling errors in the interop section).
…ation

'User Identification' reads like authentication; the page is about
attributing log output to the user who produced it. Renames the page
title, SEO title, heading, and the cross-reference labels in
configuration.adoc and installation-from-scratch.adoc.
… attribution

Restructure the SwingBridge logging page so someone who knows Swing and core
Java, but is new to Vaadin/SwingBridge, can get from nothing to tagged logs
quickly:

- Turn "Quick Setup" into an explicit Step 1 / Step 2 / Step 3 path, leading
  with the single JVM flag that needs no Swing-app changes.
- Retitle the identity section to the task ("Adding the User's Name to the
  Logs") and lead with the one-line, no-dependency option
  (System.setProperty("swingbridge.log.user", name) after login); give the
  who-publishes subsections clearer, task-oriented headings.
- Document the new opt-in, swingbridge.includeUserInLogs, which puts the user's
  name on every line ([swing:<runId>|<user>]) and via the %swingUser /
  %X{swingUser} tokens; note it is off by default because the name is personal
  data. Add the Log4j2/Logback/JUL token usage and a configuration.adoc row and
  a troubleshooting entry.
@taefi
taefi force-pushed the swing-bridge-logging branch from e6ba3bb to bf084ff Compare July 17, 2026 11:55
@taefi
taefi requested a review from eftunv July 17, 2026 11:59
The logging page is long; add an "on this page" table of contents so readers
don't lose track. Two complementary aids:

- :toc: — the DSP right-rail contents list, auto-built from the section
  headings (same mechanism as flow/advanced/downloads.adoc).
- An "In this article" jump-list near the top linking the nine top-level
  sections, for in-body navigation.

Also mark the feature's availability with a plain-text note under the title
("Available since SwingBridge 1.3."). The DSP since-badge macro has no
precedent for a tool version (only Vaadin/Hilla platform coordinates), so a
text note states it unambiguously without risking a broken badge.
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.

1 participant