Simply run docker-compose up in the root repo
The configuration for fluent-bit is fluentbit/etc/fluent-bit.conf, in this example all inputs are redirected to standard output.
The input selected for fluentbit is TCP Json Socket because is more standard than fluent protocol. The most known languages are libraries for logging into a tcp socket so this solution it must work with many languages.
This example is tested on NodeJS >9.x with
npm install
node --experimental-modules test-fluent.mjsThis example is tested on PHP 7.x
composer install
php test-fluent.phpThis example is tested on Ruby 2.5+
sudo gem install bundler
bundle install --path vendor
ruby test-fluent.rbConfigure log4j2 with the XML
Sorry I can't make an example, my knowledge with JAVA is very poor
Useful info for Log4j with SocketAppender in Log Aggregation