# jetpack/12.8.3/json-endpoints/jetpack/class.jetpack-json-api-log-endpoint.php

Jetpack – WP Security, Backup, Speed, &amp; Growth, version 12.8.3. 31 lines.

- Page: https://pluginprobe.com/plugins/jetpack/12.8.3/code/json-endpoints/jetpack/class.jetpack-json-api-log-endpoint.php
- Raw: https://pluginprobe.com/plugins/jetpack/12.8.3/raw/json-endpoints/jetpack/class.jetpack-json-api-log-endpoint.php
- Modified: 2022-04-12T17:20:54+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/jetpack/12.8.3/code/json-endpoints/jetpack/class.jetpack-json-api-log-endpoint.php#L10-L20`.

```php
<?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName

/**
 * Jetpack log endpoint class.
 *
 * GET /sites/%s/jetpack-log
 */
class Jetpack_JSON_API_Jetpack_Log_Endpoint extends Jetpack_JSON_API_Endpoint {
	/**
	 * Needed capabilities.
	 *
	 * @var array
	 */
	protected $needed_capabilities = 'manage_options';

	/**
	 * The result.
	 *
	 * @return array
	 */
	protected function result() {
		$args  = $this->input();
		$event = ( isset( $args['event'] ) && is_string( $args['event'] ) ) ? $args['event'] : false;
		$num   = ( isset( $args['num'] ) ) ? (int) $args['num'] : false;

		return array(
			'log' => Jetpack::get_log( $event, $num ),
		);
	}
}

```
