Bug 649318

Summary: need way to provide further audit msgs during bundle provisioning
Product: [Other] RHQ Project Reporter: John Mazzitelli <mazz>
Component: ProvisioningAssignee: John Mazzitelli <mazz>
Status: CLOSED CURRENTRELEASE QA Contact: Mike Foley <mfoley>
Severity: medium Docs Contact:
Priority: high    
Version: 3.0.0CC: skondkar
Target Milestone: ---Keywords: FutureFeature
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-09-02 07:22:44 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Screenshot none

Description John Mazzitelli 2010-11-03 14:28:32 UTC
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 11:08:57 UTC
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 10:44:44 UTC
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 10:45:33 UTC
Created attachment 504645 [details]
Screenshot

Comment 4 Heiko W. Rupp 2013-09-02 07:22:44 UTC
Bulk closing of issues that were VERIFIED, had no target release and where the status changed more than a year ago.