Patent ID: 8370796

Claim:
A method, in a data processing system, for automatic generation and insertion of compliance audit record generation code in program instructions of an application, comprising: analyzing, by the data processing system, the program instructions to identify at least one portion of the program instructions matching a compliance policy requirement for generation of a compliance audit record; generating, by the data processing system, compliance audit record generation code for generating the compliance audit record; inserting, by the data processing system, the compliance audit record generation code into the at least one portion of program instructions to generate modified program instructions; and outputting the modified program instructions for execution on a computing device, wherein analyzing the program instructions to identify at least one portion of program instructions meeting a compliance policy requirement comprises: tagging one or more elements within the program instructions with corresponding compliance labels based on identifying elements in the program instructions that match compliance labels in a compliance label metadata database; correlating the compliance labels with one or more policies in a policy database; and determining if compliance audit record generation code should be inserted into the at least one portion of program instructions based on the correlation of the compliance labels with the one or more policies in the policy database.