Skip to content

cloudfakers/logbat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Logback extensions

To use these extensions you just need to add the logbat-0.1-SNAPSHOT.jar to in the classpath. If you use Maven, you can just add it as a dependency to your pom.xml:

<dependency>
    <groupId>com.github.cloudfackers</groupId>
    <artifactId>logbat</artifactId>
    <version>0.1-SNAPSHOT</version>
</dependency>

Batman

This is an Encoder extending the default LayoutWrappingEncoder that punch the log before dumping a stack trace.

Configuration

In logback.xml

<encoder class="com.github.cloudfackers.logbat.BatmanEncoder">
	<layout class="ch.qos.logback.classic.PatternLayout">
	    <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
	</layout>
</encoder>

ANSI art thanks to ansify.

Example

bang

Oracle Ase

This is just a converter that properly prefixes and suffixes the log messages for the oracle-ase plugin to a more proper format.

Configuration

In logback.xml, as a top-level configuration element:

<conversionRule conversionWord="msg"
                converterClass="com.github.cloudfackers.oraclease.OracleAseConverter" />

Example

The following code:

private static final Logger LOG = LoggerFactory.getLogger(VirtualMachineService.class);
private static final Logger PLUGIN_LOG = LoggerFactory.getLogger(OracleAsePlugin.class);

public static void main(String[] args) {
    LOG.info("Preparing VM deploy...");
    PLUGIN_LOG.info("Deploying VM");
}

Produces the output. Note that the converter only prefixes the oracle-ase plugin logs.

15:22:06.512 [main] INFO  c.a.a.s.c.VirtualMachineService - Preparing VM deploy...
15:22:06.517 [main] INFO  c.a.p.oraclease.OracleAseConnection - oracle-ase, Deploying VM? O que ase

Releases

No releases published

Packages

No packages published

Languages