Giter VIP home page Giter VIP logo

slack-webhook-appender's People

Contributors

53ningen avatar hinamaru avatar meso avatar piclane avatar suzuki0keiichi avatar tayama0324 avatar xuwei-k avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

slack-webhook-appender's Issues

Use of Webhook Appender

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.

hostname always comes in empty in slack messages

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>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.