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
logging: change log level dynamically #1048
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
✅ Deploy Preview for tetragon ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
kkourt
approved these changes
Jun 11, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool! Thanks!
Just a couple of minor suggestions from my side.
Allow to change log level dynamically which is handy for debugging problems. Set loglevel to debug: sudo kill -s SIGRTMIN+20 $(pidof tetragon) time="2023-06-02T12:59:43+02:00" level=info msg="Listening for events..." time="2023-06-02T12:59:47+02:00" level=info msg="Received signal SIGRTMIN+20: switching from LogLevel 'info' to 'debug'" time="2023-06-02T12:59:57+02:00" level=info msg="Received signal SIGRTMIN+20: LogLevel is already 'debug'" Sending the second signal shows up that the loglevel is already debug. Signed-off-by: Djalal Harouni <tixxdz@gmail.com>
Set loglevel to trace level: sudo kill -s SIGRTMIN+21 $(pidof tetragon) time="2023-06-02T13:07:17+02:00" level=info msg="Listening for events..." time="2023-06-02T13:07:28+02:00" level=info msg="Received signal SIGRTMIN+21: switching from LogLevel 'debug' to 'trace'" Signed-off-by: Djalal Harouni <tixxdz@gmail.com>
tixxdz
force-pushed
the
pr/tixxdz/change-log-level-dynamically
branch
from
June 12, 2023 10:22
558a07a
to
fbe40e9
Compare
Allow to reset original log level by sending SIGRTMIN+22 signal to tetragon. sudo kill -s SIGRTMIN+20 $(pidof tetragon) sudo kill -s SIGRTMIN+21 $(pidof tetragon) sudo kill -s SIGRTMIN+22 $(pidof tetragon) sudo kill -s SIGRTMIN+22 $(pidof tetragon) output: time="2023-06-02T13:14:31+02:00" level=info msg="Listening for events..." time="2023-06-02T13:14:33+02:00" level=info msg="Received signal SIGRTMIN+20: switching from LogLevel 'info' to 'debug'" time="2023-06-02T13:14:37+02:00" level=info msg="Received signal SIGRTMIN+21: switching from LogLevel 'debug' to 'trace'" time="2023-06-02T13:14:40+02:00" level=trace msg="process_exec: no container ID due to cgroup name not being a compatible ID, ignoring." cgroup.id=13750 cgroup.name=vte-spawn-5c6c92b1-0631-48d7-855c-bc00f4b70255.scope process.binary=/usr/bin/pidof process.exec_id="OjE2MDExMDU5NDY0NzgxOjEzODMzOQ==" time="2023-06-02T13:14:40+02:00" level=trace msg="process_exec: no container ID due to cgroup name not being a compatible ID, ignoring." cgroup.id=13750 cgroup.name=vte-spawn-5c6c92b1-0631-48d7-855c-bc00f4b70255.scope process.binary=/usr/bin/sudo process.exec_id="OjE2MDExMDgxNzM4MTE2OjEzODM0MA==" time="2023-06-02T13:14:40+02:00" level=trace msg="process_exec: no container ID due to cgroup name not being a compatible ID, ignoring." cgroup.id=13750 cgroup.name=vte-spawn-5c6c92b1-0631-48d7-855c-bc00f4b70255.scope process.binary=/usr/bin/kill process.exec_id="OjE2MDExMTAxMjU2NTU4OjEzODM0Mg==" time="2023-06-02T13:14:40+02:00" level=info msg="Received signal SIGRTMIN+22: resetting original LogLevel 'info'" time="2023-06-02T13:14:42+02:00" level=info msg="Received signal SIGRTMIN+22: resetting original LogLevel 'info'" Signed-off-by: Djalal Harouni <tixxdz@gmail.com>
Signed-off-by: Djalal Harouni <tixxdz@gmail.com>
tixxdz
force-pushed
the
pr/tixxdz/change-log-level-dynamically
branch
from
June 12, 2023 10:27
fbe40e9
to
0fa55ee
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Allow to change log level dynamically which is handy for debugging problems.
sudo kill -s SIGRTMIN+20 $(pidof tetragon)
sudo kill -s SIGRTMIN+21 $(pidof tetragon)
sudo kill -s SIGRTMIN+22 $(pidof tetragon)
sudo kill -s SIGRTMIN+22 $(pidof tetragon)
output:
time="2023-06-02T13:14:31+02:00" level=info msg="Listening for events..."
time="2023-06-02T13:14:33+02:00" level=info msg="Received signal SIGRTMIN+20: switching from LogLevel 'info' to 'debug'"
time="2023-06-02T13:14:37+02:00" level=info msg="Received signal SIGRTMIN+21: switching from LogLevel 'debug' to 'trace'"
time="2023-06-02T13:14:40+02:00" level=trace msg="process_exec: no container ID due to cgroup name not being a compatible ID, ignoring." cgroup.id=13750 cgroup.name=vte-spawn-5c6c92b1-0631-48d7-855c-bc00f4b70255.scope process.binary=/usr/bin/pidof process.exec_id="OjE2MDExMDU5NDY0NzgxOjEzODMzOQ=="
time="2023-06-02T13:14:40+02:00" level=trace msg="process_exec: no container ID due to cgroup name not being a compatible ID, ignoring." cgroup.id=13750 cgroup.name=vte-spawn-5c6c92b1-0631-48d7-855c-bc00f4b70255.scope process.binary=/usr/bin/sudo process.exec_id="OjE2MDExMDgxNzM4MTE2OjEzODM0MA=="
time="2023-06-02T13:14:40+02:00" level=trace msg="process_exec: no container ID due to cgroup name not being a compatible ID, ignoring." cgroup.id=13750 cgroup.name=vte-spawn-5c6c92b1-0631-48d7-855c-bc00f4b70255.scope process.binary=/usr/bin/kill process.exec_id="OjE2MDExMTAxMjU2NTU4OjEzODM0Mg=="
time="2023-06-02T13:14:40+02:00" level=info msg="Received signal SIGRTMIN+22: resetting original LogLevel 'info'"
time="2023-06-02T13:14:42+02:00" level=info msg="Received signal SIGRTMIN+22: resetting original LogLevel 'info'"