I'm writing a custom Logback appender which will route log messages to a messaging platform. This all works, but my problem is: what if it doesn't?
Inside a Logback appender you can't use Logback; the docs mentions that there are methods addInfo(), addWarn() and addError() that you can use for this.
However, what I've found in my experimenting is that these only show up in normal system logging when I call them from within the appender's start() method where I'm verifying the appender configuration. But when I call them from within append(): nothing.
If something goes wrong at runtime I'd like to report this in some way to operations, instead of logging just going silent. Does anybody know how to achieve this? Thanks in advance for any tips or pointers.
Things I tried: print a simple "hello" using addInfo() and addWarn() and printing direct to System.out and System.err.
I also looked at the source of ConsoleAppender and within my own appender tried to emulate that using ex.printStackTrace(new PrintStream(ConsoleTarget.SystemOut.getStream())); but none of these produce any output at all.