# logtivity/1.6.0/Logs/Download_Monitor/Logtivity_Download_Monitor.php

Activity Logs, User Activity Tracking, Multisite Activity Log from Logtivity, version 1.6.0. 25 lines.

- Page: https://pluginprobe.com/plugins/logtivity/1.6.0/code/Logs/Download_Monitor/Logtivity_Download_Monitor.php
- Raw: https://pluginprobe.com/plugins/logtivity/1.6.0/raw/Logs/Download_Monitor/Logtivity_Download_Monitor.php
- Modified: 2021-07-27T11:44:18+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/logtivity/1.6.0/code/Logs/Download_Monitor/Logtivity_Download_Monitor.php#L10-L20`.

```php
<?php

class Logtivity_Download_Monitor extends Logtivity_Abstract_Logger
{
	public function __construct()
	{
		add_action('dlm_downloading',  [$this, 'itemDownloaded']);
	}

	public function itemDownloaded($download)
	{
		return Logtivity_Logger::log()
			->setAction('File Downloaded')
			->setContext($download->get_title())
			->addMeta('Download Slug', $download->get_slug())
			->addMeta('Download ID', $download->get_id())
			->addMeta('Download Count', $download->get_download_count())
			->addMeta('Is Featured', $download->is_featured())
			->addMeta('Is Members Only', $download->is_members_only())
			->send();
	}
}

$Logtivity_Download_Monitor = new Logtivity_Download_Monitor;

```
