Documentation > CMS Template API Library > Util > Log(Asset,String,Object[])
Log
Logs a Custom log in the context of the given asset with the given message string. The log will be added to the asset's History (Properties > History) with the action type "Custom" and will only be displayed when "Custom" is selected from the drop-down.
public System.Void Log(Asset,String,Object[])
Parameters
| Name | Description | Type |
|---|---|---|
| asset | The asset to which the log applies | CrownPeak.CMSAPI.Asset |
| message | The message to log | System.String |
| args | Optional : The variables to be inserted into a message | System.Object[] |
Code Example
C#
Sample:
// logs to the current asset's history
Util.Log(asset, "this is my message");
Util.Log(asset, "The {0} is {1}", "id", asset.Id);