|
| 1 | +--- |
| 2 | +title: Use Azure IoT Central audit logs | Microsoft Docs |
| 3 | +description: Learn how to use audit logs in IoT Central to track changes made in an IoT Central application |
| 4 | +author: dominicbetts |
| 5 | +ms.author: dobett |
| 6 | +ms.date: 07/25/2022 |
| 7 | +ms.topic: how-to |
| 8 | +ms.service: iot-central |
| 9 | +services: iot-central |
| 10 | + |
| 11 | +# Administrator |
| 12 | +--- |
| 13 | + |
| 14 | +# Use audit logs to track activity in your IoT Central application |
| 15 | + |
| 16 | +This article describes how to use audit logs to track who made what changes at what time in your IoT Central applications. You can: |
| 17 | + |
| 18 | +- Sort the audit log. |
| 19 | +- Filter the audit log. |
| 20 | +- Customize the audit log. |
| 21 | +- Manage access to the audit log. |
| 22 | + |
| 23 | +The audit log records information about who made a change, information about the modified entity, the action that made change, and when the change was made. The log tracks changes made through the UI, programatically with the REST API, and through the CLI. |
| 24 | + |
| 25 | +The log records changes to the following IoT Central entities: |
| 26 | + |
| 27 | +- [Users](howto-manage-users-roles.md#add-users) |
| 28 | +- [Roles](howto-manage-users-roles.md#manage-roles) |
| 29 | +- [API tokens](howto-authorize-rest-api.md#token-types) |
| 30 | +- [Application template export](howto-create-iot-central-application.md#create-and-use-a-custom-application-template) |
| 31 | +- [File upload configuration](howto-configure-file-uploads.md#configure-device-file-uploads) |
| 32 | +- [Application customization](howto-customize-ui.md) |
| 33 | +- [Device enrollment groups](concepts-device-authentication.md) |
| 34 | +- [Device templates](howto-set-up-template.md) |
| 35 | +- [Device lifecycle events](howto-export-to-blob-storage.md#device-lifecycle-changes-format) |
| 36 | + |
| 37 | +The log records changes made by the following types of user: |
| 38 | + |
| 39 | +- IoT Central user - the log shows the user's email. |
| 40 | +- API token - the log shows the token name. |
| 41 | +- Azure Active Directory user - the log shows the user email or ID. |
| 42 | +- Service principal - the log shows the service principal name. |
| 43 | + |
| 44 | +The log stores data for 30 days, after which it's no longer available. |
| 45 | + |
| 46 | +The following screenshot shows the audit log view with the location of the sorting and filtering controls highlighted: |
| 47 | + |
| 48 | +:::image type="content" source="media/howto-use-audit-logs/audit-log.png" alt-text="Screenshot that shows the audit log. The location of the sort and filter controls is highlighted."::: |
| 49 | + |
| 50 | +## Customize the log |
| 51 | + |
| 52 | +Select **Column options** to customize the audit log view. You can add and remove columns, reorder the columns, and change the column widths: |
| 53 | + |
| 54 | +:::image type="content" source="media/howto-use-audit-logs/audit-logs-column-options.png" alt-text="Screenshot that shows the audit log column options."::: |
| 55 | + |
| 56 | +## Sort the log |
| 57 | + |
| 58 | +You can sort the log into ascending or descending timestamp order. To sort, select **Timestamp**: |
| 59 | + |
| 60 | +:::image type="content" source="media/howto-use-audit-logs/audit-logs-sorting.png" alt-text="Screenshot that shows how to sort the log into descending timestamp order."::: |
| 61 | + |
| 62 | +## Filter the log |
| 63 | + |
| 64 | +To focus on a specific time, filter the log by time range. Select **Edit time range** and specify the range you're interested in: |
| 65 | + |
| 66 | +:::image type="content" source="media/howto-use-audit-logs/audit-logs-time.png" alt-text="Screenshot that shows how filter the log to show the last hour of entries."::: |
| 67 | + |
| 68 | +To focus on specific entries, filter by entity type or action. Select **Filter** and use the multi-select drop-downs to specify your filter conditions: |
| 69 | + |
| 70 | +:::image type="content" source="media/howto-use-audit-logs/audit-logs-filter.png" alt-text="Screenshot that shows how filter the log to show only updates to user entities."::: |
| 71 | + |
| 72 | +## Manage access |
| 73 | + |
| 74 | +The built-in **App Administrator** role has access to the audit logs by default. The administrator can grant access to other roles. An administrator can assign either **Full control** or **View** audit log permissions to other roles. To learn more, see [Manage users and roles in your IoT Central application](howto-manage-users-roles.md). |
| 75 | + |
| 76 | +> [!IMPORTANT] |
| 77 | +> Any user granted permission to view the audit log can see all log entries even if they don't have permission to view or modify the entities listed in the log. Therefore, any user who can view the log can view the identity of and changes made to any modified entity. |
| 78 | +
|
| 79 | +## Next steps |
| 80 | + |
| 81 | +Now that you've learned how to manage users and roles in your IoT Central application, the suggested next step is to learn how to [Manage IoT Central organizations](howto-create-organizations.md). |
0 commit comments