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

Add get log destination Add check log empty #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant