Skip to content

Supressing UI statistics logs - #9840

Open
jtulach wants to merge 1 commit into
apache:masterfrom
jtulach:jtulach/SupressUsageStatistics
Open

jtulach wants to merge 1 commit into
apache:masterfrom
jtulach:jtulach/SupressUsageStatistics

Conversation

@jtulach

@jtulach jtulach commented Nov 30, 2026

Copy link
Copy Markdown
Contributor
  • I believe the NetBeans project is no longer collecting usage statistics...
    • ...and sending them "home"
  • however they still appear in the log files needlessly
    • as they are logged at "too high" verbosity
    • they don't have to be, UI Handler picks them up at lower levels too
  • hence I propose to remove the UI statistics messages from the log (at default logging level)

@jtulach jtulach added this to the NB33 milestone Nov 30, 2026
@jtulach jtulach self-assigned this Nov 30, 2026

@eppleton eppleton left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Getting the USG_* noise out of messages.log makes sense to me. Two concrete problems, inline, plus one question.

The description says the UI handler picks the records up at lower levels too. As far as I can see from reading uihandler (not tested), that holds for the org.netbeans.ui.* loggers only after Installer.restoredOnce has set org.netbeans.ui to FINEST. Before that, these loggers inherit INFO from the root, so FINE records logged early in startup no longer reach EarlyHandler. That's probably acceptable if nobody consumes the gesture log anymore, but it would be good to state it in the description.

@jtulach
jtulach force-pushed the jtulach/SupressUsageStatistics branch from a57d27a to 30153f8 Compare November 30, 2026 13:56

@jtulach jtulach left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the early review, Toni.

@jtulach
jtulach requested a review from eppleton November 30, 2026 13:57
@MartinBalin

Copy link
Copy Markdown
Contributor

The Git command-logging test now fails. ExternalChangesTest.testLogIntCmd attaches a handler to org.netbeans.ui.vcs and waits for USG_VCS_CMD. The PR lowers that event to FINE, so the logger discards it before the test handler sees it. I reproduced no event logged. The same test passed with org.netbeans.ui.vcs set to FINE. Set that level in the test fixture and restore the previous level during teardown. The module’s default test configuration excludes this class.

  • Changed producer netbeans/ide/versioning.util/src/org/netbeans/modules/versioning/util/Utils.java:1107
  • Test listener netbeans/ide/git/test/unit/src/org/netbeans/modules/git/ExternalChangesTest.java:330

@MartinBalin

Copy link
Copy Markdown
Contributor

Several usage events still reach the default log. With the root logger at INFO, I invoked the main-window and database logging code and observed USG_LOOK_AND_FEEL, UI_CONNECT_DB, and USG_DB_CONNECT in NetBeans’ messages.log. The JavaScript debugger also emits USG_DEBUG_HTML5_JS at INFO on its first debug action. Lower these producers as well to cover startup, database connections, and JavaScript debugging.

  • netbeans/platform/core.windows/src/org/netbeans/core/windows/view/ui/MainWindow.java:810
  • netbeans/ide/db/src/org/netbeans/modules/db/explorer/DatabaseUILogger.java:37
  • netbeans/webcommon/web.javascript.debugger/src/org/netbeans/modules/web/javascript/debugger/actions/DebuggerActionsProvider.java:228

@MartinBalin

Copy link
Copy Markdown
Contributor

Opening a freeform project still does work for a discarded record. UsageLogger.log checks isLoggable(INFO) before scheduling a task that reads compilation units, evaluates classpaths, and enumerates Ant targets. At the default INFO threshold, all that work runs and the new FINE record is discarded. Change the guard to isLoggable(Level.FINE). netbeans/java/java.freeform/src/org/netbeans/modules/java/freeform/UsageLogger.java:57

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.

3 participants