Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 548172 - app-admin/syslog-ng-3.4.8 - no longer get dmesg messages in the log
Summary: app-admin/syslog-ng-3.4.8 - no longer get dmesg messages in the log
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Tomáš Mózes
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-29 18:34 UTC by Paul Gover
Modified: 2020-08-11 08:36 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
syslog-ng-3.6.2-kmsg.patch (syslog-ng-3.6.2-kmsg.patch,730 bytes, patch)
2015-05-27 06:07 UTC, Mr. Bones. (RETIRED)
Details | Diff
Patch for syslog-ng >= 3.15.1 (syslog-ng-3.15.1-kmsg.patch,753 bytes, patch)
2018-07-23 12:36 UTC, Teika kazura
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Gover 2015-04-29 18:34:33 UTC
I'm using the same config as before, but now I get much less output in the log.

This bug was also observed by tholin, on the Gentoo forums:
https://forums.gentoo.org/viewtopic-t-1013288-highlight-syslogng.html

The relevant bits of my /etc/syslog-ng/syslog-ng.conf are as follows:

@version: 3.6
# Based on syslog-ng default configuration file for Gentoo Linux

@include "scl.conf"

options { 
        threaded(yes);
        chain_hostnames(no); 
        stats_freq(43200); 
        mark_freq(3600); 
};

source systemSource { system(); internal(); };

destination messageDestination { file("/var/log/messages"); };

log { source(systemSource); destination(messageDestination); };
Comment 1 Paul Gover 2015-04-29 18:36:10 UTC
Portage 2.2.18 (python 2.7.9-final-0, default/linux/amd64/13.0/desktop/kde, gcc-4.8.4, glibc-2.20-r2, 3.18.11-gentoolxc x86_64)
=================================================================
System uname: Linux-3.18.11-gentoolxc-x86_64-AMD_Phenom-tm-_9150e_Quad-Core_Processor-with-gentoo-2.2
KiB Mem:     5845008 total,   3106936 free
KiB Swap:   12586908 total,  12586908 free
Timestamp of repository gentoo: Sat, 25 Apr 2015 18:45:01 +0000
sh dash 0.5.7.4
ld GNU ld (Gentoo 2.24 p1.4) 2.24
distcc 3.1 x86_64-pc-linux-gnu [disabled]
app-shells/bash:          4.2_p53::gentoo
dev-java/java-config:     2.2.0::gentoo
dev-lang/perl:            5.20.2::gentoo
dev-lang/python:          2.7.9-r1::gentoo, 3.3.5-r1::gentoo
dev-util/cmake:           2.8.12.2-r1::gentoo
dev-util/pkgconfig:       0.28-r2::gentoo
sys-apps/baselayout:      2.2::gentoo
sys-apps/openrc:          0.13.11::gentoo
sys-apps/sandbox:         2.6-r1::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69::gentoo
sys-devel/automake:       1.11.6-r1::gentoo, 1.13.4::gentoo
sys-devel/binutils:       2.24-r3::gentoo
sys-devel/gcc:            4.8.4::gentoo
sys-devel/gcc-config:     1.7.3::gentoo
sys-devel/libtool:        2.4.6::gentoo
sys-devel/make:           4.1-r1::gentoo
sys-kernel/linux-headers: 3.18::gentoo (virtual/os-headers)
sys-libs/glibc:           2.20-r2::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.uk.gentoo.org/gentoo-portage
    priority: -1000

Crossdev
    location: /usr/local/portage
    masters: gentoo
    priority: 0

Paul-s-Overlay
    location: /usr/local/overlay
    masters: gentoo
    priority: 1

Installed sets: @system
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA IBM-J1.6 dlj-1.1 AdobeFlash-10 AdobeFlash-10.1 AdobeFlash-10.3 AdobeFlash-11.x Oracle-BCLA-JavaSE Nero-AAC-EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/themes/oxygen-gtk/gtk-2.0"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/var/tmp/distfiles"
EMERGE_DEFAULT_OPTS="--jobs 4 --load-average 5"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://www.mirrorservice.org/sites/www.ibiblio.org/gentoo/ http://mirror.ovh.net/gentoo-distfiles/ http://mirror.leaseweb.com/gentoo/"
LANG="en_GB.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j4"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp/tmpdir"
USE="3dnow 3dnowext X a52 aac acl acpi alsa amd64 berkdb branding bzip2 cairo cdda cdr cleartype cli cmake consolekit corefonts cracklib crypt cups cxx dbus declarative dri dts dvd dvdr emboss encode exif ffmpeg firefox flac fontconfig fortran gdbm gif glamor glibc-omitfp gpm gtk handbook iconv icu id3 id3tag ipv6 java joystick jpeg kde kipi lcms ldap libnotify mad midi mmx mmxext mng modules mp3 mp4 mpeg multilib mysql ncurses nls nptl nsplugin ogg opengl openmp orc pam pango pcre pdf phonon plasma png policykit popcnt ppds qt3support qt4 readline reports sdl semantic-desktop session sndfile spell sql sse sse2 sse3 sse4a ssl startup-notification suid svg tcpd threads tiff truetype udev udisks unicode usb vorbis wxwidgets x264 xcb xcomposite xine xml xscreensaver xv xvid zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="fuji" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="3dnow 3dnowext mmx mmxext popcnt sse sse2 sse3 sse4a" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="joystick evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en_GB en en_US" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_3" RUBY_TARGETS="ruby19 ruby20" SANE_BACKENDS="snapscan" USERLAND="GNU" VIDEO_CARDS="radeon" XFCE_PLUGINS="menu" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Comment 2 Hannes Schweizer 2015-05-18 11:21:16 UTC
Confirmed with app-admin/syslog-ng-3.6.2 as well

Here's my /etc/syslog-ng/syslog-ng.conf:
@version: 3.6
@include "scl.conf"
options { 
        threaded(yes);
        chain_hostnames(no); 
        stats_freq(43200); 
        mark_freq(3600); 
};
source src { system(); internal(); };
destination messages { file("/var/log/messages"); };
filter f_not_cron {
    not program(crond) and
    not program(CROND) or 
    not message(".*pam_unix.crond:session.*") and
    not message(".*/var/spool/cron/lastrun.*") and
    not message(".*/usr/sbin/run-crons.*"); };
log { source(src); filter(f_not_cron); destination(messages); };
Comment 3 Mr. Bones. (RETIRED) gentoo-dev 2015-05-27 06:07:54 UTC
Created attachment 404046 [details, diff]
syslog-ng-3.6.2-kmsg.patch

Try this patch and see if the behavior is as expected.
Comment 4 Paul Gover 2015-05-27 15:31:21 UTC
After a lot of flailing about, I corrected my typo (!) and got emerge to recognize the patch.  But it doesn't like it.  The important bit of patch.out is:

======================================

PATCH COMMAND:  patch -p0 -g0 -E --no-backup-if-mismatch  < '/etc/portage/patches//app-admin/syslog-ng-3.6.2/syslog-ng-3.6.2-kmsg.patch'

======================================
can't find file to patch at input line 3
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|--- ./modules/system-source/system-source.c.orig       2015-05-26 23:43:44.337099754 -0400
|+++ ./modules/system-source/system-source.c    2015-05-27 00:06:16.900992261 -0400
--------------------------
No file to patch.  Skipping patch.
1 out of 1 hunk ignored


My syslog-ng-3.6.2-kmsg.patch file was cut-and-pasted from the attachment.
Comment 5 Thomas Lindroth 2015-05-28 10:10:41 UTC
The patch works for me. I again get dmesg messages with syslog-ng-3.6.2 if I apply it.
Comment 6 Paul Gover 2015-05-28 11:08:49 UTC
To clarify the problem I had with the patch:
I downloaded the patch from
   https://bugs.gentoo.org/attachment.cgi?id=404046
into
   /etc/portage/patches/app-admin/syslog-ng/syslog-ng-3.6.2-kmsg.patch

The file and directories are owned by portage:portage and world readable.

I then ran
   emerge syslog-ng

and got the errors in my previous comments.

Line 3 of my patch file, to which patch_user is complaining, reads
   @@ -176,16 +176,16 @@

I notice that my system's sys-devel/patch was upgraded to 2.7.5 on 12th May.  

Here's emerge --info sys-devel/patch

Portage 2.2.18 (python 2.7.9-final-0, default/linux/amd64/13.0/desktop/kde, gcc-4.8.4, glibc-2.20-r2, 3.18.12-gentoolxc x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-3.18.12-gentoolxc-x86_64-AMD_Phenom-tm-_9150e_Quad-Core_Processor-with-gentoo-2.2
KiB Mem:     5845008 total,   3128060 free
KiB Swap:   12586908 total,  12586908 free
Timestamp of repository gentoo: Fri, 22 May 2015 10:15:01 +0000
sh dash 0.5.7.4
ld GNU ld (Gentoo 2.24 p1.4) 2.24
distcc 3.1 x86_64-pc-linux-gnu [disabled]
app-shells/bash:          4.3_p33-r2::gentoo
dev-java/java-config:     2.2.0::gentoo
dev-lang/perl:            5.20.2::gentoo
dev-lang/python:          2.7.9-r1::gentoo, 3.3.5-r1::gentoo
dev-util/cmake:           2.8.12.2-r1::gentoo
dev-util/pkgconfig:       0.28-r2::gentoo
sys-apps/baselayout:      2.2::gentoo
sys-apps/openrc:          0.13.11::gentoo
sys-apps/sandbox:         2.6-r1::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69::gentoo
sys-devel/automake:       1.11.6-r1::gentoo, 1.14.1::gentoo
sys-devel/binutils:       2.24-r3::gentoo
sys-devel/gcc:            4.8.4::gentoo
sys-devel/gcc-config:     1.7.3::gentoo
sys-devel/libtool:        2.4.6::gentoo
sys-devel/make:           4.1-r1::gentoo
sys-kernel/linux-headers: 3.18::gentoo (virtual/os-headers)
sys-libs/glibc:           2.20-r2::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.uk.gentoo.org/gentoo-portage
    priority: -1000

Crossdev
    location: /usr/local/portage
    masters: gentoo
    priority: 0

Pauls-Overlay
    location: /usr/local/overlay
    masters: gentoo
    priority: 1

Installed sets: @system
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA IBM-J1.6 dlj-1.1 AdobeFlash-10 AdobeFlash-10.1 AdobeFlash-10.3 AdobeFlash-11.x Oracle-BCLA-JavaSE Nero-AAC-EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/themes/oxygen-gtk/gtk-2.0"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/var/tmp/distfiles"
EMERGE_DEFAULT_OPTS="--jobs 4 --load-average 5"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://www.mirrorservice.org/sites/www.ibiblio.org/gentoo/ http://mirror.ovh.net/gentoo-distfiles/ http://mirror.leaseweb.com/gentoo/"
LANG="en_GB.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j4"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp/tmpdir"
USE="3dnow 3dnowext X a52 aac acl acpi alsa amd64 berkdb branding bzip2 cairo cdda cdr cleartype cli cmake consolekit corefonts cracklib crypt cups cxx dbus declarative dri dts dvd dvdr emboss encode exif ffmpeg firefox flac fontconfig fortran gdbm gif glamor glibc-omitfp gpm gtk handbook iconv icu id3 id3tag ipv6 java joystick jpeg kde kipi lcms ldap libnotify mad midi mmx mmxext mng modules mp3 mp4 mpeg multilib mysql ncurses nls nptl nsplugin ogg opengl openmp orc pam pango pcre pdf phonon plasma png policykit popcnt ppds qt3support qt4 readline reports sdl semantic-desktop session sndfile spell sql sse sse2 sse3 sse4a ssl startup-notification suid svg tcpd threads tiff truetype udev udisks unicode usb vorbis wxwidgets x264 xcb xcomposite xine xml xscreensaver xv xvid zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="fuji" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="3dnow 3dnowext mmx mmxext popcnt sse sse2 sse3 sse4a" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="joystick evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en_GB en en_US" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_3" RUBY_TARGETS="ruby19 ruby20" SANE_BACKENDS="snapscan" USERLAND="GNU" VIDEO_CARDS="radeon" XFCE_PLUGINS="menu" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON

=================================================================
                        Package Settings
=================================================================

sys-devel/patch-2.7.5::gentoo was built with the following:
USE="(policykit) -static -test -xattr" ABI_X86="64"
Comment 7 Paul Gover 2015-05-30 11:50:44 UTC
I see from the forums that toralf has independently hit the problem with patch_user
  http://forums.gentoo.org/viewtopic-t-1017948-highlight-syslogng+patch.html
and opened bug https://bugs.gentoo.org/550656.

I'll wait for 3.6.3, which I presume will fix both issues!
Comment 8 Paul Gover 2015-05-30 18:06:56 UTC
OK, so I've built a local overlay version of syslog-ng.ebuild, and applied the fix for 550656, and got that to apply the kmsg.patch from /etc/portage/patches.

For me, the epatch_user fix works, and the kmsg patch restores the missing dmesg output to syslog.  So I'm a happy bunny
Comment 9 gentoolinux 2015-09-29 08:04:13 UTC
Bug is still present in syslog-ng-3.6.4. Applying the patch from comment #3 solves the problem for me.
Is this bug only triggered under certain circumstances or does it affect all syslog-ng users? If the latter, I think this should be fixed soon.
Comment 10 devsk 2016-07-18 05:25:26 UTC
Why is this bug not fixed yet? All we need it to push the patch to -r1 revision.

Did anyone file an upstream bug?
Comment 11 Teika kazura 2017-03-16 04:22:34 UTC
The bug and the patch remain valid for syslog-ng-3.7.3.

I propose: add IUSE="dmesg" (or +dmesg, since it had been so before 3.4), and to metadata its description: "Capture boot dmesg." Only when a user enable it, apply the patch.

@Mr.Bones.: If you ask, I can send a patch for metadata.xml and the ebuilds.
Comment 12 devsk 2018-07-23 03:19:16 UTC
Couple of years, and the same state.

Now, the patch does not apply anymore. Thinking its fixed upstream, I removed the patch, and lo and behold, the same issue!! Sigh!
Comment 13 Teika kazura 2018-07-23 12:36:38 UTC
Created attachment 540580 [details, diff]
Patch for syslog-ng >= 3.15.1

This patch seems to apply to 3.15.1 and 3.16.1.

The updates in the upstream was "gchar *" -> "const gchar *" in two places. However, the patch has to modify these two strings. So my patch changes them to "gchar const *". 

Please someone review it. I don't know "const" well.

(In reply to devsk from comment #10)
> Did anyone file an upstream bug?

Anyone?

Regards.
Comment 14 Tomáš Mózes 2018-07-23 13:20:57 UTC
Can you please ask upstream what is their opinion on this? I will happily apply patches that are accepted upstream.
Comment 15 Teika kazura 2018-08-07 06:26:32 UTC
I'm not sure anymore if this patch is necessary, because it *seems* possible by appropriately setting syslog-ng.conf. But I fail to do it. See
https://forums.gentoo.org/viewtopic-p-8249434.html
Comment 16 Teika kazura 2018-08-08 04:54:21 UTC
This bug is *obsolete* now. At least for syslog-ng-3.16.1, the dmesg output is caught by syslog-ng. Although it's not stabilized yet, this bug can be closed.

Thanks all. Best regards.
Comment 17 Tomáš Mózes 2018-08-08 05:45:58 UTC
Thank you @Teika kazura for the information, closing.
Comment 18 Hannes Schweizer 2018-09-16 17:33:53 UTC
Confirmed for app-admin/syslog-ng-3.16.1 again.

According to the latest post of Teika kazura in
https://forums.gentoo.org/viewtopic-p-8249434.html
the problem is still present when using OpenRC.

I found a related upstream bug and bumped it: https://github.com/balabit/syslog-ng/issues/1360

Using the following upstream script
/usr/share/syslog-ng/tools/system-expand.sh
I can confirm the documented kmsg-related syslog-ng behavior
https://www.syslog-ng.com/technical-documents/doc/syslog-ng-open-source-edition/3.16/administration-guide/24#TOPIC-956474
which leads to the following system() source definition:
unix-dgram("/dev/log" so_rcvbuf(8192));
file("/dev/kmsg" program-override("kernel") flags(kernel) format(linux-kmsg) keep-timestamp(no));
which does not work on an OpenRC-based gentoo.

However it's certainly not necessary to patch any upstream sources, instead I'd recommend to adapt the syslog-ng.conf file in case OpenRC is used:
source src {
       unix-dgram("/dev/log" so_rcvbuf(8192));
       file("/proc/kmsg" program-override("kernel") flags(kernel) keep-timestamp(no));
       internal(); };
Comment 19 Teika kazura 2018-09-17 22:54:58 UTC
(In reply to Hannes Schweizer from comment #18)

> According to the latest post of Teika kazura in
> https://forums.gentoo.org/viewtopic-p-8249434.html
> the problem is still present when using OpenRC.

Nope, please read it again. 

I have these lines in syslog-ng.conf:
------
source src { system(); internal(); };
log { source(src); destination(messages); };
------

And it catches dmesg:
-----
Aug 29 19:31:01 localhost syslog-ng[3868]: syslog-ng starting up; version='3.16.1'
Aug 29 19:31:01 localhost kernel: [    0.000000] microcode: microcode updated early to revision 0xc6, date = 2018-04-17
Aug 29 19:31:01 localhost kernel: [    0.000000] Linux version 4.18.5 (root@localhost) (gcc version 6.4.0 (Gentoo 6.4.0-r1 p1.3)) #31 SMP Wed Aug 29 09:24:02 JST 2018
...
Aug 29 19:31:01 localhost kernel: [    0.000000] x86/fpu: xstate_offset[4]:  896
, xstate_sizes[4]:   64                                                         Aug 29 19:31:01 localhost kernel: [    0.000000] x86/fpu: Enabled xstate feature
s 0x1f, context size is 960 bytes, using 'compacted' format.                    Aug 29 19:31:01 localhost kernel: [    0.000000] BIOS-provided physical RAM map:
-----
"localhost kernel" comes from dmesg.