Skip to content

Commit 2c3f1a9

Browse files
committed
Use external logger in zlog stream if set
1 parent 002cdcb commit 2c3f1a9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

sapi/fpm/fpm/zlog.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,11 @@ ssize_t zlog_stream_str(struct zlog_stream *stream, const char *str, size_t str_
501501
zlog_bool zlog_stream_finish(struct zlog_stream *stream) /* {{{ */
502502
{
503503
if (stream->use_buffer) {
504+
if (external_logger != NULL) {
505+
external_logger(flags & ZLOG_LEVEL_MASK,
506+
stream->buf + stream->prefix_len, stream->len - stream->prefix_len);
507+
}
508+
504509
#ifdef HAVE_SYSLOG_H
505510
if (zlog_fd == ZLOG_SYSLOG) {
506511
stream->buf[stream->len] = '\0';

0 commit comments

Comments
 (0)