dwango / slack-webhook-appender Goto Github PK
View Code? Open in Web Editor NEWLogback appender which posts logs to slack via incoming webhook.
License: MIT License
Logback appender which posts logs to slack via incoming webhook.
License: MIT License
Hey.
This is more of a simple question, rather than an issue.
It is probably even this kind of question that a google-search may solve, but I still want to ask here.
I want to implement this thing into the logback.xml, to send Webhooks, on any type of error, that could happen.
A friend already helped me on setting something up (link).
The question now is, if I can replace the link in <webhookUrl>
with some sort of function, to get the link (for example getting it from the config.json), since I don't want to publicly show the link on the GitHub and give peoples a way to mess around with it... And I also don't want to always remove the link temporarily only to publish the code and then re-add it.
If there is no such way, then I (sadly) have to search for an alternative since I try to keep such information as private as possible.
Hello!
I was able to successfully set up this module and use it however I faced an issue with 'hostname' always coming as empty.
Same if I use property("HOSTNAME")
instead. However the if condition which uses it works just fine.
Can you take a look.
My logback config looks like this:
<if condition='!property("HOSTNAME").contains("local")'>
<then>
<appender name="SLACK" class="jp.co.dwango.logback.SlackWebhookAppender">
<webhookUrl>xyz</webhookUrl>
<timeout>50000</timeout>
<payload>
{
"channel": "#channel-layer-notifications",
"username": "username",
"icon_emoji": emoji,
"link_names": 1,
"attachments": [{
"title": level,
"color": color,
"fields": [
{
"title": "Hostname",
"value": hostname,
"short": true
},
{
"title": "Message: ",
"value": message,
"short": false
}
]}
]}
</payload>
</appender>
<appender name="ASYNC_SLACK" class="ch.qos.logback.classic.AsyncAppender">
<appender-ref ref="SLACK" />
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>ERROR</level>
</filter>
</appender>
<root level="ERROR">
<appender-ref ref="ASYNC_SLACK" />
</root>
</then>
<else>
... other config
</else>
</if>
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.