21257[FEATURE] Add a GrayLog Writer
Commit message
Review
-
Code review CR 0
-
Verified V 0
Issues 1
Files 10
- typo3/contrib/graylog2-php/tests/GelfMessageTest.phpnew+39 −0
- typo3/contrib/graylog2-php/.travis.ymlnew+8 −0
- typo3/contrib/graylog2-php/composer.jsonnew+19 −0
- typo3/contrib/graylog2-php/GELFMessage.phpnew+249 −0
- typo3/contrib/graylog2-php/GELFMessagePublisher.phpnew+218 −0
- typo3/contrib/graylog2-php/index.phpnew+18 −0
- typo3/contrib/graylog2-php/LICENSEnew+20 −0
- typo3/contrib/graylog2-php/phpunit.xml.distnew+9 −0
- typo3/contrib/graylog2-php/README.markdownnew+36 −0
- typo3/sysext/core/Classes/Log/Writer/GraylogWriter.php4new+183 −0
Review log 4
-
Mr. Jenkins commented on patch set 1 06/06/13, 12:43
Build Successful https://ci.typo3.org/job/typo3-v4-core-gerrit/8988/ : SUCCESS -
Steffen Müller commented on patch set 1 CR -1 06/06/13, 13:13
IMO we should only put php and licence files into contrib. See also my inline comments.GraylogWriter.php:58We put the require_once() calls into the constructor? Every instanciation of a new GreylogWriter would call this.GraylogWriter.php:69No exception thrown in this functionGraylogWriter.php:75use (int)($record->getCreated()GraylogWriter.php:99Why do you add this backtrace on runtime to any log record? Afaik backtrace is not required in GELF, so we could optionally use the backtrace from $record->data['file']... from the IntrospectionProcessor. This processor can be configured whenever it's needed. This would save processing time for any record which does not need backtrace -
Ernesto Baschny commented on patch set 1 CR -1 06/06/13, 17:08
Apart from the comments from Steffen, I would also consider the LICENCEing problems. This is not a GPL license. It looks open source, but it's not simply MIT, GPLv2 or something. We still have pending questions regarding other contrib packages, we just don't need yet another one. In fact, I consider this library too much overhead for a rather simple task and a very simple protocol. If I read the code correctly, the "procedure" to get something logged to Graylog can be reduced to something like this: $message = gzcompress(json_encode(array( 'version' => self::GRAYLOG2_GELF_VERSION, 'timestamp' => $GLOBALS['EXEC_TIME'], 'short_message' => $record->getMessage(), 'full_message' => $record->getMessage(), 'facility' => $this->facility, 'host' => \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('HTTP_HOST'), 'level' => $record->getLevel(), ))); $socket = stream_socket_client(sprintf('udp://%s:%d', gethostbyname($hostname), $port)); if (str_len($message) > $chunkSize) { str_split($message, $chunkSize); $messageId = randomstuff(); foreach ($chunk) { $chunk = pack('CC', 30, 15) . substr(md5($messageId, true), 0, 8) . pack('CC', $sequence, $sequenceSize) . $data; fwrite($socket, $chunk); } } else { fwrite($socket, $message); } So I would rather simply include some code like this (of course finished and tested..) in our GelfLogger implementation instead of adding a dependency to an external library. -
Georg Ringer abandoned the change 06/12/13, 11:42