Bug 649318 - need way to provide further audit msgs during bundle provisioning
Summary: need way to provide further audit msgs during bundle provisioning
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: RHQ Project
Classification: Other
Component: Provisioning
Version: 3.0.0
Hardware: All
OS: All
high
medium
Target Milestone: ---
: ---
Assignee: John Mazzitelli
QA Contact: Mike Foley
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-11-03 14:28 UTC by John Mazzitelli
Modified: 2018-10-27 11:29 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-09-02 07:22:44 UTC
Embargoed:


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

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.


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