Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Comments

Add get log destination Add check log empty#10

Open
8ctopus wants to merge 1 commit intoapix:master from
8ctopus:empty2
Open

Add get log destination Add check log empty #10
8ctopus wants to merge 1 commit intoapix:master from
8ctopus:empty2

Conversation

@8ctopus
Copy link
Contributor

@8ctopus 8ctopus commented Sep 9, 2022

I've added code to check if the log is empty and where the log file is. Here's how I use it:

 foreach ($container['logger']->getBuckets() as $bucket) {
 // check not empty and at least warning (4)
 if (get_class($bucket) === 'Apix\\Log\\Logger\\File' && !$bucket->isEmpty()) {
 if (!$file = $bucket->getDestination()) {
 continue;
 }
 // get log content
 $content = file_get_contents($file, false);
 // send log by email
 }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

AltStyle によって変換されたページ (->オリジナル) /