Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter out excessive logging of classfile parsing from m2e in "debug mode" #2785

Merged
merged 1 commit into from
Jul 31, 2023

Conversation

rgrunber
Copy link
Contributor

@rgrunber rgrunber commented Jul 31, 2023

When having -Djdt.ls.debug=true set for java.jdt.ls.vmargs and importing a project like LemMinX, I noticed the logs would get very large. Approximately 1.5MB in size after just the initial import. I also think it's made worse by the fact that some of the log messages here, are sent on rebuild. I also believe they slow down other operations.

!ENTRY org.eclipse.jdt.ls.logback.appender 1 0 2023-07-31 14:41:50.190
!MESSAGE parseClassFile(): path=org/eclipse/lemminx/extensions/colors/utils/ColorUtils.class resource=/home/rgrunber/git/lemminx/org.eclipse.lemminx/target/classes/org/eclipse/lemminx/extensions/colors/utils/ColorUtils.class

...
...

ENTRY org.eclipse.jdt.ls.logback.appender 1 0 2023-07-31 14:41:52.424
!MESSAGE visitClassFile(): path=org/eclipse/lemminx/extensions/contentmodel/participants/codeactions/RootElementTypeMustMatchDoctypedeclCodeAction.class resource=/home/rgrunber/git/lemminx/org.eclipse.lemminx/target/classes/org/eclipse/lemminx/extensions/contentmodel/participants/codeactions/RootElementTypeMustMatchDoctypedeclCodeAction.class

With this change the log size for the same project goes down to 0.4MB.

Before merging I just want to play around with tallying all log messages by their originating logger. Maybe there are others worth suppressing. It's a fine line between keeping debug logging and filtering things that only worsen performance.

Update

      Number of calls | Logger Name
      1 aQute.bnd.metatype.MetatypeAnnotations
      1 org.apache.maven.plugin.internal.DeprecatedCoreExpressionValidator
      3 aQute.bnd.osgi.PluginsContainer
      3 org.eclipse.jgit.util.SystemReader
      3 org.eclipse.m2e.core.internal.lifecyclemapping.LifecycleMappingFactory
      4 org.eclipse.m2e.core.internal.embedder.EclipseLogger
      5 org.eclipse.aether.internal.impl.synccontext.named.NamedLockFactoryAdapterFactoryImpl
      6 org.eclipse.jgit.util.FS
      6 org.eclipse.m2e.core.internal.builder.MavenBuilder
     10 org.eclipse.m2e.core.internal.builder.MavenBuilderImpl
     15 org.eclipse.aether.internal.impl.DefaultLocalRepositoryProvider
     18 aQute.bnd.osgi.Processor
     18 org.eclipse.jgit.internal.storage.file.Pack
     19 aQute.bnd.osgi.Analyzer
     19 aQute.bnd.osgi.Contracts
     20 org.eclipse.aether.internal.impl.collect.bf.BfDependencyCollector
     27 org.eclipse.m2e.core.project.configurator.AbstractCustomizableLifecycleMapping
    105 org.eclipse.jgit.internal.storage.file.FileSnapshot
    734 org.apache.maven.shared.filtering.DefaultMavenFileFilter
    969 org.apache.maven.shared.filtering.DefaultMavenResourcesFiltering
   3203 aQute.bnd.osgi.Clazz

@rgrunber rgrunber requested a review from snjeza July 31, 2023 19:38
@rgrunber
Copy link
Contributor Author

re-test this please.

Signed-off-by: Roland Grunberg <rgrunber@redhat.com>
@rgrunber rgrunber added this to the End August 2023 milestone Jul 31, 2023
@rgrunber rgrunber merged commit c4f5f96 into eclipse-jdtls:master Jul 31, 2023
5 of 6 checks passed
@rgrunber rgrunber deleted the excessive-m2e-logging branch July 31, 2023 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants