Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/sbabcoc/logback-testng

Logback appender for TestNG Reporter
https://github.com/sbabcoc/logback-testng

logback-appender testng testng-reporter

Last synced: 25 days ago
JSON representation

Logback appender for TestNG Reporter

Awesome Lists containing this project

README

        

[![Maven Central](https://img.shields.io/maven-central/v/com.github.sbabcoc/logback-testng.svg)](https://mvnrepository.com/artifact/com.github.sbabcoc/logback-testng)

# logback-testng
Logback appender for TestNG Reporter

This appender enables users to direct the Logback output from TestNG tests to the TestNG Reporter. This output will be captured in the test result artifacts of each test method. This appender extends the standard [OutputStreamAppender](http://logback.qos.ch/manual/appenders.html#OutputStreamAppender), providing the full range of encoding options.

**NOTE**: Although the `ReporterAppender` class extends [OutputStreamAppender](http://logback.qos.ch/apidocs/ch/qos/logback/core/OutputStreamAppender.html), selection of a target output stream is not supported. Output from this appender is always directed to a `ReporterOutputStream`, which emits its contents to the TestNG [Reporter](http://testng.org/javadocs/org/testng/Reporter.html).

## Full configuration example

Add `logback-testng` and `logback-classic` as library dependencies to your project.

```xml
[maven pom.xml]

com.github.sbabcoc
logback-testng
1.0.0
runtime

ch.qos.logback
logback-classic
1.1.2
runtime

```

This is an example `logback.xml` that uses a common `PatternLayout` to encode a log message as a string.

```xml
[src/main/resources/logback.xml]



%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n




%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n




```

You may also look at the [complete configuration examples](src/test/resources/logback.xml)

## License

This project is licensed under the [Apache License Version 2.0](LICENSE).