Make logging configurable and/or reduce output
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 3.3k
- Forks
- 334
- PR merge metrics
- No merged PRs in 30d
Description
Is your feature request related to a problem? Please describe.
When using the profiler connector to a server, the log is filled with messages along the lines of:
[2019-01-15T11:08:07.003+0000] [Payara 5.183] [SEVERE] [] [] [tid: _ThreadID=633 _ThreadName=*** Profiler Agent Special Execution Thread 8] [timeMillis: 1547550487003] [levelValue: 1000] [[
*** Profiler engine warning: CNFE in getLoadedClassInThisLoaderOnly sun.reflect.GeneratedConstructorAccessor445 for sun.reflect.GeneratedConstructorAccessor445 classloaderId 1610 classLoader: sun.reflect.DelegatingClassLoader@7dbb4a1f]]
[2019-01-15T11:08:07.003+0000] [Payara 5.183] [SEVERE] [] [] [tid: _ThreadID=633 _ThreadName=*** Profiler Agent Special Execution Thread 8] [timeMillis: 1547550487003] [levelValue: 1000] [[
*** Profiler engine warning: class sun.reflect.GeneratedConstructorAccessor445 that should be instrumented is not loaded by target VM]]
[2019-01-15T11:08:07.003+0000] [Payara 5.183] [SEVERE] [] [] [tid: _ThreadID=633 _ThreadName=*** Profiler Agent Special Execution Thread 8] [timeMillis: 1547550487003] [levelValue: 1000] [[
*** Requested classloader: sun.reflect.DelegatingClassLoader@7dbb4a1f]]
This make it hard to read the log for actual errors or information that is logged.
Describe the solution you'd like
To make the log level configurable i.e. by using java.util.logging.Logger to that I can turn the visualvm logger off. Additionally the log level for these messages could be lowered.
Describe alternatives you've considered
Alternatively recognise when dealing with classes generated by reflection, and not considered it an error when they then cannot be found, as all the errors come from sun.reflect.*.
Additional context
Currently whenever there is an error it is sent to System.err, which is redirected in a server environment to the log, which is shared with the server logging. See https://github.com/oracle/visualvm/blob/be6f997f13db163782cd3735edf812c409fb6ca9/visualvm/libs.profiler/lib.profiler/src/org/graalvm/visualvm/lib/jfluid/server/ProfilerInterface.java#L1429 for what it currently does.
Contributor guide
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.
Research direction
Start with ProfilerInterface.java around line 1429, where errors are currently sent to System.err, and trace how profiler connector output reaches server logs. Done means the logging behavior is configurable or the reported profiler warnings are reduced appropriately, without flooding the server log.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- devtools
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100