Bug 621619

Summary: RFE: Provide logging support for scripts
Product: [Other] RHQ Project Reporter: John Sanda <jsanda>
Component: CLIAssignee: Nobody <nobody>
Status: NEW --- QA Contact:
Severity: medium Docs Contact:
Priority: low    
Version: 3.0.0CC: jshaughn
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
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 Sanda 2010-08-05 16:41:26 UTC
Description of problem:
I have written more than one script now in which I have resorted to println() calls for logging which is less than ideal for anything other than the most trivial of scripts.

Commons Logging is on the classpath and available for use, but that is probably not intuitive as it is something that is not advertised. And trying the following from the interactive shell does not work,

$ logger = org.apache.commons.logging.LogFactory.getLog(this.getClass())

but,

$ logger = org.apache.commons.logging.LogFactory.getLog("myscript")

does work, however, I do not see anything written to the log file. Instead, I'd prefer not to directly expose Commons Logging and instead provide a logger and/or log factory object in the script bindings.

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info: