Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial library iteration #3

Merged
merged 41 commits into from
Dec 20, 2021
Merged
Changes from 1 commit
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
7c25829
Added logging classes, Sentry adapter and dummy test
Meldiron Nov 9, 2021
a02e3f5
Fixed tests
Meldiron Nov 10, 2021
74a1b3b
Moved classes for beter namespacing, new authors,
Meldiron Nov 10, 2021
0c8adfd
Fix after refactoring
Meldiron Nov 10, 2021
78d66b3
Removed cache
Meldiron Nov 10, 2021
8b82fc6
Ignore cache
Meldiron Nov 10, 2021
39f47f5
Added AppSigal implementation, added timestamp of when issue occured
Meldiron Nov 10, 2021
afc622e
Removed unnecessary code
Meldiron Nov 10, 2021
343e2d0
Added raygun adapter
Meldiron Nov 10, 2021
91a7112
Apply suggestions from code review
Meldiron Nov 11, 2021
57ed9d7
Code review changes
Meldiron Nov 11, 2021
52cd8ce
Added example code into readme
Meldiron Nov 14, 2021
3714e1c
Review refactoring, improved tests, used CONST for type parameters
Meldiron Nov 16, 2021
7cf2dfd
Refactor types, Test fix, added fail tests, added adapter tutorial
Meldiron Nov 16, 2021
1bbc5c8
Review changes
Meldiron Nov 22, 2021
67ccde7
added provider registry
Meldiron Nov 22, 2021
0d3f8c4
Fixed adapter name
Meldiron Nov 22, 2021
6bf9f21
Improved constructor structure
Meldiron Nov 22, 2021
585fbfc
Made methods static, as ti should be
Meldiron Nov 22, 2021
b287bcf
Fixed adapters registration
Meldiron Nov 23, 2021
2cc7e56
Bug fix
Meldiron Nov 23, 2021
43cc77b
Fixed get errors on unfilled fields when pushing
Meldiron Nov 23, 2021
6dadc53
Fixed type errors
Meldiron Nov 23, 2021
11f94f7
Bug fix
Meldiron Nov 23, 2021
727b510
Code analysis fix
Meldiron Nov 23, 2021
26f7213
Fixed tests
Meldiron Nov 23, 2021
5d8cc1b
Paused exteral tests, replaced "set" functions with "add" on array at…
Meldiron Nov 24, 2021
572ada8
Pr review changes
Meldiron Nov 29, 2021
00981cc
Merge branch 'main' into dev
Meldiron Nov 29, 2021
5412165
Tests fix
Meldiron Nov 29, 2021
59b1f47
Merge branch 'dev' of https://github.com/utopia-php/logger into dev
Meldiron Nov 29, 2021
e135df7
Tests fix
Meldiron Nov 29, 2021
c50b16a
Added missing type
Meldiron Nov 29, 2021
74140bf
Abstracted validate logic into Adapter class + updated docs
Meldiron Dec 5, 2021
db66b8c
Updated required PHP from 7 to 8
Meldiron Dec 5, 2021
aad8991
PR build fix
Meldiron Dec 6, 2021
e67eafc
Removed PHP 8.1
Meldiron Dec 6, 2021
07c7afd
Follow PHP Fig standards
Meldiron Dec 14, 2021
5a6c39c
Update README.md
Meldiron Dec 19, 2021
48b35b1
Review changes
Meldiron Dec 19, 2021
973fcef
Merge branch 'dev' of https://github.com/utopia-php/logger into dev
Meldiron Dec 19, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Added example code into readme
Meldiron committed Nov 14, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 52cd8ce7f9cd9aabd06fbadddb9b9124a1bcb7e9
61 changes: 52 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -20,18 +20,61 @@ composer require utopia-php/logging

require_once '../vendor/autoload.php';

use blabla;
use Utopia\Logging\Adapter\AppSignal;
use Utopia\Logging\Adapter\Raygun;
use Utopia\Logging\Adapter\Sentry;
use Utopia\Logging\Log;
use Utopia\Logging\Log\Breadcrumb;
use Utopia\Logging\Log\User;
use Utopia\Logging\Logging;

// Prepare log
$log = new Log();
$log->setAction("controller.database.deleteDocument");
$log->setEnvironment("production");
$log->setLogger("api");
$log->setServer("digitalocean-us-001");
$log->setType("warning");
$log->setVersion("0.11.5");
$log->setMessage("Document efgh5678 not found");
$log->setUser(new User("efgh5678"));
$log->setBreadcrumbs([
new Breadcrumb("debug", "http", "DELETE /api/v1/database/abcd1234/efgh5678", \microtime(true) - 500),
new Breadcrumb("debug", "auth", "Using API key", \microtime(true) - 400),
new Breadcrumb("info", "auth", "Authenticated with * Using API Key", \microtime(true) - 350),
new Breadcrumb("info", "database", "Found collection abcd1234", \microtime(true) - 300),
new Breadcrumb("debug", "database", "Permission for collection abcd1234 met", \microtime(true) - 200),
new Breadcrumb("error", "database", "Missing document when searching by ID!", \microtime(true)),
]);
$log->setTags([
'sdk' => 'Flutter',
'sdkVersion' => '0.0.1',
'authMode' => 'default',
'authMethod' => 'cookie',
'authProvider' => 'MagicLink'
]);
$log->setExtra([
'urgent' => false,
'isExpected' => true
]);

// Sentry
$adapter = new Sentry("[YOUR_SENTRY_KEY]", \getenv("[YOUR_SENTRY_PROJECT_ID]"));
Meldiron marked this conversation as resolved.
Show resolved Hide resolved
$logging = new Logging($adapter);
$logging->addLog($log);

// AppSignal
$adapter = new AppSignal(\getenv("[YOUR_APPSIGNAL_KEY]"));
$logging = new Logging($adapter);
$logging->addLog($log);

// Raygun
$adapter = new Raygun(\getenv("[YOUR_RAYGUN_KEY]"));
$logging = new Logging($adapter);
$logging->addLog($log);

blabla
```

## Library API

* **blabla()** - bla bla

> bla bla
>
>
### Adapters

Below is a list of supported adapters, and thier compatibly tested versions alongside a list of supported features and relevant limits.