Red Hat Bugzilla – Full Text Bug Listing
|Summary:||be able to change agent's log4j config on the fly at runtime|
|Product:||[Other] RHQ Project||Reporter:||John Mazzitelli <mazz>|
|Component:||Agent||Assignee:||John Mazzitelli <mazz>|
|Status:||CLOSED NEXTRELEASE||QA Contact:||Corey Welton <cwelton>|
|Fixed In Version:||1.2||Doc Type:||Enhancement|
|Doc Text:||Story Points:||---|
|oVirt Team:||---||RHEL 7.3 requirements from Atomic Host:|
Description John Mazzitelli 2008-12-01 01:22:00 EST
this came out of a discussion from agent auto-upgrade, RHQ-110 - it would be nice to switch the agent's log4j.xml at runtime (hot deploy) so we can turn on and off debug messages without recycling the agent. also would be nice to turn on and off command tracing as well (which is just 2 specific log4j categories to set)
Comment 1 John Mazzitelli 2008-12-01 01:39:47 EST
syntax: debug [--file=<log4j filename>] [--comm=true|false] you can now turn on debug messages and command tracing while the agent is running, and turn it off while its running without shutting down agent.
Comment 2 Corey Welton 2008-12-22 11:05:19 EST
Should user be able to impl. a new logfile instance via this method? For example, the following exercise seems to fail. > debug --file=/root/foo.txt Cannot load log file [/root/foo.txt]. Cause: java.io.FileNotFoundException:/root/foo.txt In this case, there was no prior file, "/root/foo.txt". Of course, touching said file and reattempting the above step results in a traceback about the file being non log4j compliant. Perhaps we could initiate a new log4j file if the requested location does not exist? A few ideas... > debug --file=/root/foo.txt Cannot load log file [/root/foo.txt]. This file does not exist. Create it? > debug --file=/root/foo.txt Cannot load log file [/root/foo.txt]. This file does not exist. To create, use 'debug --new' Similar actions could take place for a non-compliant file -- perhaps simply an indication that this file is not log4j compliant, versus a full traceback... > debug --file=/root/foo.txt Cannot load log file [/root/foo.txt]. This does not appear to be a log4j compliant logfile. Both of these scenarios should probably be separate jiras however.
Comment 3 Corey Welton 2008-12-22 11:54:29 EST
Most of above comment can be ignored. It was due (in part) to some ambiguous terminology in "debug --help". Otherwise, this appears to work fine.
Comment 4 John Mazzitelli 2008-12-22 12:04:52 EST
I fixed the help info on the debug command to make it clear --file defines the log4j.xml configuration file - its not an output file where the logs go. > help debug Syntax: debug [--file=<conf>] [--comm=true|false] [--threaddump] Provides features to help debug the agent. -c|--comm=true|false: enables or disables server-agent communications trace. -f|--file=<conf>: reconfigures the logging system with the given file. <conf> can be 'log4j.xml', 'log4j-debug.xml', 'log4j-warn.xml' or any file found in /conf. You can even use your own log configuration file by placing it in the /conf directory. -t|--threaddump: dumps the stacks for all threads in the agent VM.