• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Log4J problem

 
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello everyone !
Long time no see, probably that's why I couldn't find anywhere else to post this topic. If this is the wrong place for it, please move it somewhere so he can feel "at home" .
As the subject says I'm experiencing problems with log4j. The problem is that for every log line written it writes another one (identical) but without the layout applied. Example provided:
<code>
2007-03-06 15:30:54,724 INFO DeleteImagesJob - Job class ro.star.erms.common.DeleteImagesJob starting
Job class ro.star.erms.common.DeleteImagesJob starting
</code>
I am only using the stdout appender (testing purposes) so why is this happening ? I've searched everywhere in the project, there is no extra "System.out.println()".

Thank you very much and have a good day.
___________________________
Dan
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sounds like you have more than one appender configured. What does your log4j configuration file look like?
 
Daniel Platon
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

Thanks for the reply. The configuration file (xml) looks like this:


Although I configured two appenders I am only using one for testing-purposes. You may notice in my example at the begging of the thread that the second line looks pretty much like a System.out.println() rather than a log4j output.

Thanks a lot,
Dan
[ March 06, 2007: Message edited by: Daniel Platon ]
 
Joe Ess
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I tried your configuration with a simple class and log4j 1.2.13:

Looks fine.
Are you doing anything else, like using jakarta commons logging, extending log4j classes, using some central custom class for logging?
 
Daniel Platon
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello...
I've tried to change the log4j version from 1.2.8 to 1.2.14 and it has the same behavior. I am using a (very thin) wrapper class around Logger to provide my xml configuration (code follows)

If I activate the file appender and disable the console, the log entries in the file look good (with layout applied) but the same messages (without layout) still appear in the Tomcat's stdout.log

Thank you and have a good day,
Dan
[ March 07, 2007: Message edited by: Daniel Platon ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic