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

https://github.com/rage28/log4j2-slack

Apache SLF4J2 Slack Appender
https://github.com/rage28/log4j2-slack

appender java slack slf4j slf4j2

Last synced: 5 months ago
JSON representation

Apache SLF4J2 Slack Appender

Awesome Lists containing this project

README

          

# Log4j2 Slack Appender

This is a highly customizable appender for [Apache SLF4J2](https://logging.apache.org/log4j/2.x/) to push the logs to Slack using [webhooks](https://api.slack.com/incoming-webhooks)

## Dependencies

Gradle
```groovy
dependencies {
compile 'com.github.rage28:log4j2-slack:1.0'
}
```
Maven
```xml

com.github.rage28
log4j2-slack
1.0

```

## Configuration

Example
```xml









```

```java
import com.github.rage28.log4j2.slack.message.SlackLogMessage;
import com.github.rage28.log4j2.slack.model.SlackLog.SlackLogBuilder;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

public class MyClass {
private static Logger logger = LogManager.get(MyClass.class);

public static void main(String[] args) {
logger.error(new SlackLogMessage(SlackLogBuilder.builder()
.withTitle("This is a title")
.withColor("red")
.withText("Something bad happened! I can feel it")
.build()));
}
}
```