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
- Host: GitHub
- URL: https://github.com/rage28/log4j2-slack
- Owner: rage28
- License: apache-2.0
- Created: 2017-08-28T08:51:08.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-08-31T12:35:29.000Z (almost 9 years ago)
- Last Synced: 2023-08-04T04:44:09.374Z (almost 3 years ago)
- Topics: appender, java, slack, slf4j, slf4j2
- Language: Java
- Size: 72.3 KB
- Stars: 3
- Watchers: 3
- Forks: 9
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
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()));
}
}
```