A lot of debug logs

View: New views
4 Messages — Rating Filter:   Alert me  

A lot of debug logs

by Mel T () :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

When using DBUnit in a JUnit ANT task, and setting logging level to DEBUG, we can quickly get OutOfMemoryError (java heap space).

I traced that to be caused by JUnit's ant task that accumulates all logging into a ByteArrayOutputStream, which is only freed when the test finishes its execution.

The biggest log producer is DBUnit (by many a few order of magnitude), so I wonder if all these fine grained debug logs are still necessary?

This problem actually showed up when we moved to slf4j and logback. We had forgotten to define a config file, thus logback sent DEBUG level logs. We could not see where the OutOfMemoryError came from because the JUnit ant task does not output logs to the console until the test finishes (by default). So all we saw was this memory error.

I do not know yet why JUnit task buffers logs like that, but nonetheless, I wonder why there are so many logs in DBUnit.

--
Mel T.

Parent Message unknown Re: A lot of debug logs

by Matthias Gommeringer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Mel,

I agree with you when it comes to the "method-entering" debug messages. They should rather be logged in the trace mode by dbunit.
But for the time being you could just configure "org.dbunit=INFO" or so to avoid your problem.

rgds,
matthias

> -----Ursprüngliche Nachricht-----
> Von: "Mel T" <machintruc@...>
> Gesendet: 31.07.09 19:42:50
> An: dbunit-user@...
> Betreff: [dbunit-user]  A lot of debug logs


>
> Hi,
>
> When using DBUnit in a JUnit ANT task, and setting logging level to DEBUG,
> we can quickly get OutOfMemoryError (java heap space).
>
> I traced that to be caused by JUnit's ant task that accumulates all logging
> into a ByteArrayOutputStream, which is only freed when the test finishes its
> execution.
>
> The biggest log producer is DBUnit (by many a few order of magnitude), so I
> wonder if all these fine grained debug logs are still necessary?
>
> This problem actually showed up when we moved to slf4j and logback. We had
> forgotten to define a config file, thus logback sent DEBUG level logs. We
> could not see where the OutOfMemoryError came from because the JUnit ant
> task does not output logs to the console until the test finishes (by
> default). So all we saw was this memory error.
>
> I do not know yet why JUnit task buffers logs like that, but nonetheless, I
> wonder why there are so many logs in DBUnit.
>
> --
> Mel T.
> --
> View this message in context: http://www.nabble.com/A-lot-of-debug-logs-tp24757848p24757848.html
> Sent from the DBUnit - Users mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
> trial. Simplify your report design, integration and deployment - and focus on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> _______________________________________________
> dbunit-user mailing list
> dbunit-user@...
> https://lists.sourceforge.net/lists/listinfo/dbunit-user
>


______________________________________________________
GRATIS für alle WEB.DE-Nutzer: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://movieflat.web.de


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
dbunit-user mailing list
dbunit-user@...
https://lists.sourceforge.net/lists/listinfo/dbunit-user

Re: A lot of debug logs

by Mel T :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Matthias Gommeringer wrote:
I agree with you when it comes to the "method-entering" debug messages. They should rather be logged in the trace mode by dbunit.
But for the time being you could just configure "org.dbunit=INFO" or so to avoid your problem.
Of course, changing logging for dbunit is what I had to do. But the fact that logback defaults to DEBUG for root logger, and because ant's junit task buffers all logs without displaying them in the console, it was not trivial to figure out that the memory error comes from logging that many log calls coming out of dbunit (i.e. we never get to see those logs before the program crashes).

And yes, TRACE would prevent that problem.

Regards,

Mel T.

Parent Message unknown Re: A lot of debug logs

by Matthias Gommeringer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I just created a feature request to do this. It's unfortunately a matter of time to get that implemented...

thanks for reporting,
matthias

> -----Ursprüngliche Nachricht-----
> Von: "Mel T" <machintruc@...>
> Gesendet: 31.07.09 22:32:04
> An: dbunit-user@...
> Betreff: Re: [dbunit-user] A lot of debug logs


>
>
> Matthias Gommeringer wrote:
> >
> > I agree with you when it comes to the "method-entering" debug messages.
> > They should rather be logged in the trace mode by dbunit.
> > But for the time being you could just configure "org.dbunit=INFO" or so to
> > avoid your problem.
> >
>
> Of course, changing logging for dbunit is what I had to do. But the fact
> that logback defaults to DEBUG for root logger, and because ant's junit task
> buffers all logs without displaying them in the console, it was not trivial
> to figure out that the memory error comes from logging that many log calls
> coming out of dbunit (i.e. we never get to see those logs before the program
> crashes).
>
> And yes, TRACE would prevent that problem.
>
> Regards,
>
> Mel T.
> --
> View this message in context: http://www.nabble.com/A-lot-of-debug-logs-tp24757848p24762667.html
> Sent from the DBUnit - Users mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
> trial. Simplify your report design, integration and deployment - and focus on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> _______________________________________________
> dbunit-user mailing list
> dbunit-user@...
> https://lists.sourceforge.net/lists/listinfo/dbunit-user
>


______________________________________________________
GRATIS für alle WEB.DE-Nutzer: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://movieflat.web.de


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
dbunit-user mailing list
dbunit-user@...
https://lists.sourceforge.net/lists/listinfo/dbunit-user