You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Carey Boldenow <c....@cytera.com> on 2001/12/08 04:08:46 UTC

Major slowdown with high volume logging

We are currently using version 1.1.3 of log4j, and within our database framework we are using log4j
to log our jdbc database activity. We have one program that is rather database intensive, and when
we have the logging level set to debug in our properties file (see below), the program takes nearly
one hour to complete. However, if I adjust the logging level to error, the program finishes in about 
3 minutes. When the logging is set to debug, the file we are sending the logging output to does get to
be about 10mb in size. However, if I convert the logging to System.out.println, the file is about as big,
but the program still finishes in under 4 minutes. Any ideas as to why the dramatic hit on performance when
the logging is set to debug? 


# When the following two categories are set to debug, then the program takes 1 hour to complete,
# when I change them to "error", then the program completes in 3 minutes.

log4j.rootCategory=debug, file
log4j.category.DatabaseManager=DEBUG

log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d [%p] %m\n\tat %c.%M(%F:%L)\n

log4j.appender.file=org.apache.log4j.RollingFileAppender
log4j.appender.file.File=c:/jrun/logs/SQL.log
log4j.appender.file.MaxFileSize=500KB
# Keep one backup file
log4j.appender.file.MaxBackupIndex=1
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d [%t] %-5p (%F:%L) - %m%n

Thanks for your help!

Carey Boldenow

Re: Major slowdown with high volume logging

Posted by doug b <um...@yahoo.com>.
you know that %M, %L, and %F have warnings in the docs
that say they're "extremely slow", right?  as your
pattern has 2 of them, i'll bet this is a big part of
the problem.

--- Carey Boldenow <c....@cytera.com> wrote:
> We are currently using version 1.1.3 of log4j, and
> within our database framework we are using log4j
> to log our jdbc database activity. We have one
> program that is rather database intensive, and when
> we have the logging level set to debug in our
> properties file (see below), the program takes
> nearly
> one hour to complete. However, if I adjust the
> logging level to error, the program finishes in
> about 
> 3 minutes. When the logging is set to debug, the
> file we are sending the logging output to does get
> to
> be about 10mb in size. However, if I convert the
> logging to System.out.println, the file is about as
> big,
> but the program still finishes in under 4 minutes.
> Any ideas as to why the dramatic hit on performance
> when
> the logging is set to debug? 
> 
> 
> # When the following two categories are set to
> debug, then the program takes 1 hour to complete,
> # when I change them to "error", then the program
> completes in 3 minutes.
> 
> log4j.rootCategory=debug, file
> log4j.category.DatabaseManager=DEBUG
> 
>
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
>
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
> log4j.appender.stdout.layout.ConversionPattern=%d
> [%p] %m\n\tat %c.%M(%F:%L)\n
> 
>
log4j.appender.file=org.apache.log4j.RollingFileAppender
> log4j.appender.file.File=c:/jrun/logs/SQL.log
> log4j.appender.file.MaxFileSize=500KB
> # Keep one backup file
> log4j.appender.file.MaxBackupIndex=1
>
log4j.appender.file.layout=org.apache.log4j.PatternLayout
> log4j.appender.file.layout.ConversionPattern=%d [%t]
> %-5p (%F:%L) - %m%n
> 
> Thanks for your help!
> 
> Carey Boldenow
> 


__________________________________________________
Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Major slowdown with high volume logging

Posted by Ceki Gulcu <ce...@yahoo.com>.
Carey,

Watch out for the %M, %F and %L conversion characters.
On some systems they increase logging time by a factor
of 100 (e.g. AIX)! Regards, Ceki

--- Carey Boldenow <c....@cytera.com> wrote:
> We are currently using version 1.1.3 of log4j, and
> within our database framework we are using log4j
> to log our jdbc database activity. We have one
> program that is rather database intensive, and when
> we have the logging level set to debug in our
> properties file (see below), the program takes
> nearly
> one hour to complete. However, if I adjust the
> logging level to error, the program finishes in
> about 
> 3 minutes. When the logging is set to debug, the
> file we are sending the logging output to does get
> to
> be about 10mb in size. However, if I convert the
> logging to System.out.println, the file is about as
> big,
> but the program still finishes in under 4 minutes.
> Any ideas as to why the dramatic hit on performance
> when
> the logging is set to debug? 
> 
> 
> # When the following two categories are set to
> debug, then the program takes 1 hour to complete,
> # when I change them to "error", then the program
> completes in 3 minutes.
> 
> log4j.rootCategory=debug, file
> log4j.category.DatabaseManager=DEBUG
> 
>
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
>
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
> log4j.appender.stdout.layout.ConversionPattern=%d
> [%p] %m\n\tat %c.%M(%F:%L)\n
> 
>
log4j.appender.file=org.apache.log4j.RollingFileAppender
> log4j.appender.file.File=c:/jrun/logs/SQL.log
> log4j.appender.file.MaxFileSize=500KB
> # Keep one backup file
> log4j.appender.file.MaxBackupIndex=1
>
log4j.appender.file.layout=org.apache.log4j.PatternLayout
> log4j.appender.file.layout.ConversionPattern=%d [%t]
> %-5p (%F:%L) - %m%n
> 
> Thanks for your help!
> 
> Carey Boldenow
> 


__________________________________________________
Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>