Bug 649318 - need way to provide further audit msgs during bundle provisioning
need way to provide further audit msgs during bundle provisioning
Status: CLOSED CURRENTRELEASE
Product: RHQ Project
Classification: Other
Component: Provisioning (Show other bugs)
3.0.0
All All
high Severity medium (vote)
: ---
: ---
Assigned To: John Mazzitelli
Mike Foley
: FutureFeature
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-11-03 10:28 EDT by John Mazzitelli
Modified: 2013-09-02 03:22 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-09-02 03:22:44 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Screenshot (119.56 KB, image/png)
2011-06-14 06:45 EDT, Sunil Kondkar
no flags Details

  None (edit)
Description John Mazzitelli 2010-11-03 10:28:32 EDT
While the ant recipe is executed, certain build events trigger audit log messages to get persisted (that is, you'll see different "steps" in the bundle deployment audit trail).

It would be nice if someone writing an ant recipe can trigger their own custom audit trail logs/msgs.

For example, today we don't log anything when this is called:

org.rhq.plugins.ant.DeploymentAuditorBuildListener.messageLogged(BuildEvent)

So when ant logs a message, we don't put it in the audit trail. This may or may not be what we want. However, we would like to do something to provide a hook for recipe authors to be able to use to log their own messages - and whether or not the audit step was a "SUCCESS" or "FAILURE".

We could do something like detect when the <echo> task emitted something and log that. Or we could write our own custom "rhq:audit" task to provide a RHQ specific way of doing this. for example:

<rhq:audit result="SUCCESS">
   The audit message goes here.
</rhq:audit>

We could support an optional attribute "message" such that it could look like:

<rhq:audit result="SUCCESS" message="The audit message goes here." />

The value of "result" attribute must be either SUCCESS or FAILURE.
Comment 1 John Mazzitelli 2010-12-23 06:08:57 EST
master commit 65c741a60042218f7ab290b4795b563c9be2c77e

new rhq:audit task lets you send up a custom audit trail entry from within your ant bundle recipe:

<rhq:audit
    status="success"
    action="action"
    info="info"
    message="message">

  details

</rhq:audit>

where:
  status is one of SUCCESS, FAILURE, WARN
  action is a short name of your audit step (e.g. "Set File Permissions")
  info is a short summary, sometimes the target of the action (e.g. "file.txt")
  message is a short message, usually 1 or 2 lines (e.g. "permissions set on file at 1:00pm")
  details is a long message. will show in a textarea in the UI

To test, put this in a recipe's preinstall or postinstall target - deploy the bundle - go to the deployment view and look at the deployment history and see your audit trail.
Comment 2 Sunil Kondkar 2011-06-14 06:44:44 EDT
Verified on build#123 (Version: 4.1.0-SNAPSHOT Build Number: a6d2d56)

Created a recipe and included below in postinstall target:

<rhq:audit status="SUCCESS" action="Test action: Deploy Files From URLS" info="This is to test the Info in audit status" message="Test Message for deploying files from URLS">
        The test details goes here....
</rhq:audit>

Created and deployed the bundle. Navigated to the deployment history and verified the audit messages in audit trail. 

Please refer the attached screenshot.

Marking as verified.
Comment 3 Sunil Kondkar 2011-06-14 06:45:33 EDT
Created attachment 504645 [details]
Screenshot
Comment 4 Heiko W. Rupp 2013-09-02 03:22:44 EDT
Bulk closing of issues that were VERIFIED, had no target release and where the status changed more than a year ago.

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