Logback Prettier

Allow split of log level on sysout/syserr and support more advanced color by level

License

License

Categories

Categories

Logback Application Layer Libs Logging
GroupId

GroupId

fr.norad.logback.prettier
ArtifactId

ArtifactId

logback-prettier
Last Version

Last Version

0.5
Release Date

Release Date

Type

Type

jar
Description

Description

Logback Prettier
Allow split of log level on sysout/syserr and support more advanced color by level
Project Organization

Project Organization

n0rad
Source Code Management

Source Code Management

https://github.com/n0rad/logback-prettier

Download logback-prettier

How to add to project

<!-- https://jarcasting.com/artifacts/fr.norad.logback.prettier/logback-prettier/ -->
<dependency>
    <groupId>fr.norad.logback.prettier</groupId>
    <artifactId>logback-prettier</artifactId>
    <version>0.5</version>
</dependency>
// https://jarcasting.com/artifacts/fr.norad.logback.prettier/logback-prettier/
implementation 'fr.norad.logback.prettier:logback-prettier:0.5'
// https://jarcasting.com/artifacts/fr.norad.logback.prettier/logback-prettier/
implementation ("fr.norad.logback.prettier:logback-prettier:0.5")
'fr.norad.logback.prettier:logback-prettier:jar:0.5'
<dependency org="fr.norad.logback.prettier" name="logback-prettier" rev="0.5">
  <artifact name="logback-prettier" type="jar" />
</dependency>
@Grapes(
@Grab(group='fr.norad.logback.prettier', module='logback-prettier', version='0.5')
)
libraryDependencies += "fr.norad.logback.prettier" % "logback-prettier" % "0.5"
[fr.norad.logback.prettier/logback-prettier "0.5"]

Dependencies

compile (2)

Group / Artifact Type Version
ch.qos.logback : logback-classic jar 1.0.13
org.fusesource.jansi : jansi jar 1.11

Project Modules

There are no modules declared in this project.

Pretty logback output for sysout/syserr with custum color (and bold) text by level

Maven dependency :

<dependency>
  <groupId>fr.norad.logback.prettier</groupId>
  <artifactId>logback-prettier</artifactId>
  <version>0.5</version>
</dependency>

Sample logback.xml :

<configuration scan="true" scanPeriod="30 seconds">
    <conversionRule conversionWord="colorlevel"
        converterClass="fr.norad.logback.prettier.ColorLevelCompositeConverter" />
    <conversionRule conversionWord="bold"
        converterClass="fr.norad.logback.prettier.BoldCompositeConverter" />

    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
        <target>System.out</target>
        <withJansi>true</withJansi>
        <encoder>
            <pattern><![CDATA[%blue(%d{HH:mm:ss.SSS}) [%-10.10thread] %colorlevel(%-5level) %-45.45(%41C{41}:%L) - %msg%n]]></pattern>
        </encoder>
        <filter class="fr.norad.logback.prettier.OutFilter" />
    </appender>
    <appender name="STDERR" class="ch.qos.logback.core.ConsoleAppender">
        <target>System.err</target>
        <withJansi>true</withJansi>
        <encoder>
            <pattern><![CDATA[%boldBlue(%d{HH:mm:ss.SSS}) %bold([%-10.10thread]) %colorlevel(%-5level) %bold(%-45.45(%41C{41}:%L)) - %colorlevel(%msg) %n]]></pattern>
        </encoder>
        <filter class="fr.norad.logback.prettier.ErrFilter" />
    </appender>

    <root>
        <level value="DEBUG" />
        <appender-ref ref="STDOUT" />
        <appender-ref ref="STDERR" />
    </root>
</configuration>

Will result in :

alt screenshot

Versions

Version
0.5