[logback-user] (no subject)

Robert Elliot rob at lidalia.org.uk
Tue Feb 23 19:24:33 CET 2010


It's still moving - see branch at http://github.com/Mahoney/slf4j.git under sysout-over-slf4j.  It's close to code complete but there's some tidy up and test coverage I wanted to beef up and I wanted to review the Javadoc before updating the bugzilla entry (and I need to get round to printing and signing the form saying I've given it freely).
It should be trivial to compile it (mvn package) and the only runtime dependency is slf4j-api.  It will require you to add the following line somewhere early in the application's startup sequence:
org.slf4j.sysoutslf4j.context.SysOutOverSLF4J.sendSystemOutAndErrToSLF4J();

I'd be interested in any feedback as to how it behaves in the wild.

On 23 Feb 2010, at 12:07, Ceki Gülcü wrote:

> Hello Gilles,
> 
> If as Nikolas suspects, swing uses java.util.logging which it probably
> does, then go with his suggestion of redirecting j.u.l. to SLF4J.
> 
> If for some reason swing actually writes directly to the console, then
> you would want to capture system.out and direct it to SLF4J. Robert
> Elliot started working on this very tricky topic and made some real
> progress, see [1]; but for some unfortunate reason the issue got stalled.
> 
> HTH
> 
> [1]  http://bugzilla.slf4j.org/show_bug.cgi?id=110
> 
> On 23/02/2010 12:51 PM, Nikolas Everett wrote:
>> You'd have to catch all the different loggers and funnel them into
>> slf4j.  I assume swing uses java.util.logging so you'd want the JUL to
>> SLF4J section of http://www.slf4j.org/legacy.html .  In all of my
>> projects I typically include the other bridges (JCL and Log4J) as a
>> matter of course but I normally don't have to deal with JUL.
>> 
>> On Tue, Feb 23, 2010 at 6:02 AM, Gilles Gaillard
>> <gillouxgaillard at wanadoo.fr <mailto:gillouxgaillard at wanadoo.fr>> wrote:
>> 
>>    Hi,
>> 
>>    I'm new to logback and would like to know if the following already
>>    exist / is possible, i searched the mailing list but did not find this.
>> 
>>    I've a GUI application performing usual logging through logback
>>    (that's ok) and would ensure that any unexpected failure(s) be logged.
>>    For example, unexpected errors occuring on the swing EDT go the std err.
>>    Usually I would do this by redirecting the standard out/err streams
>>    to some file output. Note also that I would like to ensure that logs
>>    from different threads will log properly. For example, stack traces
>>    should not be mangled by other logs.
>> 
>>    I wonder it is possible to do this through the logback configuration.
>>    If not what would be the best way.
>> 
>>    Thanks,
>>    -- Gilles
> 
> _______________________________________________
> Logback-user mailing list
> Logback-user at qos.ch
> http://qos.ch/mailman/listinfo/logback-user

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://qos.ch/pipermail/logback-user/attachments/20100223/a4b3f1f2/attachment.html>


More information about the Logback-user mailing list