Bug 534397 (RHQ-1198)
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> |
Severity: | medium | Docs Contact: | |
Priority: | low | ||
Version: | unspecified | Keywords: | Improvement |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | All | ||
OS: | All | ||
URL: | http://jira.rhq-project.org/browse/RHQ-1198 | ||
Whiteboard: | |||
Fixed In Version: | 1.2 | Doc Type: | Enhancement |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | Type: | --- | |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
John Mazzitelli
2008-12-01 06:22:00 UTC
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. 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. 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. 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.
This bug was previously known as http://jira.rhq-project.org/browse/RHQ-1198 This bug incorporates RHQ-1108 |