-
Notifications
You must be signed in to change notification settings - Fork 0
/
Context.php
78 lines (68 loc) · 1.8 KB
/
Context.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?php
/**
* Qubus\Error
*
* @link https://github.com/QubusPHP/error
* @copyright 2022
* @author Joshua Parker <joshua@joshuaparker.dev>
* @license https://opensource.org/licenses/mit-license.php MIT License
*/
declare(strict_types=1);
namespace Qubus\Error;
interface Context
{
/**
* Severity context key of the error.
*
* This is a string value which MAY match with the PSR-3 log levels.
*/
public const SEVERITY = 'severity';
/**
* Application context key.
*
* This is an array value holding information about application, and it's environment.
*
* Some example keys:
* - os
* - hostname
* - language (eg. PHP 7.1)
* - version
* - environment (eg. staging, production)
* - url
* - root_dir
* - component
* - action
*/
public const APP = 'app';
/**
* User context key.
*
* This is an array value holding information about the current user (such as ID, username or email).
*/
public const USER = 'user';
/**
* Request context key.
*
* This is an array value holding information about the current request.
* (eg. ip, headers, URL, HTTP method, and HTTP params)
*/
public const REQUEST = 'request';
/**
* Session context key.
*
* This is an array value holding information about the current session.
*/
public const SESSION = 'session';
/**
* Environment context key.
*
* This is an array value holding the environment variables.
*/
public const ENVIRONMENT = 'environment';
/**
* Parameters context key.
*
* This is an array value holding additional parameters which might help resolving the problem.
*/
public const PARAMETERS = 'parameters';
}