Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
From G-Reg 4.5.0 it is possible to audit Lifecycle operations. This means we capture all the Lifecycle operations of a particular resource. Lifecycle auditing is turned ON by default. Auditing can be turned OFF from the Lifecycle configuration. This can be done by setting audit=false in the lifecycle element in the Lifecycle configuration.

 

Code Block
<aspect name="ServiceLifeCycle" class="org.wso2.carbon.governance.registry.extensions.aspects.DefaultLifeCycle">
    <configuration type="literal">
        <lifecycle audit=false>
            <scxml xmlns="http://www.w3.org/2005/07/scxml"
                   version="1.0"
                   initialstate="...">
                <state id="...">
			...
                </state>
            </scxml>
        </lifecycle>
    </configuration>
</aspect>

Since the audit functionality is defined per Lifecycle only the information related to that Lifecycle would get audited and based on the configuration, all the resources associated with that lifecycle are audited.


Audit logs are kept as a resource in G-Reg. These resources get stored under "/_system/governance/repository/components/org.wso2.carbon.governance/lifecycles/history" collection. A resource is created for every resource/collection that is associated with a Lifecycle. The name of this resource is made by replacing all the "/" with "_" of its full path. Given below is an example log resource created as a result of Lifecycle operations on a Service named foo.

Image Modified

Audit logs are kept as a XML files. A sample audit log is as follows.

 

Code Block
<lifecycleHistory>
	<item order="3" user="admin" state="Development" targetState="Testing" originalPath="/_system/governance/trunk/services/bar/foo">
      		<action type="transition" name="Promote">
			<executors>
			<executor name="org.wso2.carbon.governance.registry.extensions.executors.ServiceVersionExecutor">
			<operations>
				<operation>
					<info>/_system/governance/branches/testing/services/bar/1.0.0/foo created</info>
				</operation>
			</operations>
			</executor>
			</executors>
			</action>
	</item>
	<item order="2" user="admin" state="Development" originalPath="/_system/governance/trunk/services/bar/foo">
		<action type="itemClick" name="QoS Created">
			<value>value:true</value>
		</action>
	</item>
	<item order="1" user="admin" state="Development" originalPath="/_system/governance/trunk/services/bar/foo">
		<action type="itemClick" name="WSDL, Schema Created">
			<value>value:true</value>
		</action>
	</item>
	<item order="0" user="admin" state="Development" originalPath="/_system/governance/trunk/services/bar/foo">
		<action type="itemClick" name="Code Completed">
			<value>value:true</value>
		</action>
	</item>
</lifecycleHistory>