Bug 621619 - RFE: Provide logging support for scripts
Summary: RFE: Provide logging support for scripts
Keywords:
Status: NEW
Alias: None
Product: RHQ Project
Classification: Other
Component: CLI
Version: 3.0.0
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
: ---
Assignee: Nobody
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-08-05 16:41 UTC by John Sanda
Modified: 2022-03-31 04:27 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)

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:


Note You need to log in before you can comment on or make changes to this bug.