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

test PHP 7.3 #7

Merged
merged 1 commit into from
Jan 14, 2019
Merged

test PHP 7.3 #7

merged 1 commit into from
Jan 14, 2019

Conversation

OskarStark
Copy link
Contributor

No description provided.

@OskarStark
Copy link
Contributor Author

Will rebase after the merge of #6

@OskarStark
Copy link
Contributor Author

This one is green and ready to merge.

Can you please create a new release after this merge?
Thank you

@bueltge
Copy link
Member

bueltge commented Jan 8, 2019

@OskarStark BTW. In which context do you use the library, for the shop monitoring? Thx.

@OskarStark
Copy link
Contributor Author

Hey @bueltge

No for an internal tool, but the "performance" is quite bad :(
I think I need to switch back to filebeat again

@Chrico
Copy link
Member

Chrico commented Jan 8, 2019

Have you tried out to bulk-send the logs to logz,io? @OskarStark

@OskarStark
Copy link
Contributor Author

Have you tried out to bulk-send the logs to logz,io? @OskarStark

I would say yes, at it is the default, right?

@Chrico
Copy link
Member

Chrico commented Jan 8, 2019

Depends on how you're using it. Monolog, by default, does not send in bulk. So you have to use something like this:

<?php declare(strict_types=1);

use Inpsyde\LogzIoMonolog\Handler\LogzIoHandler;
use Monolog\Handler\BufferHandler;
use Monolog\Logger;

$handler = new BufferHandler(new LogzIoHandler($token));

$logger = new Logger('name');
$logger->pushHandler($handler);

@OskarStark
Copy link
Contributor Author

OskarStark commented Jan 8, 2019

Ähm I used the symfony monolog settings.
Are you using it with symfony?

I thought it is default, because of:

    public function __construct(
        string $token,
        string $type = 'http-bulk',
        bool $ssl = true,
        int $level = Logger::DEBUG,
        bool $bubble = true
    ) {
``

`http-bulk`

@Chrico
Copy link
Member

Chrico commented Jan 8, 2019

Hehe no, Monolog does trigger HandlerInterface::handle on every Logger::log-call. The $type - which was wrongly documented (updated it) is for:

Your log type - it helps classify the logs you send. This will be added as field called 'type' to all the JSON log you are sending in the body, overriding the value if it has this field. If missing we default to 'http-bulk'.

See also: https://app.logz.io/#/dashboard/data-sources/Bulk-HTTPS (needs login).

You've to use the BulkHandler from Monolog to collect those records in memory and bulk send them via Multiline JSON via LogzIoHandler. You can configure this in Symfony via:

# app/config/config_{env}.yml
monolog:
    handlers:
        buffered:
            type:    buffer
            handler: logzio
        logzio:
                ....

@OskarStark
Copy link
Contributor Author

is it possible to log to logz io AND to a file?

@OskarStark
Copy link
Contributor Author

Can you merge this?

@Chrico Chrico merged commit bcdb7dc into inpsyde:master Jan 14, 2019
@Chrico
Copy link
Member

Chrico commented Jan 14, 2019

Sure!

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.

3 participants