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>
This is an Encoder extending the default LayoutWrappingEncoder
that punch the log before dumping a stack trace.
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.
This is just a converter that properly prefixes and suffixes the log messages for the
oracle-ase
plugin to a more proper format.
In logback.xml
, as a top-level configuration element:
<conversionRule conversionWord="msg"
converterClass="com.github.cloudfackers.oraclease.OracleAseConverter" />
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