-
Notifications
You must be signed in to change notification settings - Fork 313
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
Turn on/off spy logging dynamically #496
Comments
is your actual problem, that the log file is taking too much space? if so, you can still handle it on a level of logging library and respective rollout policy, I believe. |
No peter.
I wanted to know if i can turn off/on the logging at will.
That way i can start my application with spy turned off, turn it on and
reproduce the issue and turn it off again.
…-sada
On Fri, Mar 27, 2020, 1:35 AM Peter Butkovic ***@***.***> wrote:
is your actual problem, that the log file is taking too much space? if so,
you can still handle it on a level of logging library and respective
rollout policy, I believe.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#496 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHKHVLNP6YXFLETUI5NC4OTRJRQOZANCNFSM4LUS5IKA>
.
|
@sadaaithal currently there is no such functionality I can think of :( |
any chance to prvovide Pull request? as I have no chance to do so, due to very limited time I have available for the project. |
I have the same use case for file appender in tests. I just created a custom appender that extends FileLogger and have a global on off switch.
not a big deal if this doesn't come with the project. Took me like 5 minutes to get it done. Maybe I'll add a pull request. Alternatively without code changes, with slf4j appender it should already be possible to enable/disable logger in runtime via logger implementation. |
If you use Log4J or similar you can just disable the logger like this: <Logger name="p6spy" level="OFF"/> <!-- prints time spent on every SQL query --> If you are developing and want to quickly enable/disable you can then either use JMX to configure the logger or just enable |
I wanted to have a way of stopping the spy logging dynamically.
My application is non-jmx based so i provide the p6spy options at startup.
By default the p6spy log file starts from process init.
Some of my tests start a long time after startup - and by then the spy log file is in the GBs.
I will have to regularly truncate this file to not hit other disk/io issues.
So is there a way we can introduce an option to enable/disable spy logging controllable via the spy.properties file?
I came across this https://sourceforge.net/p/p6spy/discussion/162085/thread/50d50cfe/
Turns out "trace=false" is no longer recognized by p6spy-3.8.7.jar.
The text was updated successfully, but these errors were encountered: