This week's book giveaway is in the Reactive Progamming forum.
We're giving away four copies of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams and have Adam Davis on-line!
See this thread for details.
Win a copy of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams this week in the Reactive Progamming forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

why can't i trace my log4j?

 
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i'm going mental here..



here is the log4j.xml

but stil i get:
14:01:46,164 DEBUG [TestScratchJava] hello

i cant' get TRACE level, at all, my jars are commons-logging 1.1.1 and log4j 1.2.15 so what gives?
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Log4J's default log level is DEBUG:

http://logging.apache.org/log4j/1.2/manual.html (search text for "by default, the root logger" or default, or whatever). Since you don't define a log level, it's just going to use that, hence TRACE-level log statements won't be logged. So "what gives" is that you've not configured Log4J correctly based on what you want to see.
 
Elhanan Maayan
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i meant that it DOES gets logged, but it gets logged as DEBUG, and not as trace. i thought at first i somehow have the wrong commons version (in commons 1.0.x) it used to do just that, turn every trace call into debug call, as older log4j's didn't support trace, but even this simplest code still turns into debug.
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you sure the correct version of those libraries are being used in the runtime? You can add -verbose:class to the JVM arguments, which will print out the information of the jars which are being used to load the classes. That might show you whether a stray jar in the classpath is being picked up.
 
Elhanan Maayan
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yep, did the verbose thing and it's is 1.1.1
 
What kind of corn soldier are you? And don't say "kernel" - that's only for this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!