I'm using logback behind slf4j and would like to know how to obtain an OutputStream
reference from a org.slf4j.Logger
instance. The use case is Shrinkwrap's Archive.writeTo(OutputStream, ...)
method.
I'm aware that it's possible to workaround the need for this reference by creating a ByteArrayOutputStream
, pass it and write its content to the logger. And I'm aware of that stdout and stderr can be redirected to a logger in general. That being said, I'm looking for a direct answer to the question. If there's none, I'll suggest adding a mechanism to slf4j.
I'm using slf4j API 1.7.5 and logback 1.2.2.