KEMBAR78
"Profiler started" doesn't honor loglevel · Issue #960 · async-profiler/async-profiler · GitHub
Skip to content

"Profiler started" doesn't honor loglevel #960

@geertn

Description

@geertn

Describe the bug

In this PR #551 a loglevel argument was added with reasoning "This is particularly helpful if you're using async-profiler in production and where you don't want to clubber your output with not always relevant log information"

Using Grafana Profiles we are looking at enabling "Continuous profiling" in production. However when enabling the profiler using Grafana Alloy agent we get a large amount of "Profiling started" log messages in our applications.

Looking at the source this and related messages seems to be written out to STDOUT without looking at loglevel.

We don't like to enable profiling in production if this means we can't control logging (and logging format) of our application.

Expected vs. actual behavior

"Profiling started" and related logs should honor the log level.

Reproduction Steps

  1. Start Java test program, eg java -jar 'renaissance-gpl-0.15.0.jar' scrabble
  2. Attach asprof ./asprof -L error <pid>
  3. Observe application stdout:
====== scrabble (functional) [default], iteration 5 completed (573.007 ms) ======
====== scrabble (functional) [default], iteration 6 started ======
Profiling started
GC before operation: completed in 58.073 ms, heap usage 336.025 MB -> 78.046 MB.
====== scrabble (functional) [default], iteration 6 completed (448.292 ms) ======
====== scrabble (functional) [default], iteration 7 started ======

Additional Information/Context

No response

Async-profiler version

3.0

Environment details

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions