[GH-ISSUE #418] GelfHandler::write need a Interface #143

Closed
opened 2026-03-04 02:12:35 +03:00 by kerem · 2 comments
Owner

Originally created by @skydiablo on GitHub (Sep 10, 2014).
Original GitHub issue: https://github.com/Seldaek/monolog/issues/418

i want to use the "GelfHandler" in SF2 project. so i add to my composer.json:

"graylog2/gelf-php": "dev-master"

but now, if i want to log something, i get a error in GelfHandler::write()

Gelf\Publisher::publish() must be an instance of Gelf\MessageInterface, string given

what is here wrong ? my SF2 config.yml:

monolog:
    handlers:
        main:
            type: gelf
            publisher:
                hostname: %Graylog2.Host%
                port: %Graylog2.Port%
            level: info
            formatter: monolog.formatter.session_request
Originally created by @skydiablo on GitHub (Sep 10, 2014). Original GitHub issue: https://github.com/Seldaek/monolog/issues/418 i want to use the "GelfHandler" in SF2 project. so i add to my composer.json: ``` "graylog2/gelf-php": "dev-master" ``` but now, if i want to log something, i get a error in GelfHandler::write() ``` Gelf\Publisher::publish() must be an instance of Gelf\MessageInterface, string given ``` what is here wrong ? my SF2 config.yml: ``` monolog: handlers: main: type: gelf publisher: hostname: %Graylog2.Host% port: %Graylog2.Port% level: info formatter: monolog.formatter.session_request ```
kerem closed this issue 2026-03-04 02:12:35 +03:00
Author
Owner

@stof commented on GitHub (Sep 10, 2014):

The issue is that you change the formatter. The GelfHandler expects a formatter formatting to a Gelf message

<!-- gh-comment-id:55106148 --> @stof commented on GitHub (Sep 10, 2014): The issue is that you change the formatter. The GelfHandler expects a formatter formatting to a Gelf message
Author
Owner

@skydiablo commented on GitHub (Sep 10, 2014):

indeed... big thx ! closed...

<!-- gh-comment-id:55109326 --> @skydiablo commented on GitHub (Sep 10, 2014): indeed... big thx ! closed...
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/monolog#143
No description provided.