Did anyone sucessfully setup (mostly docker)
“graylog” instead of frontail for OpenHab4 ?
(Docker working OOTB)
Did anyone sucessfully setup (mostly docker)
“graylog” instead of frontail for OpenHab4 ?
(Docker working OOTB)
This has long been on my list of things to add to my home lab so I spent a few hours setting it up.
For OH 3+, once you have GrayLog set up you can use the following in your log4j2.xml file.
Create the following Socket appender.
<!-- Gelf appender -->
<!-- https://logging.apache.org/log4j/2.x/manual/layouts.html#GELFLayout -->
<Socket name="GRAYLOG" host="10.10.1.111" port="12201" protocol="tcp" immediateFail="true">
<GelfLayout host="argus" compressionType="OFF" includeNullDelimiter="true" includeStacktrace="true">
<!-- <KeyValuePair key="additionalField1" value="constant value"/>
<KeyValuePair key="additionalField2" value="${ctx:key}"/> -->
</GelfLayout>
</Socket>
Then add GRAYLOG to each logger you want to forward to GrayLog. For example:
<!-- Karaf Shell logger -->
<Logger level="OFF" name="org.apache.karaf.shell.support">
<AppenderRef ref="STDOUT"/>
<AppenderRef ref="GRAYLOG"/>
</Logger>
See the URL in the comment above for a UDP config.