# give/4.16.9/src/Framework/Exceptions/Traits/Loggable.php

GiveWP – Donation Plugin and Fundraising Platform, version 4.16.9. 45 lines.

- Page: https://pluginprobe.com/plugins/give/4.16.9/code/src/Framework/Exceptions/Traits/Loggable.php
- Raw: https://pluginprobe.com/plugins/give/4.16.9/raw/src/Framework/Exceptions/Traits/Loggable.php
- Modified: 2022-06-17T00:03:36+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/give/4.16.9/code/src/Framework/Exceptions/Traits/Loggable.php#L10-L20`.

```php
<?php

namespace Give\Framework\Exceptions\Traits;

trait Loggable
{
    /**
     * Gets the Exception::getMessage() method
     *
     * @since 2.11.1
     */
    abstract public function getMessage();

    /**
     * Returns the human-readable log message
     *
     * @since 2.11.1
     */
    public function getLogMessage(): string
    {
        return $this->getMessage();
    }

    /**
     * Returns an array with the basic context details
     *
     * @since 2.21.0 Log meaningful data instead of entire exception object.
     * @since 2.11.1
     *
     * @return array
     */
    public function getLogContext(): array
    {
        return [
            'category' => 'Uncaught Exception',
            'exception' => [
                'File' => basename($this->getFile()),
                'Line' => $this->getLine(),
                'Message' => $this->getMessage(),
                'Code' => $this->getCode()
            ]
        ];
    }
}

```
