Skip to content

About

Fast, Small, JDK 21+, GraalVM native friendly SLF4J logging framework

Topics

Resources

Stars

123 stars

Watchers

2 watching

Forks

Latest commit

 

History

1,296 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Maven Central Github Code Coverage

Rainbow Gum Logo

Rainbow Gum

A modern modular JDK 21+ logging framework that offers implementations for multiple facades like SLF4J / System.Logger and does mostly what you want out of the box.

It is called rainbow gum after Eucalyptus Deglupta a beautiful tree native to Hawaii that has colorful bark (colorful logs).

Rainbow Gum console output: colored timestamp, thread, level, logger, and key values

In Rainbow Gum you can:

  • Leverage your existing configuration/application framework (like avaje-config or Spring Boot Environment).
  • Do all your logging configuration in Java with a discoverable API of builders
  • Only use System Properties and no loading of resources for a ultimate minimal experience
  • Or various combinations of the above

Because Rainbow Gum is very modular it can provide a more "choose your own" experience where you can scale down and only use the JDK System.Logger with minimal dependencies or scale up with fully loaded ANSI SLF4J experience. In some cases just adding modules will provide automatic configuration.

Rainbow Gum's default property configuration follows Spring Boot's patterns so if you are familiar with logging.level... than you will feel at home with Rainbow Gum whether you use Spring or not.

Regardless of which configuration option you choose it is GraalVM native friendly, Jlinkable, and initializes hella fast.

The long term goal of Rainbow Gum is to be a logging framework for all with the only requirement being a modern JDK.

Documentation

Warning

While this readme does contain some documentation the above is the preferred documentation and more likely to be up to date and correct!

The doc is also on javadoc.io but is not aggregated like the above.

For previous releases:

https://jstach.io/doc/rainbowgum/VERSION/apidocs

Where VERSION is the version you want.

Why choose Rainbow Gum

Covered in why_rainbowgum_is_better.md.

Colorful logs

Rainbow Gum core comes with themes that work on three different formats also included in core: TTLL, JSON5, and logfmt.

The console format below is TTLL (time, thread, level, logger), colored with the "One Dark" theme (note no pattern module or pattern string is needed and only one line of configuration is required):

logging.appender.console.encoder.ttll.theme=one_dark

TTLL output with the one_dark theme

darcula uses IntelliJ's colors:

TTLL output with the darcula theme

spring matches Spring Boot's console colors and, like rainbowgum, uses the terminal's own palette, so it works on light backgrounds too:

TTLL output with the spring theme on a light terminal

The same themes color the structured encoders in core. logfmt writes one key=value line per event for Loki, Vector and Go tooling:

logging.appender.console.encoder.uri=logfmt
logging.appender.console.encoder.logfmt.theme=one_dark

logfmt output with the one_dark theme

json5 switches to structured output while you hunt a bug, here pretty printed:

logging.appender.console.encoder.uri=json5
logging.appender.console.encoder.json5.prettyPrint=full

Pretty printed json5 output

Color is only written when the console supports ANSI, so piping to a file stays plain. The screenshots are Rainbow Gum's real output rendered with xterm.js; see etc/screenshots/generate.

Developing Rainbow Gum

Covered in development.md

About

Fast, Small, JDK 21+, GraalVM native friendly SLF4J logging framework

Topics

Resources

Stars

123 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages