tobias- / slack-appender

Slack Appender for Log4j
MIT License
8 stars 1 forks source link

Slack appender does not use custom patternlayout #3

Closed jamakal closed 6 years ago

jamakal commented 6 years ago

Thanks for the great project! I've noticed that when I attempt to use the slack appender with a custom PatternLayout, i.e.:

<Slack name="Slack" webhookUrl="..." username="...">
    <PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n"/>
</Slack>

The message posted to Slack seems to ignore the pattern. Any ideas?

Cheers!

tobias- commented 6 years ago

Thanks :)

I'm actually sitting here laughing. I've using it for years and haven't thought about it until now. I don't even use the layout, so it's no surprise. It's an easy fix that I should be able to get out in the next few days.

jamakal commented 6 years ago

Perfect, thanks tobias, much appreciated!

tobias- commented 6 years ago

Please test what I've released (1.3.0). It's currently making it's way through the maven central mirroring system, so expect it in an hour or so.

I will move the package-muting to an Appender instead (based off of PatternLayout), because the code is pretty hacky atm. That appender should also have two different patterns. One for the actual "text" and one for the "attachment" (the indented part). Not sure when that'll happen.

Close this issue when you have verified it.

jamakal commented 6 years ago

Perfect, thanks tobias - can confirm the date appears correctly! I have noticed a couple of other bugs whilst testing but I'll raise these separately.

Thanks again!